Skip to content

Commit

Permalink
hotfix greater than/less than operations in pdb_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian Jamasb committed Aug 15, 2024
1 parent 598a6c4 commit ca918bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions graphein/ml/datasets/pdb_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,10 @@ def oligomeric(
update: bool = False,
) -> pd.DataFrame:
"""Select molecules with a given oligmeric length.
I.e. ``df.n_chains ==/</> oligomer``
I.e. ``df.n_chains ==/ =< / >= oligomer``
N.b. the `comparison` arguments for `"greater"` and `"less"` are
`>=` and `=<` respectively.
:param length: Oligomeric length of molecule, defaults to ``1``.
:type length: int
Expand All @@ -1106,9 +1109,9 @@ def oligomeric(
if comparison == "equal":
df = splits_df.loc[splits_df.n_chains == oligomer]
elif comparison == "less":
df = splits_df.loc[splits_df.n_chains < oligomer]
df = splits_df.loc[splits_df.n_chains <= oligomer]
elif comparison == "greater":
df = splits_df.loc[splits_df.n_chains > oligomer]
df = splits_df.loc[splits_df.n_chains >= oligomer]
else:
raise ValueError(
"Comparison must be one of 'equal', 'less', or 'greater'."
Expand Down

0 comments on commit ca918bf

Please sign in to comment.