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

[WIP] Settings model with both pydantic 1 and 2 support #16

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion feflow/settings/nonequilibrium_cycling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from typing import Optional
from gufe.settings import Settings
from openff.units import unit
from pydantic import root_validator
# Support for both pydantic 1 and 2
try:
from pydantic.v1 import root_validator
except ImportError:
from pydantic import root_validator
Comment on lines +10 to +14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what we're doing too everywhere. If we wanted to migrate to v2 only, we'd have to chase upstream to check if anything is v1 only. I haven't had time to check, but I'd guess that OpenFF + QCStack might be a place where there's significant usage of pydantic (and I have no idea if they've prioritised this).

from openfe.protocols.openmm_utils.omm_settings import SystemSettings, SolvationSettings
from openfe.protocols.openmm_rfe.equil_rfe_settings import AlchemicalSettings

Expand Down
Loading