Skip to content

Commit

Permalink
Remove useless pieces of code in update of space groups, but keep the…
Browse files Browse the repository at this point in the history
… things that should stay...
  • Loading branch information
alexhernandezgarcia committed Oct 20, 2023
1 parent dd36350 commit d7b27f6
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions gflownet/envs/crystals/spacegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,36 +727,24 @@ def _restrict_space_groups(self, sg_subset: Optional[Iterable] = None):
del self.point_symmetries[ps]

# Update self.crystal_lattice_systems based on point symmetries
cls_to_remove = []
point_symmetries = set(self.point_symmetries)
for cls in self.crystal_lattice_systems:
cls_point_symmetries = point_symmetries.intersection(
set(self.crystal_lattice_systems[cls]["point_symmetries"])
)
if len(cls_point_symmetries) == 0:
cls_to_remove.append(cls)
else:
self.crystal_lattice_systems[cls]["point_symmetries"] = list(
cls_point_symmetries
)
for cls in cls_to_remove:
del self.crystal_lattice_systems[cls]
self.crystal_lattice_systems[cls]["point_symmetries"] = list(
cls_point_symmetries
)

# Update self.point_symmetries based on point symmetries
ps_to_remove = []
# Update self.point_symmetries based on crystal lattice systems
crystal_lattice_systems = set(self.crystal_lattice_systems)
for ps in self.point_symmetries:
ps_crystal_lattice_systems = crystal_lattice_systems.intersection(
set(self.point_symmetries[ps]["crystal_lattice_systems"])
)
if len(ps_crystal_lattice_systems) == 0:
ps_to_remove.append(ps)
else:
self.point_symmetries[ps]["crystal_lattice_systems"] = list(
ps_crystal_lattice_systems
)
for ps in ps_to_remove:
del self.point_symmetries[ps]
self.point_symmetries[ps]["crystal_lattice_systems"] = list(
ps_crystal_lattice_systems
)

def get_all_terminating_states(
self, apply_stoichiometry_constraints: Optional[bool] = True
Expand Down

0 comments on commit d7b27f6

Please sign in to comment.