Skip to content

Commit

Permalink
Correct regex parsing + binary strings dec
Browse files Browse the repository at this point in the history
  • Loading branch information
FNTwin committed Aug 8, 2024
1 parent a1061a8 commit dab04ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions openqdc/datasets/potential/ani.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def convert_forces(self, x):
return super().convert_forces(x) * 0.529177249 # correct the Dataset error

def __smiles_converter__(self, x):
return x
return "-".join(x.decode("ascii").split("-")[:-1])


class ANI1CCX(ANI1):
Expand Down Expand Up @@ -195,10 +195,7 @@ class ANI1CCX(ANI1):
__links__ = {"ani1x.hdf5.gz": "https://zenodo.org/record/4081694/files/292.hdf5.gz"}

def __smiles_converter__(self, x):
"""util function to convert string to smiles: useful if the smiles is
encoded in a different format than its display format
"""
return x
return x.decode("ascii")


class ANI1CCX_V2(ANI1CCX):
Expand Down
2 changes: 1 addition & 1 deletion openqdc/datasets/potential/maceoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def parse_mace_xyz(xyzpath):
energy_re = re.compile(r"energy=(\S+)")
smiles_re = re.compile(r"smiles=(\S+)")
subset_re = re.compile(r"config_type=(\S+)")
subset_re = re.compile(r"config_type=([^;]+)\ MACE_energy")
with open(xyzpath, "r") as f:
n_atoms = None
counter = 0
Expand Down

0 comments on commit dab04ef

Please sign in to comment.