Merged
Conversation
* Fix linter warnings/errors. * Sort imports. * Format code and docstrings. * Update/Clarify docstrings. * Refactor function `mdtools.select.atoms_around_point`: Remove the `warn_empty` and `verbose` arguments, because they can be parsed as keyword arguments.
Let `black` check the format of `mdtools.select` during the CI workflow.
Remove the `--line-length` option, because it is set in the config file (`pyproject.toml`) Add * `mdtools/scipy_helper_functions.py` * `mdtools/statistics.py` * `scripts/gmx/*.py` * `scripts/*.py` to the list of files whose format is checked by `black` during the CI workflow.
The flake8 error code F821 ("undefined name name") was originally
ignored, because it caused false positives in docstrings, because flake8
does not recognize `doctest_global_setup` in the Sphiny config file
`conf.py`. However, when ignoring F821, developers don't get warned about
undefined variables in the source code.
Therefore, we don't exclude F821 generally, but exclude it during the
flake8 lining phase in the CI workflow and during the flake8 pre-commit
hook.
Set default output array if keyword arguments are given but the `out` keyword is not defined. This should speed up the calculation, because no new memory must be allocated for the output array.
Refactor the function `mdtools.numpy_helper_functions.extend` to raise a proper `numpy.AxisError` if the given axis is out of bounds for the input array. Additionally, add examples to the docstring.
Add a new function `mdtools.numpy_helper_functions.digitize_dd` that extends the function `numpy.digitize` to multi-dimensional data. The new function takes a 2-dimensional array and multiple bin arrays and returns the bin indices to which each value in the input array belongs.
Fix function `mdtools.check.bins`. Fixed issue: If `num` is `None` or is not equal to `num != (stop - start) / step` it should be calculated according to `int(np.around((stop - start) / step))`. However, all variables are of type `decimal.Decimal` which `np.around` cannot handle. Therefore, `int(np.around((stop - start) / step))` was changed to `round((stop - start) / step)`. Additionally, fix the error that a message was shown (if `verbose` is `True`) saying that `step` has been changed although it wasn't actually changed. Finally, sort the import statements of `mdtools.check`.
bfd910c to
144a5b3
Compare
Add a new function `mdtools.structure.assign_atoms_to_grid` that takes an MDAnalysis AtomGroup and assigns its atoms to the subvolumes that are spanned by a given grid.
Create a new script `subvolume_charge.py` that calculate the net charge of cubic subvolumes of the simulation box.
144a5b3 to
5101274
Compare
14 tasks
15 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New script
subvolume_charge.pyType of change
Proposed changes
Create a new script
subvolume_charge.pythat calculates the net charge of cubic subvolumes of the simulation box.PR checklist