You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Certain mc.Moves attributes can be edited in unrealistic ways. For example, I can create an mc.Moves object and then edit the max_translate attribute to 'happy new year':
species_list= [typed_methane,typed_ethane]
moves=mc.Moves('nvt',species_list)
moves.max_translate[0] ='happy new year'
This is obviously absurd, but I cannot find a simple solution. The max_translate attribute is protected by @property, but the above example circumvents that because the moves.max_translate calls the getter, which returns the private moves._max_translate, which is subsequently sliced and edited, entirely circumventing the setter and any sanity checks.
Describe the solution you'd like
The ability for the user to edit the mc.Moves object after its creation, but check that the specified edits are valid. Currently, sanity checks are only applied if the user tries to replace the entire attribute (e.g., moves.max_translate = [[1.0, 2.0]] rather than moves.max_translate[0][0] = 1.0).
Describe alternatives you've considered
Certain attributes could be made immutable by using sets rather than lists. Alternatively, the attributes could be specific to the box and species, e.g. something like, moves.max_translate.box1.species1.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Certain
mc.Moves
attributes can be edited in unrealistic ways. For example, I can create anmc.Moves
object and then edit themax_translate
attribute to'happy new year'
:This is obviously absurd, but I cannot find a simple solution. The
max_translate
attribute is protected by@property
, but the above example circumvents that because themoves.max_translate
calls thegetter
, which returns the privatemoves._max_translate
, which is subsequently sliced and edited, entirely circumventing thesetter
and any sanity checks.Describe the solution you'd like
The ability for the user to edit the
mc.Moves
object after its creation, but check that the specified edits are valid. Currently, sanity checks are only applied if the user tries to replace the entire attribute (e.g.,moves.max_translate = [[1.0, 2.0]]
rather thanmoves.max_translate[0][0] = 1.0
).Describe alternatives you've considered
Certain attributes could be made immutable by using sets rather than lists. Alternatively, the attributes could be specific to the box and species, e.g. something like,
moves.max_translate.box1.species1
.The text was updated successfully, but these errors were encountered: