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

Update solventcomponent to encompass all composition properties #262

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

IAlibay
Copy link
Member

@IAlibay IAlibay commented Dec 27, 2023

Fixes #261

@pep8speaks
Copy link

pep8speaks commented Dec 27, 2023

Hello @IAlibay! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 21:80: E501 line too long (80 > 79 characters)
Line 23:80: E501 line too long (106 > 79 characters)
Line 70:80: E501 line too long (80 > 79 characters)
Line 71:80: E501 line too long (81 > 79 characters)
Line 73:80: E501 line too long (93 > 79 characters)
Line 113:80: E501 line too long (133 > 79 characters)
Line 179:13: E129 visually indented line with same indent as next logical line
Line 198:17: E129 visually indented line with same indent as next logical line
Line 213:5: E129 visually indented line with same indent as next logical line
Line 213:80: E501 line too long (85 > 79 characters)

Line 122:80: E501 line too long (200 > 79 characters)

Line 215:80: E501 line too long (107 > 79 characters)

Line 35:80: E501 line too long (514 > 79 characters)
Line 130:80: E501 line too long (553 > 79 characters)

Comment last updated at 2023-12-27 23:52:45 UTC

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ae96d30) 99.20% compared to head (02284dc) 99.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #262      +/-   ##
==========================================
+ Coverage   99.20%   99.23%   +0.02%     
==========================================
  Files          36       36              
  Lines        1898     1963      +65     
==========================================
+ Hits         1883     1948      +65     
  Misses         15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -535,7 +537,7 @@ def to_keyed_dict(self, include_defaults=True) -> Dict:

if not include_defaults:
for key, value in self.defaults().items():
if dct.get(key) == value:
if np.all(dct.get(key) == value):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is probably the wrong way to do this

Defined the shape of the solvent box being built. Can be one of
'cube', 'dodecahedron', and 'octahedron'. Cannot be defined alongside
`box_vectors`. Default 'cube'
box_vectors : openff.units.unit.Quantity, optional
Copy link
Member Author

Choose a reason for hiding this comment

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

missing box_size

Copy link
Contributor

@richardjgowers richardjgowers left a comment

Choose a reason for hiding this comment

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

I'm not sure this is fitting the model we've got currently. ChemicalSystem is meant to capture things that can affect the free energy differences between different ChemicalSystems. This instead seems to be trying to capture a molecular simulation setup, which is different. The solvation additions here shouldn't be affecting the measured (D)DG; padding should be enough that isn't affecting (D)DG, box shape should also be unimportant.

I think the fields num_solvent / padding / vectors are implementation details and should be in a Settings object not here. E.g. if I ran ChemicalSystem(w/ LigA) -> ChemicalSystem(w/ LigB) using a triclinic box, and ChemicalSystem(w/ LigA) -> ChemicalSystem(w/ LigB) with a rectangular box, these two ChemicalSystem(w/ LigA) are identical.

Comment on lines +73 to +74
box_shape: Optional[Literal['cube', 'dodecahedron', 'octahedron']] = 'cube',
box_vectors: Optional[unit.Quantity] = None,):
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we get to storing boxes, I'm not sure it makes sense to store the box_shape independently of the vectors, the vectors can/should define the shape.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not everyone can handle dealing with both - it's too much to ask users to provide box vectors a priori.

ion_concentration: unit.Quantity = 0.15 * unit.molar):
ion_concentration: Optional[unit.Quantity] = 0.15 * unit.molar,
solvent_padding: Optional[unit.Quantity] = 1.2 * unit.nanometer,
solvent_density: Optional[unit.Quantity] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

this is probably worth including, as it does affect the reduced potential

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what you mean here - density is a function of N and volume, everything here defines both of those things.

Defined the shape of the solvent box being built. Can be one of
'cube', 'dodecahedron', and 'octahedron'. Cannot be defined alongside
`box_vectors`. Default 'cube'
box_vectors : openff.units.unit.Quantity, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

Putting in box_vectors will be needed for explicit solvents, but I don't think we'll need to backport that field to this definition

@IAlibay
Copy link
Member Author

IAlibay commented Jan 1, 2024

@richardjgowers solvation, particularly the number of waters does affect both the dH (which we will want to be able to calculate), and the dG under certain circumstances.

@IAlibay IAlibay added this to the Release 2.0.0 milestone Oct 4, 2024
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.

Update SolventComponent properties to include those that define the composition of the solvent
3 participants