Skip to content

Commit

Permalink
fix(model relative path): always register model prior to setting mode…
Browse files Browse the repository at this point in the history
…l relative path (#740) (#745)

* fix(#740): Modified code to insure model gets registered before model relative path is set.

* fix(#740)
  • Loading branch information
scottrp authored and langevin-usgs committed Dec 4, 2019
1 parent 0341a29 commit 88703c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions autotest/t505_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def np001():
kwargs['xul'] = 20.5
good_model = ModflowGwf(test_sim, modelname=model_name,
model_nam_file='{}.nam'.format(model_name),
model_rel_path='model_folder',
**kwargs)

# create simulation
Expand Down
2 changes: 1 addition & 1 deletion flopy/mf6/mfmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def __init__(self, simulation, model_type='gwf6', modelname='model',
if model_nam_file is None:
model_nam_file = '{}.nam'.format(modelname)

self.set_model_relative_path(model_rel_path)
if add_to_simulation:
self.structure = simulation.register_model(self, model_type,
modelname,
model_nam_file)
else:
self.structure = structure
self.set_model_relative_path(model_rel_path)
self.exe_name = exe_name
self.dimensions = modeldimensions.ModelDimensions(self.name,
self.simulation_data)
Expand Down

0 comments on commit 88703c2

Please sign in to comment.