Skip to content

Commit

Permalink
Simplify code to update space groups based on subset
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhernandezgarcia committed Oct 18, 2023
1 parent e2e60dc commit 75aa91e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gflownet/envs/crystals/spacegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,7 @@ def _restrict_space_groups(self, sg_subset: Optional[Iterable] = None):
sg_subset = set(sg_subset)

# Update self.space_groups
self.space_groups = deepcopy(self.space_groups)
sg_to_remove = [sg for sg in self.space_groups if sg not in sg_subset]
for sg in sg_to_remove:
del self.space_groups[sg]
self.space_groups = [sg for sg in self.space_groups if sg in sg_subset]

# Update self.crystal_lattice_systems based on space groups
self.crystal_lattice_systems = deepcopy(self.crystal_lattice_systems)
Expand Down

0 comments on commit 75aa91e

Please sign in to comment.