Skip to content

Commit

Permalink
fix imports and environment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccreight committed Jun 29, 2024
1 parent 6ffbbaa commit 1efef4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- contextily
- epiweeks
- filelock
- folium
- geopandas
- geoviews
- git
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ optional = [
"pydot",
"geos",
"cartopy",
"folium",
"geopandas",
"hvplot",
"shapely",
Expand Down
14 changes: 8 additions & 6 deletions pywatershed/plot/domain_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import pathlib as pl
from typing import Union

import folium
import geopandas as gpd
import pandas as pd
from IPython.display import display

import pywatershed as pws
from ..base import Parameters
from ..utils import import_optional_dependency

folium = import_optional_dependency("folium")


class DomainPlot:
Expand Down Expand Up @@ -47,8 +49,8 @@ def __init__(
self,
hru_shp_file: Union[pl.Path, str] = None,
segment_shp_file: Union[pl.Path, str] = None,
hru_parameters: Union[pl.Path, pws.Parameters] = None,
segment_parameters: Union[pl.Path, pws.Parameters] = None,
hru_parameters: Union[pl.Path, Parameters] = None,
segment_parameters: Union[pl.Path, Parameters] = None,
hru_parameter_names: list[str] = None,
segment_parameter_names: list[str] = None,
hru_highlight_indices: list = None,
Expand Down Expand Up @@ -325,11 +327,11 @@ def make_domain_plot(self):
@staticmethod
def _add_parameters(
gdf: gpd.geodataframe.GeoDataFrame,
parameters: Union[pws.Parameters, pl.Path, str],
parameters: Union[Parameters, pl.Path, str],
parameter_names: list,
):
if isinstance(parameters, (pl.Path, str)):
parameters = pws.Parameters.from_netcdf(parameters, use_xr=True)
parameters = Parameters.from_netcdf(parameters, use_xr=True)

if parameter_names is None or len(parameter_names) == 0:
raise ValueError("No parameter names specified for tooltip.")
Expand Down

0 comments on commit 1efef4a

Please sign in to comment.