-
Notifications
You must be signed in to change notification settings - Fork 830
Fix XDR indentation issue and update sphinx config #5250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,6 +169,9 @@ def __init__( | |
| self.n_atoms = self._xdr.n_atoms | ||
|
|
||
| if not refresh_offsets: | ||
| lock_name = offsets_filename(self.filename, ending="lock") | ||
| open(lock_name, "a").close() | ||
|
|
||
| self._load_offsets() | ||
| else: | ||
| self._read_offsets(store=True) | ||
|
|
@@ -194,23 +197,18 @@ def __init__( | |
| self.convert_pos_from_native(self.ts.dimensions[:3]) | ||
|
|
||
| @classmethod | ||
| def parse_n_atoms(cls, filename, **kwargs): | ||
| with cls._file(filename) as f: | ||
| n_atoms = f.n_atoms | ||
| return n_atoms | ||
|
|
||
| def close(self): | ||
| """close reader""" | ||
| self._xdr.close() | ||
|
|
||
| def _load_offsets(self): | ||
| """load frame offsets from file, reread them from the trajectory if that | ||
| fails. To prevent the competition of generating the same offset file | ||
| from multiple processes, an `InterProcessLock` is used.""" | ||
|
|
||
| fname = offsets_filename(self.filename) | ||
| lock_name = offsets_filename(self.filename, ending="lock") | ||
|
|
||
| # check if the location of the lock is writable. | ||
| # create lock file | ||
| open(lock_name, "a").close() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems... unnecessary, considering context manager below... |
||
|
|
||
| # check if the location of the lock is writable. | ||
| try: | ||
| with FileLock(lock_name) as filelock: | ||
| pass | ||
|
|
@@ -224,6 +222,7 @@ def _load_offsets(self): | |
| return | ||
| else: | ||
| raise | ||
|
|
||
|
|
||
| with FileLock(lock_name) as filelock: | ||
| if not isfile(fname): | ||
|
|
@@ -236,6 +235,7 @@ def _load_offsets(self): | |
| # this warning can be avoided by loading Universe like: | ||
| # u = mda.Universe(data.TPR, data.XTC, refresh_offsets=True) | ||
| # refer to Issue #1893 | ||
|
|
||
| data = read_numpy_offsets(fname) | ||
| if not data: | ||
| warnings.warn( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,7 @@ class KeyStyle(UnsrtStyle): | |
| html_theme_options = { | ||
| "mda_official": True, | ||
| "extra_nav_links": extra_nav_links, | ||
| "display_version": True, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? Please explain. Especially since it's a deprecated option: https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#confval-display_version |
||
| } | ||
|
|
||
| # Theme options are theme-specific and customize the look and feel of a theme | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are two of the functions removed and _load_offsets() suddenly a class method?