Skip to content

Commit

Permalink
Merge pull request #93 from changliao1025/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
changliao1025 authored May 9, 2024
2 parents 736887e + 596bfa6 commit da49f6b
Show file tree
Hide file tree
Showing 19 changed files with 402 additions and 322 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ message: "If you use this software, please cite it as below."
authors:
- family-names: Liao
given-names: Chang
orcid: https://orcid.org/0000-0002-7348-8858
orcid: https://orcid.org/0000-0002-7348-8858
title: "HexWatershed: a mesh-independent flow direction model for hydrologic models"
version: 0.2.29
version: 0.2.30
doi: 10.5281/zenodo.6425881
date-released: 2022-03-31
6 changes: 3 additions & 3 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ build_string: py38_0
test:
imports:
- pyhexwatershed


# Define the package metadata
metadata:
# Package name
name: hexwatershed
# Package version
version: "0.2.29"
version: "0.2.30"
# Package summary
summary: A mesh-independent flow direction model for hydrologic models
# Package homepage
Expand All @@ -46,4 +46,4 @@ metadata:
- python
- setuptools
- pip

24 changes: 12 additions & 12 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "hexwatershed" %}
{% set git_rev = "main" %}
{% set version = "0.2.29" %}
{% set version = "0.2.30" %}

package:
name: {{ name|lower }}
Expand All @@ -13,29 +13,29 @@ source:
#git_rev: {{ git_rev }}
#git_url: https://github.com/changliao1025/pyhexwatershed

build:
build:
noarch: python
#script:
# - pip install .
# - pip install .
# - python setup.py build_external -vv

number: 0
requirements:

requirements:

build:
- cmake
- make
- {{ compiler('cxx') }}
- python >=3.8
- python >=3.8
- setuptools
- pip

host:
- python >=3.8
- python >=3.8
- pip
- {{ compiler('cxx') }}

run:
- python >=3.8
- numpy
Expand All @@ -46,7 +46,7 @@ requirements:
test:
imports:
- pyhexwatershed


about:
home: https://github.com/changliao1025/pyhexwatershed
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import sys
sys.path.insert(0, os.path.abspath('..'))

import pyhexwatershed
import pyhexwatershed.configuration as configuration

# -- General configuration ---------------------------------------------

Expand Down Expand Up @@ -55,9 +55,9 @@
# the built documents.
#
# The short X.Y version.
version = pyhexwatershed.__version__
version = configuration.__version__
# The full version, including alpha/beta/rc tags.
release = pyhexwatershed.__version__
release = configuration.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions examples/create_model_condfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
logging.warning('is the time pyhexwatershed simulation started.')

from pyhexwatershed.classes.pycase import hexwatershedcase
from pyhexwatershed.pyhexwatershed_read_model_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.pyhexwatershed_create_template_configuration_file import pyhexwatershed_create_template_configuration_file
from pyhexwatershed.configuration.read_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.configuration.create_template_configuration_file import pyhexwatershed_create_template_configuration_file


sMesh_type = 'latlon'
Expand All @@ -30,7 +30,7 @@
sWorkspace_output = '/compyfs/liao313/04model/pyhexwatershed/susquehanna'


sFilename_configuration_in = sPath + '/tests/configurations/pyhexwatershed_susquehanna_latlon.json'
sFilename_configuration_in = sPath + '/tests/configurations/pyhexwatershed_susquehanna_latlon.json'
sWorkspace_data = realpath( sPath + '/data/susquehanna' )
oPyhexwatershed = pyhexwatershed_create_template_configuration_file(sFilename_configuration_in, sWorkspace_input, sWorkspace_output, iFlag_use_mesh_dem_in = 0, sMesh_type_in=sMesh_type, iCase_index_in = iCase_index, sDate_in = sDate)
print(oPyhexwatershed.tojson())
Expand Down
16 changes: 8 additions & 8 deletions examples/susquehanna/run_simulation_hexagon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from os.path import realpath

from pyhexwatershed.pyhexwatershed_read_model_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.configuration.read_configuration_file import pyhexwatershed_read_model_configuration_file

#===========================
#setup workspace path
Expand Down Expand Up @@ -37,7 +37,7 @@
oPyhexwatershed = pyhexwatershed_read_model_configuration_file(sFilename_configuration_in,\
iCase_index_in=iCase_index, \
dResolution_meter_in = dResolution_meter, \
sDate_in= sDate, sMesh_type_in= sMesh_type)
sDate_in= sDate, sMesh_type_in= sMesh_type)

if oPyhexwatershed.iFlag_global==1:
#global simulation
Expand All @@ -48,7 +48,7 @@
if oPyhexwatershed.iFlag_multiple_outlet ==1:
pass
else:
#single basin example
#single basin example
#use dem
oPyhexwatershed.pPyFlowline.aBasin[0].dLatitude_outlet_degree=39.4620
oPyhexwatershed.pPyFlowline.aBasin[0].dLongitude_outlet_degree=-76.0093
Expand All @@ -61,16 +61,16 @@
aCell_out = oPyhexwatershed.assign_elevation_to_cells()
aCell_new = oPyhexwatershed.update_outlet(aCell_origin)
oPyhexwatershed.pPyFlowline.export()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.run_hexwatershed()
oPyhexwatershed.analyze()
oPyhexwatershed.export()
pass

iCase_index = iCase_index + 1




print('Finished')

16 changes: 8 additions & 8 deletions examples/susquehanna/run_simulation_latlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from os.path import realpath

from pyhexwatershed.pyhexwatershed_read_model_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.configuration.read_configuration_file import pyhexwatershed_read_model_configuration_file

#===========================
#setup workspace path
Expand Down Expand Up @@ -37,7 +37,7 @@
oPyhexwatershed = pyhexwatershed_read_model_configuration_file(sFilename_configuration_in,\
iCase_index_in=iCase_index, \
dResolution_meter_in = dResolution_meter, \
sDate_in= sDate, sMesh_type_in= sMesh_type)
sDate_in= sDate, sMesh_type_in= sMesh_type)

if oPyhexwatershed.iFlag_global==1:
#global simulation
Expand All @@ -48,7 +48,7 @@
if oPyhexwatershed.iFlag_multiple_outlet ==1:
pass
else:
#single basin example
#single basin example
#use dem
oPyhexwatershed.pPyFlowline.aBasin[0].dLatitude_outlet_degree=39.4620
oPyhexwatershed.pPyFlowline.aBasin[0].dLongitude_outlet_degree=-76.0093
Expand All @@ -61,16 +61,16 @@
aCell_out = oPyhexwatershed.assign_elevation_to_cells()
aCell_new = oPyhexwatershed.update_outlet(aCell_origin)
oPyhexwatershed.pPyFlowline.export()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.run_hexwatershed()
oPyhexwatershed.analyze()
oPyhexwatershed.export()
pass

iCase_index = iCase_index + 1




print('Finished')

8 changes: 4 additions & 4 deletions examples/susquehanna/run_simulation_mpas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from os.path import realpath

from pyhexwatershed.pyhexwatershed_read_model_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.configuration.read_configuration_file import pyhexwatershed_read_model_configuration_file

#===========================
#setup workspace path
Expand Down Expand Up @@ -33,7 +33,7 @@
sDate='20220801'

oPyhexwatershed = pyhexwatershed_read_model_configuration_file(sFilename_configuration_in,\
iCase_index_in=iCase_index, sDate_in= sDate, sMesh_type_in= sMesh_type)
iCase_index_in=iCase_index, sDate_in= sDate, sMesh_type_in= sMesh_type)

if oPyhexwatershed.iFlag_global==1:
#global simulation
Expand All @@ -44,7 +44,7 @@
if oPyhexwatershed.iFlag_multiple_outlet ==1:
pass
else:
#single basin example
#single basin example
#mpas mesh has elevation built-in
oPyhexwatershed.pPyFlowline.aBasin[0].dLatitude_outlet_degree=39.4620
oPyhexwatershed.pPyFlowline.aBasin[0].dLongitude_outlet_degree=-76.0093
Expand All @@ -60,7 +60,7 @@
oPyhexwatershed.analyze()
oPyhexwatershed.export()
pass
pass
pass

print('Finished')

16 changes: 8 additions & 8 deletions examples/susquehanna/run_simulation_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from os.path import realpath

from pyhexwatershed.pyhexwatershed_read_model_configuration_file import pyhexwatershed_read_model_configuration_file
from pyhexwatershed.configuration.read_configuration_file import pyhexwatershed_read_model_configuration_file

#===========================
#setup workspace path
Expand Down Expand Up @@ -37,7 +37,7 @@
oPyhexwatershed = pyhexwatershed_read_model_configuration_file(sFilename_configuration_in,\
iCase_index_in=iCase_index, \
dResolution_meter_in = dResolution_meter, \
sDate_in= sDate, sMesh_type_in= sMesh_type)
sDate_in= sDate, sMesh_type_in= sMesh_type)

if oPyhexwatershed.iFlag_global==1:
#global simulation
Expand All @@ -48,7 +48,7 @@
if oPyhexwatershed.iFlag_multiple_outlet ==1:
pass
else:
#single basin example
#single basin example
#use dem
oPyhexwatershed.pPyFlowline.aBasin[0].dLatitude_outlet_degree=39.4620
oPyhexwatershed.pPyFlowline.aBasin[0].dLongitude_outlet_degree=-76.0093
Expand All @@ -61,16 +61,16 @@
aCell_out = oPyhexwatershed.assign_elevation_to_cells()
aCell_new = oPyhexwatershed.update_outlet(aCell_origin)
oPyhexwatershed.pPyFlowline.export()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.export_config_to_json()
oPyhexwatershed.run_hexwatershed()
oPyhexwatershed.analyze()
oPyhexwatershed.export()
pass

iCase_index = iCase_index + 1




print('Finished')

Loading

0 comments on commit da49f6b

Please sign in to comment.