Skip to content

Modernise package: Python 3.10+ compatibility, pytest, bug fixes, updated tests#25

Merged
daviddesancho merged 61 commits into
masterfrom
develop
Jun 10, 2026
Merged

Modernise package: Python 3.10+ compatibility, pytest, bug fixes, updated tests#25
daviddesancho merged 61 commits into
masterfrom
develop

Conversation

@daviddesancho

Copy link
Copy Markdown
Collaborator

Summary

  • CI migration: Travis CI replaced with GitHub Actions; tests run on Python 3.10/3.11/3.12 × ubuntu/macOS
  • Bug fixes: fixed SuperMSM.self.keys AttributeError, MSM.calc_count wrong x.keys reference, TimeSeries(dtraj=) kwarg typo, calc_eigsK complex eigenvector array type
  • Core refactor: msm.py and traj.py significantly simplified and modernised; traj_lib.py trimmed; np.float/np.matrix deprecations removed
  • Test coverage: 1 active test → 37 active tests; re-enabled TestMSMLib (19 methods), added fresh TestSuperMSM (3 methods)
  • Packaging: version 0.1dev0.2.0, Python 3.10/3.11/3.12 classifiers, python_requires>=3.10, install_requires list, scikit-learn added to requirements
  • Examples: updated alanine dipeptide and pentapeptide notebooks; removed stale dpca/multi notebooks
  • TODO.md: added with TICA implementation as next planned feature

Test plan

  • CI passes on all 6 matrix combinations (Python 3.10/3.11/3.12 × ubuntu/macOS)
  • pytest mastermsm/test/ -v → 37 passed locally
  • pip install -e . succeeds cleanly

🤖 Generated with Claude Code

New pynb with Schutte potential
daviddesancho and others added 29 commits July 21, 2022 12:24
- traj.py: fix typo _read_dtraj -> _read_distraj (broke discrete traj loading)
- msm.py: fix wrong loop variable self.keys[k] -> self.keys[i] in do_lbrate
- msm.py: replace deprecated np.float() with float() (removed in NumPy>=1.24)
- msm_lib.py: replace deprecated np.matrix() with plain ndarray in do_boots_worker
- traj_lib.py: remove unconditional top-level hdbscan import (optional dependency)
- traj.py: make hdbscan a lazy import with a clear ImportError message
- test/download_data.py: use __file__-relative paths instead of os.getcwd()
- test/test_trajectory.py: fix import paths and hardcoded 'test/data/' paths
- test/test_msm.py: fix import path for download_data

All 14 tests now pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs pytest on push/PR to master and develop across:
- OS: ubuntu-latest, macos-latest
- Python: 3.10, 3.11, 3.12

Uses miniforge/conda to install mdtraj and scientific stack reliably.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Same broken 'from test.download_data import ...' path that was causing
pytest collection to fail across all CI matrix jobs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Travis CI no longer supports open source projects. Replaced with the
new GitHub Actions CI badge pointing to BioKT/MasterMSM. Removed the
Codacy badge which referenced the old repo and is not configured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- msm_lib.py: fix two remaining np.float() calls in calc_mlrate
- ci.yml: print package versions before tests and use --tb=long
  to diagnose the Python 3.10-specific failure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix TimeSeries(dtraj=) → TimeSeries(distraj=) kwarg typo in test setUp
- Fix SuperMSM.__init__ missing self.keys (AttributeError in do_lbrate)
- Fix MSM.calc_count using x.keys instead of self.keys
- Fix calc_eigsK eigenvector arrays: float → complex to avoid ComplexWarning
- Re-enable TestMSMLib (19 methods) and add fresh TestSuperMSM (3 methods);
  fix deprecated np.float/np.complex in test_calc_eigsK; fix tau_averages
  call signature; 1 active test → 37 active tests, all passing
- Update setup.py: version 0.1dev → 0.2.0, Python 3.10/3.11/3.12 classifiers,
  python_requires>=3.10, install_requires list
- Add mdtraj and scikit-learn to requirements.txt
- Add TODO.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@daviddesancho daviddesancho merged commit 39815ad into master Jun 10, 2026
2 of 6 checks passed
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