Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metloom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """M3Works"""
__email__ = "m3worksllc@gmail.com"
__version__ = '0.9.1'
__version__ = '0.9.2'
2 changes: 2 additions & 0 deletions metloom/dataframe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def resample_df(raw_df: pd.DataFrame,
desired interval
"""
name = variable.name
if interval == 'H':
interval = 'h' # pandas uses lowercase for hourly resampling
if name in raw_df.columns:
if variable.accumulated:
result = raw_df[name].resample(interval).sum()
Expand Down
12 changes: 12 additions & 0 deletions metloom/pointdata/snotel_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ def get_data(self, element_cd: str, **extra_params):
mapped_params = self._get_params(**extra_params)
params = {**self.params, **mapped_params}
data = self._make_request(**params)

# In some cases, in particlular for snow course data prior to 2011, the collection dates
# are not included in the reponse for the SWE variable, but are included in the depth (SNWD).
# This is a workaround to make a second request if the collection data are missing.
if (
(len(data) > 0)
and ("collectionDates" in data[0])
and all(c is None for c in data[0]["collectionDates"])
):
data2 = self._make_request(**{**params, "elementCd": "SNWD"})
data[0]["collectionDates"] = data2[0]["collectionDates"]

return self._parse_data(data)


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.1
current_version = 0.9.2
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/M3Works/metloom',
version='0.9.1',
version='0.9.2',
zip_safe=False,
)
Loading