pyhcal 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl

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/setup_utils.py CHANGED
@@ -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 = str(Path(__file__).resolve().parent.parent) + '\\bin\\WinHSPFLt\\WinHspfLt.exe'
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhcal
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: Python package for calibrating MPCA HSPF models
5
5
  Project-URL: Homepage, https://github.com/mfratkin1/pyhcal
6
6
  Author-email: Mulu Fratkin <michael.fratkin@state.mn.us>
@@ -5,8 +5,8 @@ pyhcal/figures.py,sha256=Iu7LaN_i2IuDA_nfxj-a8AkG-FTLZVicJ3-efIs5OiE,45534
5
5
  pyhcal/mappers.py,sha256=bAeBb-_EbhegPTn4sR4elRyQNrcBpr9CFzNoZcMDng8,5674
6
6
  pyhcal/metrics.py,sha256=GUGHd-op-g1Foj8wnS_JVURSms4ifcC0a5h8ketQ29I,17911
7
7
  pyhcal/repository.py,sha256=cZfAZRCI99_rhCSHi58_O6pV8aAofXuvQHrao0B5CzI,4606
8
- pyhcal/setup_utils.py,sha256=YyFpOUlyzsJySrnBBnLs3CPLs3al93Mez_H69di4yeo,31145
8
+ pyhcal/setup_utils.py,sha256=9KtpVt9ePF3tpT6Vm5O5JxIU5E1Q4TJamIZx2tPWMow,30127
9
9
  pyhcal/data/HUC_Names.csv,sha256=UGmd3Q5E8DyFWggXzaXWpsRze7sFyrlpYqaYpMWAiGM,18946
10
- pyhcal-1.1.2.dist-info/METADATA,sha256=CNDp8wMXQJNlttSLA9uI_z9zjImiZrY6lRTisF7_3jQ,560
11
- pyhcal-1.1.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
12
- pyhcal-1.1.2.dist-info/RECORD,,
10
+ pyhcal-1.1.3.dist-info/METADATA,sha256=9ZbQ68bfwmhA7pqDde7QuHQ73zOh6cA_u8kP6To98mY,560
11
+ pyhcal-1.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
12
+ pyhcal-1.1.3.dist-info/RECORD,,
File without changes