Skip to content

Commit

Permalink
Add commentary.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwest authored and JacksonBurns committed Apr 1, 2024
1 parent 98b28de commit 0824273
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,10 @@ def remove_group(self, group_to_remove):
groups we also, need to re-point any unicode thermo_data that may
have pointed to the entry.
Returns the removed group
This is not (as of 2024/03) used within RMG-Py, but could be useful for
people making ancillary scripts to manipulate or edit the database.
Returns the removed group.
"""

# First call base class method
Expand Down
4 changes: 4 additions & 0 deletions test/rmgpy/data/thermoTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1673,8 +1673,12 @@ def test_remove_group(self):
group_to_remove2 = rad_group.entries["CsJ"]
rad_group.remove_group(group_to_remove2)
# If group_to_remove was a data object, we point toward parent instead
# RJ2_triplet pointed to CsJ, which had data
# After we remove CsJ, RJ2_triplet points to the parent, which was RJ
assert rad_group.entries["RJ2_triplet"].data == group_to_remove2.parent.label
# If the parent pointed toward group_to_remove, we need should have copied data object
# RJ used to just point at CJ, which pointed at CsJ. After we remove CsJ,
# RJ should contain the data copied from CsJ
Tlist = [300, 400, 500, 600, 800, 1000, 1500]
assert not isinstance(group_to_remove2.parent.data, str)
assert group_to_remove2.parent.data.get_enthalpy(298) == group_to_remove2.data.get_enthalpy(298)
Expand Down

0 comments on commit 0824273

Please sign in to comment.