-
Notifications
You must be signed in to change notification settings - Fork 850
Automatically renormalize line endings to \n (LF) (Fixes #5315) #5446
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
Open
jeremyleung521
wants to merge
13
commits into
MDAnalysis:develop
Choose a base branch
from
jeremyleung521:renormalize-line-endings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
51adaab
update .gitattributes
jeremyleung521 8080304
text=auto
jeremyleung521 612f9a7
update text=auto
jeremyleung521 41f7f35
test
jeremyleung521 cf5511e
test2
jeremyleung521 3006d90
renormalize all non-data files line endings to LF
jeremyleung521 adb26d8
update CHANGELOG
jeremyleung521 c96636d
drop EOL whitespaces
jeremyleung521 88b19fe
more EOL whitespace
jeremyleung521 d1f3b8e
loosen up so git diff is not affected
jeremyleung521 2bac0c7
renormalize
jeremyleung521 36df05c
.gitattributes cleanup
jeremyleung521 666aafe
pesky typo
jeremyleung521 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| mypy==0.960 | ||
| mypy==0.960 | ||
| typing_extensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Rather leave auto in so any future
windows-onlytest 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 withgit <2.10but that is over 10 years old at this point.