HARPgroup / HSPsquared

Hydrologic Simulation Program Python (HSPsquared)
GNU Affero General Public License v3.0
1 stars 0 forks source link

Set up dev environment and/or install paths and/or scripts for hsp2 tinkering #6

Closed rburghol closed 1 year ago

rburghol commented 2 years ago

Overview

Trees and branches:

Options

Code 1: Python install script created when we run pip install -e (see #9), which creates a script hsp2 that runs the model. This is stored in /usr/local/bin/hsp2 (so everyone can run it), and it's contents looks like:

#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'HSPsquared','console_scripts','hsp2'
__requires__ = 'HSPsquared'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('HSPsquared', 'console_scripts', 'hsp2')()
    )

Ideally, I think we'd have a script called hsp2dev that if called, would be able to seamlessly integrate with our existing hspf workflows, since the configuration files for our models we can specify the executable we want (hspf or hsp2, or hsp2dev for example) and it should work automatically. This will allow us to just set up a separate scenario for dev testing, indicate the executable we want, and blammo, break stuff to our hearts content.

jdkleiner commented 2 years ago

Looked into this a little bit, perhaps venv is the optimal method?

rburghol commented 2 years ago

@jdkleiner thanks for doingsome leg work on this. Do you have time to meet up and discuss this one sometime today?

jdkleiner commented 2 years ago

@rburghol sure thing, looking forward to diving into this

rburghol commented 2 years ago

@gcambridge at your earliest convenience, can you please push the branch that you have been developing on? We want to preserve the progress that you made and see the locations and prototype functions for us to build on. Thanks!

jdkleiner commented 1 year ago

Soln. use virtual environments: https://github.com/HARPgroup/HSPsquared/issues/55