Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ensure all line endings for text files are LF (UNIX, Python default) and not CRLF (Windows/DOS default)
* text=auto eol=lf

# Data files from testsuite/MDAnalysisTests/data/windows/* need to end with CRLF for Windows testing
testsuite/MDAnalysisTests/data/windows/* text=auto eol=crlf
Comment on lines +4 to +5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather leave auto in so any future windows-only test binary files are exempted so no one has to think about it in the future. I don't think text attribute determination is ever documented to have different behaviors across platforms. There were some problems with git <2.10 but that is over 10 years old at this point.


94 changes: 47 additions & 47 deletions benchmarks/benchmarks/topology.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import MDAnalysis
import numpy as np
from MDAnalysis.guesser import DefaultGuesser
try:
from MDAnalysis.exceptions import NoDataError
from MDAnalysisTests.datafiles import GRO
except:
pass
class TopologyGuessBench(object):
"""Benchmarks for individual
topology functions
"""
params = (10, 100, 1000, 10000)
param_names = ["num_atoms"]
def setup(self, num_atoms):
self.u = MDAnalysis.Universe(GRO)
self.ag = self.u.atoms[:num_atoms]
self.vdwradii = {"H": 1.0, "C": 1.0, "N": 1.0, "O": 1.0, "DUMMY": 1.0}
def time_guessbonds(self, num_atoms):
"""Benchmark for guessing bonds"""
DefaultGuesser(None).guess_bonds(
self.ag, self.ag.positions, box=self.ag.dimensions, vdwradii=self.vdwradii
)
class BondsBench(object):
"""
Benchmarks for getting bonds
"""
params = (1000, 10000, 100000, 1000000)
param_names = ["num_bonds"]
def setup(self, num_bonds):
self.u = MDAnalysis.Universe.empty(2 * num_bonds)
bonds = np.arange(2 * num_bonds).reshape(num_bonds, 2)
self.u.add_bonds(bonds)
def time_bonds(self, num_bonds):
"""Benchmark for calculating bonds"""
self.u.bonds
import MDAnalysis
import numpy as np
from MDAnalysis.guesser import DefaultGuesser

try:
from MDAnalysis.exceptions import NoDataError
from MDAnalysisTests.datafiles import GRO
except:
pass


class TopologyGuessBench(object):
"""Benchmarks for individual
topology functions
"""

params = (10, 100, 1000, 10000)
param_names = ["num_atoms"]

def setup(self, num_atoms):
self.u = MDAnalysis.Universe(GRO)
self.ag = self.u.atoms[:num_atoms]
self.vdwradii = {"H": 1.0, "C": 1.0, "N": 1.0, "O": 1.0, "DUMMY": 1.0}

def time_guessbonds(self, num_atoms):
"""Benchmark for guessing bonds"""
DefaultGuesser(None).guess_bonds(
self.ag, self.ag.positions, box=self.ag.dimensions, vdwradii=self.vdwradii
)


class BondsBench(object):
"""
Benchmarks for getting bonds
"""

params = (1000, 10000, 100000, 1000000)
param_names = ["num_bonds"]

def setup(self, num_bonds):
self.u = MDAnalysis.Universe.empty(2 * num_bonds)
bonds = np.arange(2 * num_bonds).reshape(num_bonds, 2)
self.u.add_bonds(bonds)

def time_bonds(self, num_bonds):
"""Benchmark for calculating bonds"""
self.u.bonds
92 changes: 46 additions & 46 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
[mypy]
ignore_missing_imports = True
exclude = doc/sphinx/source/
[mypy-MDAnalysis.analysis.*]
ignore_errors = True
[mypy-MDAnalysis.auxiliary.*]
ignore_errors = True
[mypy-MDAnalysis.converters.*]
ignore_errors = True
[mypy-MDAnalysis.coordinates.*]
ignore_errors = True
[mypy-MDAnalysis.core.*]
ignore_errors = True
[mypy-MDAnalysis.selections.*]
ignore_errors = True
[mypy-MDAnalysis.tests.*]
ignore_errors = True
[mypy-MDAnalysis.topology.*]
ignore_errors = True
[mypy-MDAnalysis.transformations.*]
ignore_errors = True
[mypy-MDAnalysis.visualization.*]
ignore_errors = True
[mypy-MDAnalysis.due]
ignore_errors = True
[mypy-MDAnalysis.exceptions]
ignore_errors = True
[mypy-MDAnalysis.units]
ignore_errors = True
[mypy-MDAnalysis.version]
ignore_errors = True
[mypy]
ignore_missing_imports = True
exclude = doc/sphinx/source/


[mypy-MDAnalysis.analysis.*]
ignore_errors = True

[mypy-MDAnalysis.auxiliary.*]
ignore_errors = True

[mypy-MDAnalysis.converters.*]
ignore_errors = True

[mypy-MDAnalysis.coordinates.*]
ignore_errors = True

[mypy-MDAnalysis.core.*]
ignore_errors = True

[mypy-MDAnalysis.selections.*]
ignore_errors = True

[mypy-MDAnalysis.tests.*]
ignore_errors = True

[mypy-MDAnalysis.topology.*]
ignore_errors = True

[mypy-MDAnalysis.transformations.*]
ignore_errors = True

[mypy-MDAnalysis.visualization.*]
ignore_errors = True

[mypy-MDAnalysis.due]
ignore_errors = True

[mypy-MDAnalysis.exceptions]
ignore_errors = True

[mypy-MDAnalysis.units]
ignore_errors = True

[mypy-MDAnalysis.version]
ignore_errors = True
2 changes: 1 addition & 1 deletion mypy_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mypy==0.960
mypy==0.960
typing_extensions
2 changes: 2 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Fixes
to version 5.1.0 (Issue #5145, PR #5146)
* Fixes incorrect assignment of secondary structure to proline residues in
DSSP by porting upstream PyDSSP 0.9.1 fix (Issue #4913)
* Added `.gitattributes` to enforce LF (\n) as line endings and renormalized
existing files to conform (Issue #5315, PR #5446)

Enhancements
* Added ASV benchmark for PDB trajectory reading (PR #5394)
Expand Down
Loading
Loading