Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Connectivity Strategy #1

Merged
merged 23 commits into from
Jan 14, 2025
Merged

Conversation

ianmkenney
Copy link
Member

No description provided.

Initial implementation of _propose, using the mean connectivity of the
edges' (transformations) nodes as unnormalized weights.

The weights have yet to be normalized and the tests are just checking
that the means are correct.
In order to preserve unnormalized weights, which might be useful for
debugging/have a more intuitive meaning, the StrategyResult now holds
onto these values directly and normalization is handled by calling the
new `StrategyResult.resolve` method.
* Strategy initialization now checks that the settings provided to the
constructor are the correct type specified by the _settings_cls class
attribute of any Strategy subclass. This has the effect that a
Strategy author must explicitly specify what settings they are will to
accept. This deviates slightly from the gufe Protocol class, which
doesn't perform such a check. Tests were added to
`test_strategy_abstraction.py` showing only specified StrategySettings
will be allowed.

* Added TypeVar for ProtocolResults in the `Strategy` base class. Any
downstream use of the `propose` method will then check that it's being
fed a dictionary with subclasses of ProtocolResults. I don't believe
there is an easier way to do this since the ProtocolResult is embedded
in a dictionary.

* gufe doesn't work with pydantic v2, so I now use the pydantic v1
api.

* The match statement for capturing the max_runs / cutoff settings was
updated and properly catches which of these were set to None
* Provide a variety of parameters to ConnectivityStrategySettings

Termination logic within _propose depends on the combination of
parameters given to ConnectivityStrategySettings. A preset batch of
valid settings are provided through SETTINGS_VALID.

* Test ConnectivityStrategySettings validators

Add a test for sets of ConnectivityStrategySettings including both
valid and invalid settings. If an Exception is expected, check that it
is raised, otherwise check that the settings could be instantiated.

* Simulate the ConnectivityStrategy

Test that the ConnectivityStrategy terminates after a set number of
iterations. The max number of iterations is set to 100.

* Remove abstract method bodies from coverage reports
Add a test for ConnectivityStrategy demonstrating deterministc
proposals. Given random ProtocolResults, show that StrategyResults are
the same after multiple runs.
Since features in the planned gufev1.2.0 release are needed by
stratocaster, we need to accurately recreate an environment that gufe
will provide upon installation. By using a submodule, we can install
the base testing environment from the gufe environment.yml file. This
will be reverted once gufev1.2.0 is available on conda-forge.

This also makes it easier to react to last minute changes to gufe
prior to its v1.2.0 release.
@dotsdl
Copy link
Member

dotsdl commented Jan 13, 2025

@ianmkenney I'd say go ahead and merge. We'll make changes via other PRs going beyond this. Great work!

The data structures returned by gufe fixtures have use outside of the
package testing (think example systems in docs). I've extracted the
network fixture so it is returned by a regular function in the
stratocaster.tests.networks module.
gufe v1.2.0 is available on conda-forge, no longer need the submodule
for testing.

pydantic imports now match the style used in gufe to address version issue.
@ianmkenney ianmkenney force-pushed the feature/connectivity_strategy branch from 0411e3c to 98ebdc1 Compare January 14, 2025 16:17
@ianmkenney ianmkenney force-pushed the feature/connectivity_strategy branch from 98ebdc1 to 26a2314 Compare January 14, 2025 16:18
@ianmkenney ianmkenney merged commit 793c476 into main Jan 14, 2025
6 checks passed
@ianmkenney ianmkenney deleted the feature/connectivity_strategy branch January 14, 2025 17:47
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.

2 participants