diff --git a/src/hsp2/hsp2/HYDR.py b/src/hsp2/hsp2/HYDR.py index d65ad8cb..8caa0ece 100644 --- a/src/hsp2/hsp2/HYDR.py +++ b/src/hsp2/hsp2/HYDR.py @@ -19,7 +19,7 @@ from hsp2.hsp2.utilities import initm, make_numba_dict # the following imports added by rb to handle dynamic code and special actions -from hsp2.hsp2.state import hydr_get_ix, hydr_init_ix, hydr_state_vars +from hsp2.state.state import hydr_get_ix, hydr_init_ix, hydr_state_vars from hsp2.hsp2.om import pre_step_model, step_model, model_domain_dependencies from numba.typed import Dict @@ -159,7 +159,7 @@ def hydr(io_manager, siminfo, parameters, ts, ftables, state): if hsp2_local_py != False: from hsp2_local_py import state_step_hydr else: - from hsp2.hsp2.state_fn_defaults import state_step_hydr + from hsp2.state.state_fn_defaults import state_step_hydr # initialize the hydr paths in case they don't already reside here hydr_init_ix(state, state["domain"]) # must split dicts out of state Dict since numba cannot handle mixed-type nested Dicts diff --git a/src/hsp2/hsp2/RQUAL.py b/src/hsp2/hsp2/RQUAL.py index 78e766c5..81985ec8 100644 --- a/src/hsp2/hsp2/RQUAL.py +++ b/src/hsp2/hsp2/RQUAL.py @@ -12,7 +12,7 @@ from hsp2.hsp2.utilities import initm, initmd, make_numba_dict # the following imports added to handle special actions -from hsp2.hsp2.state import rqual_init_ix, rqual_state_vars +from hsp2.state.state import rqual_init_ix, rqual_state_vars from hsp2.hsp2.om import model_domain_dependencies ERRMSGS_oxrx = ( diff --git a/src/hsp2/hsp2/RQUAL_Class.py b/src/hsp2/hsp2/RQUAL_Class.py index 22e0eb7a..81b3ae16 100644 --- a/src/hsp2/hsp2/RQUAL_Class.py +++ b/src/hsp2/hsp2/RQUAL_Class.py @@ -10,7 +10,7 @@ from hsp2.hsp2.PLANK_Class import PLANK_Class # the following imports added to handle special actions -from hsp2.hsp2.state import rqual_get_ix +from hsp2.state.state import rqual_get_ix from hsp2.hsp2.om import pre_step_model, step_model if os.environ.get("NUMBA_DISABLE_JIT", 0): # jit should be on by default. diff --git a/src/hsp2/hsp2/SEDMNT.py b/src/hsp2/hsp2/SEDMNT.py index 3c8953a1..6818d1e5 100644 --- a/src/hsp2/hsp2/SEDMNT.py +++ b/src/hsp2/hsp2/SEDMNT.py @@ -13,7 +13,7 @@ from hsp2.hsp2.utilities import hourflag, initm, make_numba_dict # the following imports added to handle special actions -from hsp2.hsp2.state import sedmnt_get_ix, sedmnt_init_ix, sedmnt_state_vars +from hsp2.state.state import sedmnt_get_ix, sedmnt_init_ix, sedmnt_state_vars from hsp2.hsp2.om import pre_step_model, step_model, model_domain_dependencies from numba.typed import Dict diff --git a/src/hsp2/hsp2/SEDTRN.py b/src/hsp2/hsp2/SEDTRN.py index 475fb31e..c6c5f1d1 100644 --- a/src/hsp2/hsp2/SEDTRN.py +++ b/src/hsp2/hsp2/SEDTRN.py @@ -10,7 +10,7 @@ from hsp2.hsp2.utilities import make_numba_dict # the following imports added to handle special actions -from hsp2.hsp2.state import sedtrn_get_ix, sedtrn_init_ix, sedtrn_state_vars +from hsp2.state.state import sedtrn_get_ix, sedtrn_init_ix, sedtrn_state_vars from hsp2.hsp2.om import pre_step_model, step_model, model_domain_dependencies from numba.typed import Dict @@ -110,7 +110,7 @@ def sedtrn(io_manager, siminfo, parameters, ts, state): # if (hsp2_local_py != False): # from hsp2_local_py import state_step_hydr # else: - # from hsp2.hsp2.state_fn_defaults import state_step_hydr + # from hsp2.state.state_fn_defaults import state_step_hydr # must split dicts out of state Dict since numba cannot handle mixed-type nested Dicts # initialize the sedtrn paths in case they don't already reside here sedtrn_init_ix(state, state["domain"]) diff --git a/src/hsp2/hsp2/main.py b/src/hsp2/hsp2/main.py index 31886728..b7ed561f 100644 --- a/src/hsp2/hsp2/main.py +++ b/src/hsp2/hsp2/main.py @@ -18,7 +18,7 @@ get_gener_timeseries, ) from hsp2.hsp2.configuration import activities, noop, expand_masslinks -from hsp2.hsp2.state import ( +from hsp2.state.state import ( init_state_dicts, state_siminfo_hsp2, state_load_dynamics_hsp2, diff --git a/src/hsp2/hsp2/om.py b/src/hsp2/hsp2/om.py index 5cf5eeb2..a85f579e 100644 --- a/src/hsp2/hsp2/om.py +++ b/src/hsp2/hsp2/om.py @@ -10,7 +10,7 @@ import time from numpy import zeros from numba import njit # import the types -from hsp2.hsp2.state import append_state, get_ix_path +from hsp2.state.state import append_state, get_ix_path def get_exec_order(model_exec_list, var_ix): diff --git a/src/hsp2/hsp2/om_equation.py b/src/hsp2/hsp2/om_equation.py index afa90ed3..ade606cf 100644 --- a/src/hsp2/hsp2/om_equation.py +++ b/src/hsp2/hsp2/om_equation.py @@ -7,12 +7,12 @@ """ from hsp2.hsp2.om import is_float_digit -from hsp2.hsp2.state import set_state, get_state_ix +from hsp2.state.state import set_state, get_state_ix from hsp2.hsp2.om_model_object import ModelObject, ModelConstant from numba import njit from numpy import array, append -# from hsp2.hsp2.state import set_state, get_state_ix +# from hsp2.state.state import set_state, get_state_ix # from numba.typed import Dict # from hsp2.hsp2.om import get_exec_order, is_float_digit # from pandas import Series, DataFrame, concat, HDFStore, set_option, to_numeric diff --git a/src/hsp2/hsp2/om_model_linkage.py b/src/hsp2/hsp2/om_model_linkage.py index c8a15cca..a09c3528 100644 --- a/src/hsp2/hsp2/om_model_linkage.py +++ b/src/hsp2/hsp2/om_model_linkage.py @@ -4,7 +4,7 @@ during a model simulation. """ -from hsp2.hsp2.state import state_add_ts, get_state_ix +from hsp2.state.state import state_add_ts, get_state_ix from hsp2.hsp2.om import * from hsp2.hsp2.om_model_object import ModelObject from numba import njit diff --git a/src/hsp2/hsp2/om_model_object.py b/src/hsp2/hsp2/om_model_object.py index 4b0ea296..30451052 100644 --- a/src/hsp2/hsp2/om_model_object.py +++ b/src/hsp2/hsp2/om_model_object.py @@ -4,7 +4,7 @@ All runtime exec is done by child classes. """ -from hsp2.hsp2.state import set_state, get_state_ix +from hsp2.state.state import set_state, get_state_ix from numba.typed import Dict from hsp2.hsp2.om import get_exec_order, is_float_digit from pandas import HDFStore diff --git a/src/hsp2/hsp2/om_sim_timer.py b/src/hsp2/hsp2/om_sim_timer.py index 89d37bdd..24a93c53 100644 --- a/src/hsp2/hsp2/om_sim_timer.py +++ b/src/hsp2/hsp2/om_sim_timer.py @@ -4,7 +4,7 @@ during a model simulation. """ -from hsp2.hsp2.state import set_state +from hsp2.state.state import set_state from hsp2.hsp2.om import ModelObject from hsp2.hsp2.om_model_object import ModelObject from pandas import DataFrame diff --git a/src/hsp2/hsp2/sedtrn_step.py b/src/hsp2/hsp2/sedtrn_step.py index 0f9c6441..747ab253 100644 --- a/src/hsp2/hsp2/sedtrn_step.py +++ b/src/hsp2/hsp2/sedtrn_step.py @@ -1,7 +1,7 @@ from numba import njit # the following imports added to handle special actions -from hsp2.hsp2.state import ( +from hsp2.state.state import ( get_domain_state, set_domain_state, ) diff --git a/src/hsp2/state/__init__.py b/src/hsp2/state/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/hsp2/hsp2/state.py b/src/hsp2/state/state.py similarity index 100% rename from src/hsp2/hsp2/state.py rename to src/hsp2/state/state.py diff --git a/src/hsp2/hsp2/state_fn_defaults.py b/src/hsp2/state/state_fn_defaults.py similarity index 100% rename from src/hsp2/hsp2/state_fn_defaults.py rename to src/hsp2/state/state_fn_defaults.py diff --git a/tests/testcbp/HSP2results/check_equation.py b/tests/testcbp/HSP2results/check_equation.py index 643967b4..3289c4ed 100644 --- a/tests/testcbp/HSP2results/check_equation.py +++ b/tests/testcbp/HSP2results/check_equation.py @@ -7,6 +7,7 @@ from hsp2.hsp2.om import * from hsp2.hsp2io.hdf import HDF5 from hsp2.hsp2io.io import IOManager +from hsp2.state.state import * fpath = "./tests/testcbp/HSP2results/JL1_6562_6560.h5" # try also: