Skip to content
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 is_isomorphous #279

Merged
merged 9 commits into from
Nov 4, 2024
5 changes: 3 additions & 2 deletions reciprocalspaceship/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ def unstack_anomalous(self, columns=None, suffixes=("(+)", "(-)")):

return result

def is_isomorphous(self, other, cell_threshold=0.05):
def is_isomorphous(self, other, cell_threshold=0.5):
"""
Determine whether DataSet is isomorphous to another DataSet. This
method confirms isomorphism by ensuring the spacegroups are equivalent,
Expand Down Expand Up @@ -1214,7 +1214,8 @@ def is_isomorphous(self, other, cell_threshold=0.05):
for param in params:
param1 = self.cell.__getattribute__(param)
param2 = other.cell.__getattribute__(param)
if (np.abs((param1 - param2)) / 100.0) > cell_threshold:
diff = 200.0 * np.abs(param1 - param2) / (param1 + param2)
if diff > cell_threshold:
return False

return True
Expand Down