Skip to content

Commit

Permalink
Merge branch 'MDAnalysis:develop' into parallelization_polymer
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishy7777 authored Jan 18, 2025
2 parents b7328ba + 6842fd7 commit c2ff3b5
Show file tree
Hide file tree
Showing 54 changed files with 6,860 additions and 4,948 deletions.
45 changes: 43 additions & 2 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# black
83e5f99051d86ca354b537be8854c40f9b6ce172
##### git-blame shows what revision and author last modified each line of a file
##### The ".git-blame-ignore-revs" file is used to ignore certain revisions from being
##### shown in the output of git blame (also on GitHub blame view).
#
# ~~~ Commits that only change the formatting of the code should be ignored. ~~~
#
# --- Automated Formatting with `black` ---
# MDAnalysis was automatically formatted with `black` (end of 2024, beginning of 2025).
# Formatting PRs (should) contain "[fmt]" in the title (and so do the related commits).
# See https://github.com/MDAnalysis/mdanalysis/issues/2450 for more details.
# The following commits are squash commits that contain only^ formatting changes.
# ^ This is not strictly true. See PRs for the nitty gritty details.
#. PR numbers are listed just above the commit being ignored.
#4725
571431a169e5881f7d09930c4d7e633df0f2cd40
#4726
46be788d84a6cb149d90e4493a726c3a30b3cca0
#4802
441e2c67abdb8a0a5ffac4a0bc5e88bc7c329aa8
#4804
25e755fd78e0a6fb71a91c9d3d989328f021f34b
#4809
557f27d658ff0d4011bbe0efa03495f18aa2c1ce
#4848
b710e57a64654bed5250eb771f0f27a2dddfeebf
#4850
9110a6efe2765802856d028e650ebb0117d336bf
#4851
a10e23e681023f383baac7582c39dce4180e2263
#4856
c08cb797fd1a2cb45bc0b9e4522cabb15d1f36bd
#4857
29deccc9b43a09d2ec3b456bb9c70aae4c34c2cd
#4859
9312fa67f163ec055a66f5756a182206fbea3130
#4861
55cce24003d4c0975b1bba387b9e6ac20638780e
#4874
5eef34165b03281515e08a69159f6504e3a2ff8b
#4875
b8fe34b73c9df9330c1608229b2f8cddc6e275b4
#4885
263bbe65047e535fbad981852ad9c7327826f93d
6 changes: 3 additions & 3 deletions .github/actions/setup-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ inputs:
default: 'codecov'
cython:
default: 'cython'
fasteners:
default: 'fasteners'
filelock:
default: 'filelock'
griddataformats:
default: 'griddataformats'
gsd:
Expand Down Expand Up @@ -110,7 +110,7 @@ runs:
CONDA_MIN_DEPS: |
${{ inputs.codecov }}
${{ inputs.cython }}
${{ inputs.fasteners }}
${{ inputs.filelock }}
${{ inputs.griddataformats }}
${{ inputs.hypothesis }}
${{ inputs.matplotlib }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ jobs:
fail-fast: false
matrix:
# Stick to macos-13 because some of our
# optional depss don't support arm64 (i.e. macos-14)
# optional deps don't support arm64 (i.e. macos-14)
#
# add "3.13" once conda-forge packages are available (see #4805)
os: [ubuntu-latest, macos-13]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -285,11 +287,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
wheels: ['true', 'false']
exclude:
- os: "macos-14"
python-version: "3.9"
steps:
# Checkout to have access to local actions (i.e. setup-os)
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .pep8speaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scanner:

pycodestyle: # Valid if scanner.linter is pycodestyle
max-line-length: 79
ignore: ["E203", "E701"]
ignore: ["E203", "E701", "W503"]
exclude: []
count: False
first: False
Expand All @@ -17,7 +17,7 @@ pycodestyle: # Valid if scanner.linter is pycodestyle

flake8: # Valid if scanner.linter is flake8
max-line-length: 79
ignore: ["E203", "E501", "E701"]
ignore: ["E203", "E501", "E701", "W503"]
exclude: []
count: False
show-source: False
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
scikit-learn
tqdm
threadpoolctl
fasteners
filelock
displayName: 'Install dependencies'
# for wheel install testing, we pin to an
# older NumPy, the oldest version we support and that
Expand Down
44 changes: 0 additions & 44 deletions maintainer/active_files_package.lst

This file was deleted.

21 changes: 0 additions & 21 deletions maintainer/active_files_testsuite.lst

This file was deleted.

2 changes: 1 addition & 1 deletion maintainer/conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- codecov
- cython
- docutils
- fasteners
- filelock
- griddataformats
- gsd
- h5py>=2.10
Expand Down
6 changes: 4 additions & 2 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The rules for this file:


-------------------------------------------------------------------------------
??/??/?? IAlibay, ChiahsinChu, RMeli, tanishy7777, talagayev,
tylerjereddy
??/??/?? IAlibay, ChiahsinChu, RMeli, tanishy7777, talagayev, tylerjereddy,
marinegor

* 2.9.0

Expand All @@ -37,6 +37,8 @@ Enhancements


Changes
* Changed `fasteners` dependency to `filelock` (Issue #4797, PR #4800)
* Codebase is now formatted with black (version `24`) (PR #4886)

Deprecations

Expand Down
48 changes: 31 additions & 17 deletions package/MDAnalysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@
"""

__all__ = ['Universe', 'Writer',
'AtomGroup', 'ResidueGroup', 'SegmentGroup']
__all__ = ["Universe", "Writer", "AtomGroup", "ResidueGroup", "SegmentGroup"]

import logging
import warnings
Expand All @@ -161,10 +160,11 @@
logger = logging.getLogger("MDAnalysis.__init__")

from .version import __version__

try:
from .authors import __authors__
except ImportError:
logger.info('Could not find authors.py, __authors__ will be empty.')
logger.info("Could not find authors.py, __authors__ will be empty.")
__authors__ = []

# Registry of Readers, Parsers and Writers known to MDAnalysis
Expand All @@ -178,16 +178,23 @@
_SELECTION_WRITERS: Dict = {}
_CONVERTERS: Dict = {}
# Registry of TopologyAttributes
_TOPOLOGY_ATTRS: Dict = {} # {attrname: cls}
_TOPOLOGY_TRANSPLANTS: Dict = {} # {name: [attrname, method, transplant class]}
_TOPOLOGY_ATTRNAMES: Dict = {} # {lower case name w/o _ : name}
_TOPOLOGY_ATTRS: Dict = {} # {attrname: cls}
_TOPOLOGY_TRANSPLANTS: Dict = (
{}
) # {name: [attrname, method, transplant class]}
_TOPOLOGY_ATTRNAMES: Dict = {} # {lower case name w/o _ : name}
_GUESSERS: Dict = {}

# custom exceptions and warnings
from .exceptions import (
SelectionError, NoDataError, ApplicationError, SelectionWarning,
MissingDataWarning, ConversionWarning, FileFormatWarning,
StreamWarning
SelectionError,
NoDataError,
ApplicationError,
SelectionWarning,
MissingDataWarning,
ConversionWarning,
FileFormatWarning,
StreamWarning,
)

from .lib import log
Expand All @@ -197,8 +204,9 @@
del logging

# only MDAnalysis DeprecationWarnings are loud by default
warnings.filterwarnings(action='once', category=DeprecationWarning,
module='MDAnalysis')
warnings.filterwarnings(
action="once", category=DeprecationWarning, module="MDAnalysis"
)


from . import units
Expand All @@ -213,11 +221,17 @@

from .due import due, Doi, BibTeX

due.cite(Doi("10.25080/majora-629e541a-00e"),
description="Molecular simulation analysis library",
path="MDAnalysis", cite_module=True)
due.cite(Doi("10.1002/jcc.21787"),
description="Molecular simulation analysis library",
path="MDAnalysis", cite_module=True)
due.cite(
Doi("10.25080/majora-629e541a-00e"),
description="Molecular simulation analysis library",
path="MDAnalysis",
cite_module=True,
)
due.cite(
Doi("10.1002/jcc.21787"),
description="Molecular simulation analysis library",
path="MDAnalysis",
cite_module=True,
)

del Doi, BibTeX
10 changes: 6 additions & 4 deletions package/MDAnalysis/coordinates/XDR.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import numpy as np
from os.path import getctime, getsize, isfile, split, join
import warnings
import fasteners
from filelock import FileLock

from . import base
from ..lib.mdamath import triclinic_box
Expand Down Expand Up @@ -121,6 +121,8 @@ class XDRBaseReader(base.ReaderBase):
Add a InterProcessLock when generating offsets
.. versionchanged:: 2.4.0
Use a direct read into ts attributes
.. versionchanged:: 2.9.0
Changed fasteners.InterProcessLock() to filelock.FileLock
"""
@store_init_arguments
def __init__(self, filename, convert_units=True, sub=None,
Expand Down Expand Up @@ -195,18 +197,18 @@ def _load_offsets(self):

# check if the location of the lock is writable.
try:
with fasteners.InterProcessLock(lock_name) as filelock:
with FileLock(lock_name) as filelock:
pass
except OSError as e:
if isinstance(e, PermissionError) or e.errno == errno.EROFS:
warnings.warn(f"Cannot write lock/offset file in same location as "
f"{self.filename}. Using slow offset calculation.")
self._read_offsets(store=True)
self._read_offsets(store=False)
return
else:
raise

with fasteners.InterProcessLock(lock_name) as filelock:
with FileLock(lock_name) as filelock:
if not isfile(fname):
self._read_offsets(store=True)
return
Expand Down
2 changes: 1 addition & 1 deletion package/MDAnalysis/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
and write your own Python code.
"""

__all__ = ['AtomGroup', 'Selection']
__all__ = ["AtomGroup", "Selection"]

from .groups import AtomGroup
from .selection import Selection
Loading

0 comments on commit c2ff3b5

Please sign in to comment.