pyhcal 1.1.2__tar.gz → 1.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyhcal-1.1.2 → pyhcal-1.1.3}/PKG-INFO +1 -1
- {pyhcal-1.1.2 → pyhcal-1.1.3}/pyproject.toml +1 -1
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/setup_utils.py +2 -23
- {pyhcal-1.1.2 → pyhcal-1.1.3}/.gitattributes +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/.gitignore +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/ERROR.FIL +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/ERROR.FIL +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/__init__.py +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/calibrators.py +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/data/HUC_Names.csv +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/figures.py +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/mappers.py +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/metrics.py +0 -0
- {pyhcal-1.1.2 → pyhcal-1.1.3}/src/pyhcal/repository.py +0 -0
|
@@ -7,6 +7,7 @@ Created on Wed Jun 15 15:21:35 2022
|
|
|
7
7
|
from mpcaHydro.data_manager import dataManager
|
|
8
8
|
from hspf.wdmReader import readWDM
|
|
9
9
|
from hspf.uci import UCI
|
|
10
|
+
from hpsf.hspfModel import hspfModel
|
|
10
11
|
from pyhcal.repository import Repository
|
|
11
12
|
from mpcaHydro import outlets
|
|
12
13
|
|
|
@@ -113,32 +114,10 @@ class Builder():
|
|
|
113
114
|
copy_path.joinpath(wdm_file.name.replace('.wdm','.hdf5').replace('.WDM','hdf5')))
|
|
114
115
|
|
|
115
116
|
def run_model(self, wait_for_completion=True):
|
|
116
|
-
#run_model(self.new_uci, wait_for_completion)
|
|
117
117
|
# Run the uci file
|
|
118
|
-
winHSPF =
|
|
118
|
+
winHSPF = hspfModel.winHSPF #TODO: fix this hardcoding
|
|
119
119
|
subprocess.run([winHSPF,self.new_uci]) #, stdout=subprocess.PIPE, creationflags=0x08000000)
|
|
120
120
|
|
|
121
|
-
def run_model(uci_file, wait_for_completion=True):
|
|
122
|
-
winHSPF = str(Path(__file__).resolve().parent.parent) + '\\bin\\WinHSPFlt\\WinHspfLt.exe'
|
|
123
|
-
|
|
124
|
-
# Arguments for the subprocess
|
|
125
|
-
args = [winHSPF, uci_file.as_posix()]
|
|
126
|
-
|
|
127
|
-
if wait_for_completion:
|
|
128
|
-
# Use subprocess.run to wait for the process to complete (original behavior)
|
|
129
|
-
subprocess.run(args)
|
|
130
|
-
else:
|
|
131
|
-
# Use subprocess.Popen to run the process in the background without waiting
|
|
132
|
-
# On Windows, you can use creationflags to prevent a console window from appearing
|
|
133
|
-
if sys.platform.startswith('win'):
|
|
134
|
-
# Use a variable for the flag to ensure it's only used on Windows
|
|
135
|
-
creationflags = subprocess.CREATE_NO_WINDOW
|
|
136
|
-
subprocess.Popen(args, creationflags=creationflags)
|
|
137
|
-
else:
|
|
138
|
-
# For other platforms (like Linux/macOS), Popen without special flags works fine
|
|
139
|
-
subprocess.Popen(args)
|
|
140
|
-
|
|
141
|
-
|
|
142
121
|
|
|
143
122
|
### functions for setting up the UCI file properly
|
|
144
123
|
def setup(uci,name,run = 0,reach_ids = None,n = 1,time_step = 3):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|