Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions process/io/process_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from sys import stderr
from time import sleep

from numpy.random import default_rng

from process.data_structure import numerics
from process.io.data_structure_dicts import get_dicts
from process.io.in_dat import InDat
Expand Down Expand Up @@ -350,20 +348,20 @@ def no_unfeasible_mfile(wdir="."):
################################


def vary_iteration_variables(itervars, lbs, ubs, u_seed=None):
def vary_iteration_variables(itervars, lbs, ubs, generator):
"""
Routine to change the iteration variables in IN.DAT
within given bounds.
itervars - string list of all iteration variable names
lbs - float list of lower bounds for variables
ubs - float list of upper bounds for variables
itervars - string list of all iteration variable names
lbs - float list of lower bounds for variables
ubs - float list of upper bounds for variables
generator - Generator numpy generator to create random numbers
"""

in_dat = InDat()

new_values = []

generator = default_rng(seed=u_seed)
for varname, lbnd, ubnd in zip(itervars, lbs, ubs, strict=False):
new_value = generator.uniform(lbnd, ubnd)
new_values += [new_value]
Expand Down
2 changes: 1 addition & 1 deletion process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def run(self):
else:
print("PROCESS has stopped without finishing!")

vary_iteration_variables(itervars, lbs, ubs)
vary_iteration_variables(itervars, lbs, ubs, config.generator)

config.error_status2readme()

Expand Down