Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_shape_area() and plot_shape() methods to DefaultForcing #464

Conversation

RolfHut
Copy link
Contributor

@RolfHut RolfHut commented Nov 7, 2024

first commit added get_shape_area (needs testing)

needs testing
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.29%. Comparing base (ee28ec6) to head (86314e2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ewatercycle/esmvaltool/run.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #464      +/-   ##
==========================================
+ Coverage   78.83%   79.29%   +0.45%     
==========================================
  Files          28       28              
  Lines        1810     1850      +40     
  Branches      218      155      -63     
==========================================
+ Hits         1427     1467      +40     
  Misses        325      325              
  Partials       58       58              
Files with missing lines Coverage Δ
src/ewatercycle/base/forcing.py 84.33% <100.00%> (+4.97%) ⬆️
src/ewatercycle/esmvaltool/run.py 55.00% <0.00%> (ø)

@RolfHut
Copy link
Contributor Author

RolfHut commented Nov 7, 2024

tested and works, but check fails, I could use some tips on the checks that are being run and the best practices we adhere to in coding style

@BSchilperoort
Copy link
Member

Thanks for picking this up! There are instructions in the CONTRIBUTING.md document.

I think the instructions are missing that pip3 install -e . should actually be pip3 install -e .[dev] (so the dev dependencies are installed as well).

To run the pre-commit hook manually (on all files, not associated with a commit), you can do pre-commit run --all. This should fix the formatting issues.

The codecov check is failing because you've added code that is not tested. If you would add tests for the two functions this should be fixed. For the shape area you can easily check if the output is numerically correct. Testing the plotting code is more difficult, maybe we only check if it ran without errors.

Copy link
Member

@BSchilperoort BSchilperoort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suggestions should fix most issues.

src/ewatercycle/base/forcing.py Outdated Show resolved Hide resolved
src/ewatercycle/base/forcing.py Outdated Show resolved Hide resolved
src/ewatercycle/base/forcing.py Outdated Show resolved Hide resolved
src/ewatercycle/base/forcing.py Outdated Show resolved Hide resolved
@BSchilperoort
Copy link
Member

I've fixed the linting/formatting issues and added tests for the new methods. Everything's good now ✔️

@BSchilperoort BSchilperoort merged commit 224383d into main Nov 7, 2024
3 of 4 checks passed
@BSchilperoort BSchilperoort deleted the Add-get_shape_area()-and-plot_shape()-methods-to-DefaultForcing branch November 7, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants