Repository navigation
Add docstrings and comprehensive tests for models and optimizer - #16
Conversation
…er modules - Added docstrings to `src/gpuma/config.py` for `_Section` and `Config` classes. - Enhanced `tests/conftest.py` to correctly link mocked submodules for `ase`, `fairchem`, `morfeus`, and `rdkit`. - Implemented comprehensive tests in `tests/test_optimizer_module.py` covering single structure and batch optimization (sequential and batch modes), mocking `ase` and `torch_sim` interactions. - Added detailed tests in `tests/test_models_module.py` for model loading, caching behavior, and environment configuration. - Fixed `tests/test_mol_utils.py` failure caused by incorrect mocking of `rdkit`. 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. |
…er modules - Added docstrings to `src/gpuma/config.py` for `_Section` and `Config` classes. - Enhanced `tests/conftest.py` to correctly link mocked submodules for `ase`, `fairchem`, `morfeus`, and `rdkit`. - Implemented comprehensive tests in `tests/test_optimizer_module.py` covering single structure and batch optimization (sequential and batch modes), mocking `ase` and `torch_sim` interactions. - Added detailed tests in `tests/test_models_module.py` for model loading, caching behavior, and environment configuration. - Fixed `tests/test_mol_utils.py` failure caused by incorrect mocking of `rdkit`. - Linted tests to comply with project style guidelines. - Ensured tests properly mock network calls to avoid CI failures with gated Hugging Face repos. Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
This PR addresses the user request to ensure all functions are properly documented and that the test suite covers all functionalities.
Changes:
src/gpuma/config.py. Verified that other core modules (optimizer.py,models.py, etc.) have appropriate docstrings.tests/conftest.pyto properly mock nested dependencies likerdkit.Chemandase.optimize, resolving issues where mocks were not correctly linked to their parent modules. This ensures tests run correctly in environments without heavy dependencies installed.tests/test_optimizer_module.pywith tests foroptimize_single_structure(verifying ASE integration) andoptimize_structure_batch(verifying both sequential and GPU-accelerated batch modes). Mockstorch_simandaseappropriately.tests/test_models_module.pyto testload_model_fairchemandload_model_torchsim, verifying cache directory usage, model path loading, and HF token handling via environment variables.All tests (42 items) pass successfully.
numpyis installed in the test environment and is not mocked.PR created automatically by Jules for task 1878505356613482669 started by @niklashoelter