Skip to content

Commit

Permalink
Updated the change log, added contributor information and included tests
Browse files Browse the repository at this point in the history
Added a note in the CHANGELOG.rst, added contributor information in the .zenodo.json and in the AUTHORS.rst files, and added tests in the test_extractor.py script to confirm that everything is working as I expect.
  • Loading branch information
lou-a committed Oct 2, 2024
1 parent 2e53462 commit 0b11267
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
"name": "Arsenault, Richard",
"affiliation": "École de technologie supérieure",
"orcid": "0000-0003-2834-2750"
}
},
{
"name": "Arnal, Louise",
"affiliation": "Ouranos",
"orcid": "0000-0002-0208-2324"
},
],
"keywords": [
"climate change",
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Co-Developers
Contributors
------------

None yet. Why not be the first?
* Louise Arnal <arnal.louise@ouranos.ca> `@lou-a <https://github.com/lou-a>`_
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Internal changes
* `ravenpy` now has a `CODE_OF_CONDUCT.md` file.
* Many `numpydoc`-style docstrings have been adjusted for consistency.
* Added `setuptools` to the `gis` build recipe to ensure that the `gdal` bindings are built successfully. (PR #400)
* Modified the sub-basin and channel profile extraction functions to correctly set the river length to zero and set default values for reach attributes in sub-basins with no channel routing (i.e., sub-basins with lakes or headwater basins). (PR #401)

v0.15.0 (2024-06-20)
--------------------
Expand Down
14 changes: 14 additions & 0 deletions tests/test_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ def test_basinmaker_extractor(get_local_testdata, tmp_path):
routing_product_version="2.1",
)
rvh_config = rvh_extractor.extract(hru_from_sb=True)

# Create lists of values to check
bedslope_list = [item['bed_slope'] for item in rvh_config["channel_profile"]]
mannings_list = [value for d in rvh_config["channel_profile"] for value in [t[1] for t in d['roughness_zones']]]
reach_length_list = [item['reach_length'] for item in rvh_config["sub_basins"]]

rvh_config.pop("channel_profile")

config = BasicRoute(**rvh_config)
config.write_rv(tmp_path, modelname="routing")

# Checks that the bedslope, Manning and reach length values are non negative numbers
assert all(isinstance(x, (int, float)) for x in bedslope_list) is True
assert any(x < 0 for x in bedslope_list) is False
assert all(isinstance(y, (int, float)) for y in mannings_list) is True
assert any(y < 0 for y in mannings_list) is False
assert all(isinstance(z, (int, float)) for z in bedslope_list) is True
assert any(z < 0 for z in reach_length_list) is False

0 comments on commit 0b11267

Please sign in to comment.