Skip to content

Commit

Permalink
FF: automatic seeds up to 30 seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
rthedin committed Sep 26, 2023
1 parent 58ad7ad commit 41d829c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyFAST/fastfarm/FASTFarmCaseCreation.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,17 @@ def _checkInputs(self):
# Check on seed parameters
if not isinstance(self.nSeeds,int):
raise ValueError(f'An integer number of seeds should be requested. Got {self.nSeeds}.')
if self.nSeeds > 30:
raise ValueError(f'Number of seeds requested is larger than 30. For the case of {self.nSeeds} seeds, '\
f'pass seedValues as a {self.nSeeds}-sized array of scalars.')
if self.seedValues is None:
self.seedValues = [2318573, 122299, 123456, 389432, -432443, 9849898]
self.seedValues = [2318573, 122299, 123456, 389432, -432443, 9849898, 432425, 894832, 849324, 678095,
1235456, 435342, 897023, 423800, -898881, 2988900, 798911, 482391, 892111, 899190,
7693202, 587924, 890090, 435646, -454899, -785138, -78564, -17944, -99021, 389432]
self.seedValues = self.seedValues[:self.nSeeds]
if len(self.seedValues) != self.nSeeds:
raise ValueError(f'Number of seeds is {self.nSeeds} but {len(self.seedValues)} seed values were given. '\
f'Adjust the seedValues array accordingly')
raise ValueError(f'The array seedValues has been passed, but its length does not correspond '\
f'to the number of seeds requested.')

# Check LES parameters
if self.LESpath is None:
Expand Down Expand Up @@ -1596,7 +1602,7 @@ def TS_high_create_symlink(self):
try:
os.symlink(src, dst)
except FileExistsError:
if self.verbose>1: print(f'File {dst} already exists. Skipping symlink.')
if self.verbose>1: print(f' File {dst} already exists. Skipping symlink.')
os.chdir(notepath)


Expand Down

0 comments on commit 41d829c

Please sign in to comment.