Skip to content

Commit

Permalink
change configureation module
Browse files Browse the repository at this point in the history
  • Loading branch information
changliao1025 committed May 6, 2024
1 parent feae9e3 commit b777e11
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions examples/create_model_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os.path import realpath
import argparse

from pyflowline.pyflowline_create_template_configuration_file import pyflowline_create_template_configuration_file
from pyflowline.configuration.pyflowline_create_template_configuration_file import pyflowline_create_template_configuration_file

parser = argparse.ArgumentParser()
parser.add_argument("--sMesh_type", help = "sMesh_type", type = str)
Expand Down Expand Up @@ -37,10 +37,10 @@
sWorkspace_output= str(Path(sWorkspace_data) / 'output')

sFilename_configuration_in = realpath( sPath + '/tests/configurations/template.json' )

oPyflowline = pyflowline_create_template_configuration_file(sFilename_configuration_in,\
sWorkspace_input, sWorkspace_output, iFlag_use_mesh_dem_in = 1,sMesh_type_in=sMesh_type, iCase_index_in = iCase_index, sDate_in = sDate)

print(oPyflowline.tojson())

print('Finished')
Expand Down
10 changes: 5 additions & 5 deletions examples/susquehanna/run_simulation_hexagon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sPath_parent = str(Path(__file__).parents[2]) # data is located two dir's up
import sys
sys.path.append(sPath_parent)
from pyflowline.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
from pyflowline.configuration.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file

sPath_data = realpath( sPath_parent + '/data/susquehanna' )
sWorkspace_input = str(Path(sPath_data) / 'input')
Expand All @@ -34,9 +34,9 @@
sMesh = 'hexagon'
sDate='20230101'




oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in, \
iCase_index_in=iCase_index, dResolution_meter_in=dResolution_meter, sDate_in=sDate)
oPyflowline.aBasin[0].dLatitude_outlet_degree=39.462000
Expand All @@ -47,7 +47,7 @@
oPyflowline.reconstruct_topological_relationship(aCell)
oPyflowline.export()
iCase_index= iCase_index+1

print('Finished')


4 changes: 2 additions & 2 deletions examples/susquehanna/run_simulation_latlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sPath_parent = str(Path(__file__).parents[2]) # data is located two dir's up
import sys
sys.path.append(sPath_parent)
from pyflowline.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
from pyflowline.configuration.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
sPath_data = realpath( sPath_parent + '/data/susquehanna' )
sWorkspace_input = str(Path(sPath_data) / 'input')
sWorkspace_output= str(Path(sPath_data) / 'output')
Expand All @@ -32,7 +32,7 @@
sMesh = 'latlon'
sDate='20230101'



oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in, \
iCase_index_in=iCase_index, dResolution_meter_in=dResolution_meter, sDate_in=sDate)
Expand Down
16 changes: 8 additions & 8 deletions examples/susquehanna/run_simulation_mpas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
sPath_parent = str(Path(__file__).parents[2]) # data is located two dir's up

sys.path.append(sPath_parent)
from pyflowline.change_json_key_value import change_json_key_value
from pyflowline.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
from pyflowline.configuration.change_json_key_value import change_json_key_value
from pyflowline.configuration.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file

sPath_data = realpath( sPath_parent + '/data/susquehanna' )
sWorkspace_input = str(Path(sPath_data) / 'input')
Expand Down Expand Up @@ -40,7 +40,7 @@
sFilename_basins = realpath( os.path.join(sFolder_input , 'pyflowline_susquehanna_basins.json' ))
change_json_key_value(sFilename_basins, 'sFilename_flowline_filter', sFilename_flowline, iFlag_basin_in=1)

oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in,
oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in,
iCase_index_in=iCase_index, sDate_in=sDate)

#take a look at the model parameters
Expand Down Expand Up @@ -72,18 +72,18 @@
pass

if iFlag_visualization == 1:
aExtent_meander = [-76.5,-76.2, 41.6,41.9]
#oPyflowline.plot( sVariable_in='flowline_simplified' , sFilename_output_in = 'flowline_simplified.png' )
#oPyflowline.plot( sVariable_in='flowline_simplified' , sFilename_output_in = 'flowline_simplified_zoom.png', aExtent_in =aExtent_meander )

aExtent_meander = [-76.5,-76.2, 41.6,41.9]
#oPyflowline.plot( sVariable_in='flowline_simplified' , sFilename_output_in = 'flowline_simplified.png' )
#oPyflowline.plot( sVariable_in='flowline_simplified' , sFilename_output_in = 'flowline_simplified_zoom.png', aExtent_in =aExtent_meander )

pass

if iFlag_simulation == 1:
aCell = oPyflowline.pyflowline_mesh_generation()

if iFlag_visualization == 1:
oPyflowline.plot( sVariable_in='mesh', sFilename_output_in = 'mesh.png' )
oPyflowline.plot( sVariable_in='mesh', sFilename_output_in = 'mesh.png' )
pass

if iFlag_simulation == 1:
Expand Down
4 changes: 2 additions & 2 deletions examples/susquehanna/run_simulation_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sPath_parent = str(Path(__file__).parents[2]) # data is located two dir's up
import sys
sys.path.append(sPath_parent)
from pyflowline.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
from pyflowline.configuration.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file
sPath_data = realpath( sPath_parent + '/data/susquehanna' )
sWorkspace_input = str(Path(sPath_data) / 'input')
sWorkspace_output= str(Path(sPath_data) / 'output')
Expand All @@ -32,7 +32,7 @@
sMesh = 'square'
sDate='20230101'



oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in, \
iCase_index_in=iCase_index, dResolution_meter_in=dResolution_meter, sDate_in=sDate)
Expand Down
Empty file.
File renamed without changes.

0 comments on commit b777e11

Please sign in to comment.