Skip to content

Commit

Permalink
Cleanup and restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
chp2001 committed Aug 27, 2024
1 parent 48e7e76 commit 4adcef5
Show file tree
Hide file tree
Showing 12 changed files with 1,673 additions and 1,449 deletions.
7 changes: 5 additions & 2 deletions pyflo_bmi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from .pyflo_model import *
from .pyflo_bmi import *
from .src.basins import *
from .src.discrete_time_series import *
from .src.conversions import *
from .src.debug_utils import *
from .bmi_pyflo import *
from .pyflo_bmi_out import *
from .unit_hydrograph_model import *
22 changes: 11 additions & 11 deletions pyflo_bmi/bmi_pyflo.py → pyflo_bmi/pyflo_bmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy import ndarray
from .src import debug_utils as du
from .src.debug_utils import UnimplementedError
from .pyflo_model_reworked import unit_hydrograph_model
from .unit_hydrograph_model import unit_hydrograph_model

info_cats = {}
# category decorator
Expand Down Expand Up @@ -95,7 +95,7 @@ class Var:
_defaults = ["", "float", 0.0, "m/s", 8, 8, "node", "none"]
name, type, value, units, nbytes, itemsize, location, grid = _defaults
value: np.ndarray
def __init__(self, name: str, type: str = None, value: Union[float, np.ndarray] = None, units: str = None, nbytes: int = None, itemsize: int = None, location: str = None, grid: str = None):
def __init__(self, name: str, type: Optional[str] = None, value: Optional[Union[float, np.ndarray]] = None, units: Optional[str] = None, nbytes: Optional[int] = None, itemsize: Optional[int] = None, location: Optional[str] = None, grid: Optional[str] = None):
"""
Initialize a new variable object.
"""
Expand Down Expand Up @@ -129,18 +129,18 @@ def set_value(self, value: Union[float, np.ndarray]):
self.value[0] = value
# Internal model attributes
_name: str = "PyFlo_BMI"
_start_time: float# = 0.0
_num_time_steps: int# = 720
_time_step_size: float# = 1.0
_end_time: float# = 0.0
_time: float# = 0.0
_time_step: int# = 0
_start_time: float
_num_time_steps: int
_time_step_size: float
_end_time: float
_time: float
_time_step: int
_time_units: str = "s"
# initialize in __init__ as instance variables
_vars: dict[VarType, List[Var]]
_all_vars: dict[str, Var]
_model_data: dict[str, Any]# = {}
_model: object = None
_model_data: dict[str, Any]
_model: Optional[object] = None

_info_categories: List[str] = [
"python-builtin",
Expand Down Expand Up @@ -182,7 +182,7 @@ def set_value(self, value: Union[float, np.ndarray]):
"grid",
]

track_variables: List[str]# = []
track_variables: List[str]

@_info_category(["py-init"])
def __init__(self):
Expand Down
Loading

0 comments on commit 4adcef5

Please sign in to comment.