Skip to content

Commit

Permalink
fix path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
changliao1025 committed Mar 3, 2022
1 parent 936f228 commit 3d92948
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 13 additions & 14 deletions pyflowline/pyflowline_generate_template_configuration_json_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
from pyflowline.classes.pycase import flowlinecase
from pyflowline.classes.basin import pybasin

sPath = str(Path(__file__).parent.resolve())
sPath_data = realpath(sPath + '/../data/susquehanna/' )

def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_json, nBasin, sWorkspace_output):

def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_json, nBasin, sWorkspace_output, sPath_data):
aBasin_out = list()
for i in range(nBasin):
sBasin = "{:03d}".format(i+1)
Expand All @@ -24,13 +23,13 @@ def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_
aConfig_basin['dThreshold_small_river'] = 90

aConfig_basin['sFilename_dam'] = str(Path(sPath_data) / 'ICoM_dams.csv')
#"/qfs/people/liao313/data/hexwatershed/susquehanna/auxiliary/ICoM_dams.csv"

aConfig_basin['sFilename_flowline_filter'] = str(Path(sPath_data) / 'streamord7above.shp')
#"/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/streamord7above.shp"

aConfig_basin['sFilename_flowline_raw'] = str(Path(sPath_data) / 'allflowline.shp')
#"/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/allflowline.shp"

aConfig_basin['sFilename_flowline_topo'] = str(Path(sPath_data) / 'flowline.csv')
#"/qfs/people/liao313/data/hexwatershed/susquehanna/auxiliary/flowline.csv"

aConfig_basin['sWorkspace_output_basin'] = str(Path(sWorkspace_output) / sBasin )
pBasin = pybasin(aConfig_basin)
aBasin_out.append(pBasin)
Expand All @@ -47,7 +46,7 @@ def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_


return aBasin_out
def pyflowline_generate_template_configuration_json_file(sFilename_json):
def pyflowline_generate_template_configuration_json_file(sFilename_json, sPath_data):

if os.path.exists(sFilename_json):
os.remove(sFilename_json)
Expand All @@ -74,11 +73,11 @@ def pyflowline_generate_template_configuration_json_file(sFilename_json):
aConfig['dLatitude_top'] = 90
aConfig['sFilename_model_configuration'] = sFilename_json
aConfig['sWorkspace_data'] = sPath_data
#'/people/liao313/data'

aConfig['sWorkspace_project'] = 'pyflowline'
#aConfig['sWorkspace_bin'] = '/people/liao313/bin'

aConfig['sWorkspace_output'] = str(Path(sPath_data) / 'output')
#"/compyfs/liao313/04model/pyflowline/susquehanna"

aConfig['sRegion'] = 'susquehanna'
aConfig['sModel'] = 'pyflowline'
aConfig['iCase_index'] = 1
Expand All @@ -87,13 +86,13 @@ def pyflowline_generate_template_configuration_json_file(sFilename_json):
aConfig['sJob'] = 'pyflowline'
aConfig['sDate']= '20220110'
aConfig['sFilename_mesh'] = str(Path(sPath_data) / 'lnd_cull_mesh.nc')
#"/qfs/people/liao313/data/icom/mesh/delaware_lnd_60_30_5_2_v2/lnd_cull_mesh.nc"

aConfig['flowline_info'] = 'flowline_info.json'
aConfig['sFilename_mesh_info'] = 'mesh_info.json'
aConfig['sFilename_elevation'] = 'elevation.json'
#aConfig['sFilename_dem'] = '/qfs/people/liao313/data/hexwatershed/susquehanna/raster/dem/dem_ext.tif'

aConfig['sFilename_spatial_reference'] = str(Path(sPath_data) / 'boundary_proj.shp')
#'/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/boundary_proj.shp'



oModel = flowlinecase(aConfig)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
AUTHOR = "Chang Liao"
AUTHOR_EMAIL = "[email protected]"
URL = "https://github.com/changliao1025/pyflowline"
VERSION = "0.1.6"
VERSION = "0.1.7"
REQUIRES_PYTHON = ">=3.8.0"
KEYWORDS = "Earth Science"

Expand Down

0 comments on commit 3d92948

Please sign in to comment.