Conversation
- Refactored `tests/conftest.py` to conditionally mock heavy dependencies (`torch`, `ase`, `fairchem`, `rdkit`, `morfeus`, `torch_sim`) using `sys.modules` injection. This allows tests to run in lightweight environments while supporting real dependencies if available.
- Updated `mock_atoms_factory` to dynamically return atomic coordinates and symbols matching the requested size, resolving issues with `zip` length mismatch in IO tests.
- Improved `MockConformerEnsemble` to correctly handle `from_rdkit` and return appropriate conformers (e.g., handling SMILES like "CCCC" to match test expectations).
- Expanded test coverage:
- Added `tests/test_decorators.py`.
- Added tests for `HF_TOKEN` configuration handling in `tests/test_models.py`.
- Added tests for optimizer convergence warnings in `tests/test_optimizer.py`.
- Verified and fixed existing tests in `tests/test_api.py`, `tests/test_cli.py`, `tests/test_config.py`, `tests/test_io.py`, `tests/test_models.py`, `tests/test_optimizer.py`.
- Addressed all code review feedback, including cleaner environment variable handling with `monkeypatch` and better mocking strategies.
Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces a comprehensive test suite for the GPUMA repository. It addresses the lack of testing by enabling tests to run in environments without heavy dependencies installed (via robust, conditional mocking in
conftest.py). The suite covers the full API, CLI, configuration, IO handling, and optimizer logic. Special care was taken to mock Fairchem and Torch-Sim models securely, handlingHF_TOKENrequirements as requested.PR created automatically by Jules for task 6643312877358509178 started by @niklashoelter