-
Notifications
You must be signed in to change notification settings - Fork 9
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
Attempt to support forcebalance and forksbalance #223
Attempt to support forcebalance and forksbalance #223
Conversation
I can't decide if this is a functional or aesthetic preference, but I'll shoot anyway: if these are separate optimizers, maybe they should be in separate modules? Right now they're obviously similar and class ForceBalanceOptimizerBase(BaseOptimizer):
...
class OpenFFForceBalanceOptimizer(ForceBalanceOptimizerBase):
... makes sense but they may diverge in the future. I wonder if composition beats inheritance in this case, or even allowing for some duplicated code? class ForceBalanceOptimizer(BaseOptimizer):
...
class OpenFFForceBalanceOptimizer(BaseOptimizer):
# These methods can pluck from ForceBalanceOptimizer methods one-by-one ...
... |
Sorry @mattwthompson, I didn't realise this was blocking you. I'd like to stick with the inheritance-in-a-single-module design for now. I don't wanna maintain duplicate code or do major refactors until I have more confidence in the testing suite, and I think this is the best option in the meantime. It keeps all the relevant code in one module for comprehensibility and represents a minimal change that can be inspected more easily than a refactor towards composition and away from inheritance. Though I definitely usually agree with the principle! As of right now I've got tests working and I've successfully run fits with both versions of ForceBalance via the CLI with the last commit on this branch. If you could review it and merge it with your branch when you're ready that'd be great. The optimizer can be chosen with the openff-bespoke executor run \
--smiles 'CC' \
--workflow 'default' \
--n-qc-compute-workers 1 \
--qc-compute-n-cores 12 \
--default-qc-spec xtb gfn2xtb none \
--target-torsion '[C:1]-[C:2]' \
--optimizer openff-forcebalance Unless I've messed up my environments (which I've put a lot of effort into not messing up), this runs successfully with I think the only problem that still needs to be fixed is that in |
This workflow is used to setup the general force field fits so its important we keep this working |
Would you be open to merging this PR first? It seems to be an improvement over #221 given this doesn't muck with the If I'm following, that the current tests don't rely on |
The tests here rely on |
The tests aren't running on this PR because it's pointing at your PR, not main 🙂 and the tests will pass because both force balances are present in the test environment, and their behaviour is the same in this instance. We just need to revert that change so we support installs without ForksBalance |
Description
See #221 (comment). test_forcebalance.py tests both optimizers, test_forcebalance_only.py only tests upstream FB (it's identical to test_forcebalance.py on main), and test_openff_forcebalance.py only tests our fork.
Todos
Notable points that this PR has either accomplished or will accomplish.
Questions
Status