Skip to content

Commit

Permalink
Merge branch 'main' into 112-add-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Lamont committed Feb 12, 2024
2 parents 8140bb4 + 87def7d commit 00d4279
Show file tree
Hide file tree
Showing 8 changed files with 778 additions and 854 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.7] - 2024-02-09

### Changed
* Upgraded pandas to ^2.2.0
* Changed unit="H" in pandas.time_delta to unit="h"
* Updated assert statements in `test_weight_generation.py`

## [0.3.6] - 2024-02-07

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ $ poetry add git+https://github.com/RTIInternational/teehr.git#[BRANCH TAG]

Use Docker
```bash
$ docker build -t teehr:v0.3.6 .
$ docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.3.6 jupyter lab --ip 0.0.0.0 $HOME
$ docker build -t teehr:v0.3.7 .
$ docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.3.7 jupyter lab --ip 0.0.0.0 $HOME
```

## Examples
Expand Down
1,603 changes: 757 additions & 846 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "teehr"
version = "0.3.6"
version = "0.3.7"
description = "Tools for Exploratory Evaluation in Hydrologic Research"
authors = [
"RTI International",
Expand All @@ -13,7 +13,6 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
pandas = "^2.1.3"
geopandas = "^0.14.0"
duckdb = "^0.9.2"
pydantic = "^2.4.2"
Expand All @@ -33,6 +32,7 @@ pyarrow = "^14.0.1"
fastapi = "^0.103.0"
uvicorn = {extras = ["standard"], version = "^0.24.0.post1"}
httpx = "^0.25.1"
pandas = "^2.2.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.3"
Expand Down
2 changes: 1 addition & 1 deletion src/teehr/loading/nwm/grid_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def process_single_file(
yrmoday = row.day
z_hour = row.z_hour[1:3]
ref_time = pd.to_datetime(yrmoday) \
+ pd.to_timedelta(int(z_hour), unit="H")
+ pd.to_timedelta(int(z_hour), unit="h")

nwm_units = ds[variable_name].attrs["units"]
teehr_units = units_format_dict.get(nwm_units, nwm_units)
Expand Down
2 changes: 1 addition & 1 deletion src/teehr/loading/nwm/point_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def file_chunk_loop(
nwm22_units = ds[variable_name].units
teehr_units = units_format_dict.get(nwm22_units, nwm22_units)
ref_time = pd.to_datetime(row.day) \
+ pd.to_timedelta(int(row.z_hour[1:3]), unit="H")
+ pd.to_timedelta(int(row.z_hour[1:3]), unit="h")

valid_time = ds.time.values
feature_ids = ds.feature_id.astype("int32").values
Expand Down
8 changes: 7 additions & 1 deletion tests/test_weight_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ def test_weights():

df_test = pd.read_parquet(WEIGHTS_FILEPATH)

assert df.equals(df_test)
df_test.sort_values(["row", "col", "weight"], inplace=True)
df.sort_values(["row", "col", "weight"], inplace=True)

assert (df.row.values == df_test.row.values).all()
assert (df.col.values == df_test.col.values).all()
assert (df.weight.values == df_test.weight.values).all()
assert (df.location_id.values == df_test.location_id.values).all()


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.6
0.3.7

0 comments on commit 00d4279

Please sign in to comment.