-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix issues 381, 382, and add a Mass type #385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to work, just a few doc changes
>>> length = BSS.Types.Length(12, "G") | ||
>>> print(length.kilograms()) | ||
|
||
The same as above, except passing a string representation of the | ||
length to the constructor. | ||
|
||
>>> import BioSimSpace as BSS | ||
>>> length = BSS.Types.Length("12 G") | ||
>>> print(length.kilograms()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the docstring here is wrong. Presumably it should be something like
mass = BSS.Types.Mass(12,"G")
print(mass.kilogram())
...
mass = BSS.Types.Length("12 G")
print(mass.kilogram())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, looks like the function .kilogram()
not .kilograms()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will fix this now. I think I copied the previous class template over, but clearly forgot to modify all of the docstring.
python/BioSimSpace/Types/_mass.py
Outdated
>>> import BioSimSpace as BSS | ||
>>> length = BSS.Types.Length(12, "G") | ||
>>> print(length.kilograms()) | ||
|
||
The same as above, except passing a string representation of the | ||
length to the constructor. | ||
|
||
>>> import BioSimSpace as BSS | ||
>>> length = BSS.Types.Length("12 G") | ||
>>> print(length.kilograms()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, docstring needs to be changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good 👍
This PR closes #381 by adding a
._to_default_unit()
method to the internalGeneralUnit
class. This simply returnsself
, since they are by definition in internal default units.The PR also closes #382 by clarifying the use of the
explicit_dummies
kwarg in theProcess.Amber
constructor docstring.The PR also adds support for a new
Mass
type, aMass
requirement for nodes, andMass
unit convenience classes.devel
into this branch before issuing this pull request (e.g. by runninggit pull origin devel
): [y]