Skip to content

Commit

Permalink
pass the random state to lattice generator
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu2017 committed Aug 17, 2024
1 parent 6a1cd1a commit 79513d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyxtal/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ def update_row_topology(self, StructureType="Auto", overwrite=True, prefix=None)
try:
import juliacall
except:
print("Cannot load JuliaCall, no support on topology parser")
raise RuntimeError("Cannot load JuliaCall, Plz enable it before running")

def parse_topology(topology_info):
"""
Expand Down
8 changes: 4 additions & 4 deletions pyxtal/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,13 @@ def mutate(self, degree=0.10, frozen=False):

def generate_para(self):
if self.dim == 3:
return generate_cellpara(self.ltype, self.volume, **self.kwargs)
return generate_cellpara(self.ltype, self.volume, random_state=self.random_state, **self.kwargs)
elif self.dim == 2:
return generate_cellpara_2D(self.ltype, self.volume, **self.kwargs)
return generate_cellpara_2D(self.ltype, self.volume, random_state=self.random_state, **self.kwargs)
elif self.dim == 1:
return generate_cellpara_1D(self.ltype, self.volume, **self.kwargs)
return generate_cellpara_1D(self.ltype, self.volume, random_state=self.random_state, **self.kwargs)
elif self.dim == 0:
return generate_cellpara_0D(self.ltype, self.volume, **self.kwargs)
return generate_cellpara_0D(self.ltype, self.volume, random_state=self.random_state, **self.kwargs)
return None

def generate_matrix(self):
Expand Down

0 comments on commit 79513d5

Please sign in to comment.