Skip to content

Commit

Permalink
Fix bug in enumerator
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed Feb 11, 2024
1 parent b127111 commit 4d4f4fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions swmmanywhere/paper/experimenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def generate_samples(N = None,
jobid = 1
nproc = None
bbox = (0.04020,51.55759,0.09825591114207548,51.62050)
parameters_to_select = ['river_buffer_distance',
parameters_to_select = ['min_v',
'max_v',
'outlet_length',
'surface_slope_scaling',
'elevation_scaling',
Expand Down Expand Up @@ -127,8 +128,9 @@ def generate_samples(N = None,
flooding_results = {}
if nproc is None:
nproc = len(X)
for ix, params in enumerate(X):
for ix, params_ in gb:
if ix % nproc == jobid:
flooding_results[ix] = ix
addresses = preprocessing.create_project_structure(bbox,
project,
base_dir)
Expand All @@ -138,7 +140,7 @@ def generate_samples(N = None,
params['topology_derivation'].weights = ['surface_slope',
'length',
'contributing_area']
for key, row in gb.get_group(ix).iterrows():
for key, row in params_.iterrows():
setattr(params[row['group']], row['param'], row['value'])
addresses.model.mkdir(parents = True, exist_ok = True)
G = load_graph(addresses.bbox / 'graph_sequence2.json')
Expand Down

0 comments on commit 4d4f4fb

Please sign in to comment.