tests for FANPT - #212
Merged
Merged
Conversation
Contributor
|
One of the fanpt tests is still importing |
Contributor
Author
done! |
kzsigmond
reviewed
Jun 8, 2026
kzsigmond
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the tests @rugwed-lokhande. I just have a couple of comments.
Also, just a general observation: you have sometimes FakeObjective, DummyContainer, etc. in multiple test files. Is there an overlap? If so, maybe having a utility file that all of the tests import things from would make a bit more sense. Then we only have to modify these fake and dummy objects at one place if the code changes.
kzsigmond
approved these changes
Jun 10, 2026
2 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.
Description
This PR updates and expands the FANPT test suite.
The existing
tests/test_fanpt.pytests have been updated to use the newer PyCI/FanCI interface instead of the olderconvert_to_fanciworkflow. The refactor now constructs the projected Schrödinger objective throughProjectedSchrodinger, builds the PyCI interface withlegacy_fanci=False, and evaluates overlaps/objectives through the updated interface.In addition, this PR adds several new unit test files for the FANPT container and updater components:
test_fanpt_container_base.pytest_fanpt_container_constant_terms.pytest_fanpt_container_energy_free.pytest_fanpt_container_energy_param.pytest_fanpt_container_updater.pytest_fanpt_fanpt.pyThese tests use lightweight mock objects and monkeypatching to isolate FANPT logic from the full PyCI/FanCI backend where possible. The new tests cover container initialization behavior, derivative generation, constant-term construction, active-energy and energy-free branches, updater behavior, and high-level FANPT workflow logic.
Main Changes
convert_to_fancipath in the affected tests.Motivation
The FANPT tests were outdated relative to the current PyCI/FanCI interface. This PR brings the tests closer to the current code structure and adds more focused coverage for the FANPT container and updater modules. The added tests should make future refactoring safer by checking the main derivative, constant-term, and update pathways independently.
Notes
Some tests use simplified mock objects rather than full molecular calculations. This is intentional: the goal is to test FANPT control flow and algebraic behavior without requiring the full backend setup for every unit test.