Skip to content

Commit

Permalink
replace PyGeoFlood with pyGeoFlood everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
markwang0 committed Dec 3, 2024
1 parent 0aa2d13 commit 022ca01
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions doc/acknowledgements.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Acknowledgements
================

PyGeoFlood development is supported by a 2024 Hydroinformatics Innovation Fellowship awarded by the Consortium of Universities for the Advancement of Hydrologic Science, Inc. (CUAHSI).
pyGeoFlood development is supported by a 2024 Hydroinformatics Innovation Fellowship awarded by the Consortium of Universities for the Advancement of Hydrologic Science, Inc. (CUAHSI).

PyGeoFlood has been used in projects funded by:
pyGeoFlood has been used in projects funded by:

- NOAA Adaptation Sciences Program (NOAA-OAR-CPO-2021-2006389)
- NSF Graduate Research Fellowship Program (DGE-2137420)
Expand Down
2 changes: 1 addition & 1 deletion doc/apiref/apiref.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pygeoflood
==========

.. autoclass:: src.pygeoflood.PyGeoFlood
.. autoclass:: src.pygeoflood.pyGeoFlood
:members:


4 changes: 2 additions & 2 deletions doc/examples/c_hand_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"outputs": [],
"source": [
"from pathlib import Path\n",
"from pygeoflood import PyGeoFlood"
"from pygeoflood import pyGeoFlood"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
"metadata": {},
"outputs": [],
"source": [
"pgf = PyGeoFlood(dem_path=\"data/houston_example_DEM_30m.tif\")"
"pgf = pyGeoFlood(dem_path=\"data/houston_example_DEM_30m.tif\")"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions doc/examples/fim_workflow_combined.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"outputs": [],
"source": [
"from pathlib import Path\n",
"from pygeoflood import PyGeoFlood"
"from pygeoflood import pyGeoFlood"
]
},
{
Expand All @@ -52,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"pgf = PyGeoFlood(dem_path=\"data/OC1mTest.tif\")"
"pgf = pyGeoFlood(dem_path=\"data/OC1mTest.tif\")"
]
},
{
Expand Down Expand Up @@ -384,7 +384,7 @@
],
"source": [
"# set constant flowrate since we don't have a streamflow forecast\n",
"# see docs for `PyGeoFlood.config` and `PyGeoFlood.calculate_flood_stage`\n",
"# see docs for `pyGeoFlood.config` and `pyGeoFlood.calculate_flood_stage`\n",
"\n",
"pgf.config = {\"calculate_flood_stage\": {\"custom_Q\": 500}}\n",
"\n",
Expand Down Expand Up @@ -449,8 +449,8 @@
}
],
"source": [
"# save output data file paths we can load our PyGeoFlood instance later with\n",
"# pgf = PyGeoFlood.from_paths(\"data/paths.txt\")\n",
"# save output data file paths we can load our pyGeoFlood instance later with\n",
"# pgf = pyGeoFlood.from_paths(\"data/paths.txt\")\n",
"pgf.to_paths(\"data/paths.txt\")"
]
}
Expand Down
8 changes: 4 additions & 4 deletions doc/examples/fim_workflow_indiv_steps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"outputs": [],
"source": [
"from pathlib import Path\n",
"from pygeoflood import PyGeoFlood"
"from pygeoflood import pyGeoFlood"
]
},
{
Expand All @@ -53,7 +53,7 @@
"metadata": {},
"outputs": [],
"source": [
"pgf = PyGeoFlood(dem_path=\"data/OC1mTest.tif\")"
"pgf = pyGeoFlood(dem_path=\"data/OC1mTest.tif\")"
]
},
{
Expand Down Expand Up @@ -783,8 +783,8 @@
}
],
"source": [
"# save output data file paths we can load our PyGeoFlood instance later with\n",
"# pgf = PyGeoFlood.from_paths(\"data/paths.txt\")\n",
"# save output data file paths we can load our pyGeoFlood instance later with\n",
"# pgf = pyGeoFlood.from_paths(\"data/paths.txt\")\n",
"pgf.to_paths(\"data/paths.txt\")"
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/pygeoflood/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .pygeoflood import PyGeoFlood, PGF_Config
from .pygeoflood import pyGeoFlood, PGF_Config
32 changes: 16 additions & 16 deletions src/pygeoflood/pygeoflood.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from rasterio.warp import transform_bounds, reproject, calculate_default_transform, Resampling


class PyGeoFlood(object):
class pyGeoFlood(object):
"""A class to implement the height above nearest drainage method"""

@property
Expand Down Expand Up @@ -233,15 +233,15 @@ def from_paths(file_path):
attributes[attr] = value.strip('"')
if "project_dir" not in attributes.keys():
attributes["project_dir"] = None
# create instance of PyGeoFlood with attributes
loaded_pgf = PyGeoFlood(
# create instance of pyGeoFlood with attributes
loaded_pgf = pyGeoFlood(
dem_path=attributes["dem_path"],
project_dir=attributes["project_dir"],
)
for attr, value in attributes.items():
if attr != "dem_path" and attr != "project_dir":
setattr(loaded_pgf, attr, value)
print(f"PyGeoFlood instance created from {file_path}")
print(f"pyGeoFlood instance created from {file_path}")
print("Note: config attribute must be set separately.")
return loaded_pgf

Expand Down Expand Up @@ -1176,7 +1176,7 @@ def find_endpoints(
raise ValueError("A custom path is required when a custom_flowline d8_fdr is provided.")

t.check_attributes(
[("PyGeoFlood.flowline_path", flowline)],
[("pyGeoFlood.flowline_path", flowline)],
"find_endpoints",
)

Expand Down Expand Up @@ -1239,7 +1239,7 @@ def calculate_binary_hand(

required_files = [
("DEM", dem),
("PyGeoFlood.flowline_path", flowline),
("pyGeoFlood.flowline_path", flowline),
]

t.check_attributes(required_files, "calculate_binary_hand")
Expand Down Expand Up @@ -1306,7 +1306,7 @@ def rasterize_custom_flowline(
raise ValueError(f"A custom path is required when a custom_flowline is provided.")

t.check_attributes(
[("PyGeoFlood.custom_flowline_path", flowline)],
[("pyGeoFlood.custom_flowline_path", flowline)],
"rasterize_custom_flowline",
)

Expand Down Expand Up @@ -1448,7 +1448,7 @@ def extract_channel_network(
if custom_path is None:
raise ValueError(f"A custom path is required when a custom_flowline is provided.")

required_files = [("PyGeoFlood.flowline_path", flowline)]
required_files = [("pyGeoFlood.flowline_path", flowline)]
t.check_attributes(required_files, "extract_channel_network")

# set channel network raster and vectorpath
Expand Down Expand Up @@ -2077,7 +2077,7 @@ def calculate_src(
("DEM", dem),
("Segmented channel network vector",segmented_channel_network,),
("Channel network segment catchments",segment_catchment_raster,),
("PyGeoFlood.catchment_path", catchments),
("pyGeoFlood.catchment_path", catchments),
("HAND raster", hand),
]

Expand Down Expand Up @@ -2164,7 +2164,7 @@ def calculate_flood_stage(
"""
Calculate flood stage for each segment of the channel network.
Forecasted streamflow values for each COMID (feature ID) must be set
in `PyGeoFlood.streamflow_forecast_path` before running if custom_Q is not set.
in `pyGeoFlood.streamflow_forecast_path` before running if custom_Q is not set.
If the streamflow forecast is a netCDF file it must be in NWM format
(in xarray: 'streamflow' variable with a "feature_id" or "COMID" dim/coord).
If the streamflow forecast is a CSV file, it must have columns
Expand Down Expand Up @@ -2205,7 +2205,7 @@ def calculate_flood_stage(
required_files = [
("Synthetic rating curves", src),
(
"PyGeoFlood.streamflow_forecast_path",
"pyGeoFlood.streamflow_forecast_path",
streamflow_forcast,
),
]
Expand Down Expand Up @@ -2686,7 +2686,7 @@ def c_hand(
@t.time_it
def run_fim_workflow(self):
"""
Run the full PyGeoFlood workflow.
Run the full pyGeoFlood workflow.
"""
self.apply_nonlinear_filter()
self.calculate_slope()
Expand All @@ -2712,19 +2712,19 @@ def run_fim_workflow(self):
self.inundate()


# get dictionary of PyGeoFlood methods and their parameters
# get dictionary of pyGeoFlood methods and their parameters
pgf_methods = [
method
for method in dir(PyGeoFlood)
if inspect.isfunction(getattr(PyGeoFlood, method))
for method in dir(pyGeoFlood)
if inspect.isfunction(getattr(pyGeoFlood, method))
and not method.startswith("__")
]
pgf_params = {}
for method in pgf_methods:
pgf_params[method] = [
param
for param in inspect.signature(
getattr(PyGeoFlood, method)
getattr(pyGeoFlood, method)
).parameters.keys()
if param != "self"
]
Expand Down

0 comments on commit 022ca01

Please sign in to comment.