From 88f7d6a3dd9009d7d8b47a44ab58f859c6393dcc Mon Sep 17 00:00:00 2001 From: chp2001 Date: Tue, 27 Aug 2024 11:44:07 -0400 Subject: [PATCH] Rename project --- formulation.json | 6 +++--- pyproject.toml | 4 ++-- setup_project.py | 6 +++--- test_module.py | 4 ++-- {pyflo_bmi => unithg_bmi}/__init__.py | 2 +- {pyflo_bmi => unithg_bmi}/src/basins.py | 0 {pyflo_bmi => unithg_bmi}/src/conversions.py | 0 {pyflo_bmi => unithg_bmi}/src/debug_utils.py | 0 .../src/discrete_time_series.py | 0 {pyflo_bmi => unithg_bmi}/unit_hydrograph_model.py | 0 pyflo_bmi/pyflo_bmi.py => unithg_bmi/unithg_bmi.py | 12 ++++++------ 11 files changed, 17 insertions(+), 17 deletions(-) rename {pyflo_bmi => unithg_bmi}/__init__.py (86%) rename {pyflo_bmi => unithg_bmi}/src/basins.py (100%) rename {pyflo_bmi => unithg_bmi}/src/conversions.py (100%) rename {pyflo_bmi => unithg_bmi}/src/debug_utils.py (100%) rename {pyflo_bmi => unithg_bmi}/src/discrete_time_series.py (100%) rename {pyflo_bmi => unithg_bmi}/unit_hydrograph_model.py (100%) rename pyflo_bmi/pyflo_bmi.py => unithg_bmi/unithg_bmi.py (98%) diff --git a/formulation.json b/formulation.json index e986117..fb2ade7 100644 --- a/formulation.json +++ b/formulation.json @@ -1,14 +1,14 @@ { "name": "bmi_python", "params": { - "name": "pyflo_bmi", - "model_type_name": "pyflo_bmi_model", + "name": "unithg_bmi", + "model_type_name": "unithg_bmi_model", "main_output_variable": "discharge_calculated", "init_config": "/dev/null", "allow_exceed_end_time": true, "uses_forcing_file": true, "forcing_file": "./forcings/by_catchment/{{id}}.csv", - "python_type": "pyflo_bmi.Bmi_Pyflo", + "python_type": "unithg_bmi.Bmi_Unithg", "output_variables": [ "discharge_calculated", "APCP_surface" diff --git a/pyproject.toml b/pyproject.toml index e21f310..78172e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "pyflo_bmi" +name = "unithg_bmi" version = "0.1.0" -description = "A Python-based Ngen-BMI model for the PyFlo module." +description = "A Python-based Ngen-BMI model for unit hydrograph." authors = [{name = "Chad Perry"}] maintainers = [{name = "Chad Perry"}] license = {file = "LICENSE"} diff --git a/setup_project.py b/setup_project.py index 150d01e..4985148 100644 --- a/setup_project.py +++ b/setup_project.py @@ -2,8 +2,8 @@ from pathlib import Path from typing import Any -project_name = "pyflo_bmi" -proj_folder = Path("pyflo_bmi") +project_name = "unithg_bmi" +proj_folder = Path("unithg_bmi") this_folder = Path(".") requirements = [] author_name = "Chad Perry" @@ -73,7 +73,7 @@ def build_pyproject_toml(project_name:str, requirements:list[str], path:Path = t toml["project"] = { "name": project_name, "version": "0.1.0", - "description": "A Python-based Ngen-BMI model for the PyFlo module.", + "description": "A Python-based Ngen-BMI model for unit hydrograph.", "authors": [{"name": author_name}], "maintainers": [{"name": author_name}], "license": {"file": "LICENSE"}, diff --git a/test_module.py b/test_module.py index 4d61921..b97db88 100644 --- a/test_module.py +++ b/test_module.py @@ -3,12 +3,12 @@ from matplotlib import pyplot as plt import math, random, numpy as np -import pyflo_bmi.pyflo_bmi as pyflo_bmi +import unithg_bmi.unithg_bmi as unithg_bmi from time import time, perf_counter output_var = "discharge_calculated" # Load the model -model = pyflo_bmi.Bmi_Pyflo() +model = unithg_bmi.Bmi_Unithg() def init_model(): catchment_area = 1.0 diff --git a/pyflo_bmi/__init__.py b/unithg_bmi/__init__.py similarity index 86% rename from pyflo_bmi/__init__.py rename to unithg_bmi/__init__.py index 3fb424e..afc6b98 100644 --- a/pyflo_bmi/__init__.py +++ b/unithg_bmi/__init__.py @@ -1,4 +1,4 @@ -from .pyflo_bmi import * +from .unithg_bmi import * from .src.basins import * from .src.discrete_time_series import * from .src.conversions import * diff --git a/pyflo_bmi/src/basins.py b/unithg_bmi/src/basins.py similarity index 100% rename from pyflo_bmi/src/basins.py rename to unithg_bmi/src/basins.py diff --git a/pyflo_bmi/src/conversions.py b/unithg_bmi/src/conversions.py similarity index 100% rename from pyflo_bmi/src/conversions.py rename to unithg_bmi/src/conversions.py diff --git a/pyflo_bmi/src/debug_utils.py b/unithg_bmi/src/debug_utils.py similarity index 100% rename from pyflo_bmi/src/debug_utils.py rename to unithg_bmi/src/debug_utils.py diff --git a/pyflo_bmi/src/discrete_time_series.py b/unithg_bmi/src/discrete_time_series.py similarity index 100% rename from pyflo_bmi/src/discrete_time_series.py rename to unithg_bmi/src/discrete_time_series.py diff --git a/pyflo_bmi/unit_hydrograph_model.py b/unithg_bmi/unit_hydrograph_model.py similarity index 100% rename from pyflo_bmi/unit_hydrograph_model.py rename to unithg_bmi/unit_hydrograph_model.py diff --git a/pyflo_bmi/pyflo_bmi.py b/unithg_bmi/unithg_bmi.py similarity index 98% rename from pyflo_bmi/pyflo_bmi.py rename to unithg_bmi/unithg_bmi.py index d24bb8f..b82fbc6 100644 --- a/pyflo_bmi/pyflo_bmi.py +++ b/unithg_bmi/unithg_bmi.py @@ -33,9 +33,9 @@ def _finalize_info_categories(cls): return cls @_finalize_info_categories -class Bmi_Pyflo(Bmi): +class Bmi_Unithg(Bmi): """ - A Basic Model Interface (BMI) wrapper for the PyFLO model. + A Basic Model Interface (BMI) wrapper for the unit hydrograph. Required model methods: - Bookkeeping: @@ -128,7 +128,7 @@ def set_value(self, value: Union[float, np.ndarray]): else: self.value[0] = value # Internal model attributes - _name: str = "PyFlo_BMI" + _name: str = "unithg_bmi" _start_time: float _num_time_steps: int _time_step_size: float @@ -193,9 +193,9 @@ def __init__(self): self.info() #Ensure these are initialized as instance variables, not class variables self._vars = { - Bmi_Pyflo.VarType.INPUT: [], - Bmi_Pyflo.VarType.OUTPUT: [], - Bmi_Pyflo.VarType.MODEL: [], + Bmi_Unithg.VarType.INPUT: [], + Bmi_Unithg.VarType.OUTPUT: [], + Bmi_Unithg.VarType.MODEL: [], } self._model = None self._model_data = {}