Skip to content

Clean, document, type check, lint, all the things#16

Merged
smparker merged 19 commits intomasterfrom
cleanup
Feb 27, 2026
Merged

Clean, document, type check, lint, all the things#16
smparker merged 19 commits intomasterfrom
cleanup

Conversation

@smparker
Copy link
Copy Markdown
Owner

Major effort to clean up code quality through better documentation, and automatically including type checking and linting into the work flow.

smparker and others added 19 commits February 6, 2026 15:37
Fix critical bugs: dedent QMMM.clone() from inside compute(), replace bare
except with specific exceptions, replace asserts with proper errors in AFSSH.
Sync version across .bumpversion.cfg and docs/conf.py, update README with
accurate models/options/API docs. Add dt validation to AdiabaticMD, default
Ehrenfest outcome_type to populations. Unify coupling_energy_threshold as a
class attribute in DiabaticModel_ and AdiabaticModel_. Document the
needed_gradients/needed_couplings None="all" convention. Standardize all
test files from unittest to pytest style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…naming rules

- Remove unused imports across 6 files (Dict, Tuple, sys, math, Union, numpy)
- Run yapf formatter with project .style.yapf config
- Configure good-names and good-names-rgxs in .pylintrc for scientific
  variable naming conventions (H, dV, delR, NAC_matrix, etc.)
- Disable too-many-positional-arguments (R0917) globally
- Disable too-many-instance-attributes for SurfaceHoppingMD
- Remove deprecated suggestion-mode option for pylint 4.x compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix genuine bugs: bare-except, dangerous mutable default argument,
missing super().__init__(), raise-missing-from, unreachable code,
attribute-defined-outside-init, wrong-import-order, and argument
names mismatched with base class. Add comprehensive docstrings to
turboparse module and remaining undocumented classes/methods. Convert
%-formatting and .format() to f-strings, remove superfluous parens,
fix simple no-else-return cases, narrow broad exceptions to specific
types, disable too-few-public-methods globally, and add
augmented_integration to AugmentedFSSH recognized_options.

Pylint score: 8.69 -> 9.76/10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updated the GitHub Actions workflow to include mypy for type checking alongside pylint. This enhances code quality by ensuring type correctness in the mudslide module.
Introduced a new 'developing.rst' file that outlines the setup of a development environment, instructions for running CI checks locally, and guidelines for code formatting and type checking. Updated the index to include a link to the new developer guide.
- Introduced a new base class `TrajectoryMD` for shared infrastructure across molecular dynamics types, including adiabatic and surface hopping dynamics.
- Updated `AdiabaticMD` and `SurfaceHoppingMD` to inherit from `TrajectoryMD`, streamlining initialization and common functionality.
- Replaced deprecated `_force` methods with `force` in relevant classes for consistency.
- Configured CI to run mypy and pylint, achieving zero mypy errors and improving code quality.
- Cleaned up unused imports and ensured compliance with pylint standards across multiple files.
Print step, time, total energy, average temperature, and wall time
to stdout and a report file during simulation. SurfaceHoppingMD
appends the active state column. Configurable via report_every and
report_file options; disabled with report_every=0 or report_file=None.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also adds mass attribute declaration to ElectronicModel_ base class
and uses DiabaticModel_ for surface.py where model.V() is called.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smparker smparker merged commit e4d1530 into master Feb 27, 2026
7 checks passed
@smparker smparker deleted the cleanup branch February 28, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant