CABLE-LSM / benchcab

Tool for evaluation of CABLE land surface model
https://benchcab.readthedocs.io/en/latest/
Apache License 2.0
2 stars 3 forks source link

Switch to src layout #271

Closed SeanBryan51 closed 6 months ago

SeanBryan51 commented 6 months ago

Currently we are not testing the installed version of the package in our CI workflow. This is one of the major disadvantages in using a flat layout. This change switches the source code to use a src layout and reproduces the error described in https://github.com/CABLE-LSM/benchcab/issues/267 (see logs).

This pull request should be merged once #272 is merged so that we can verify the CI passes.

Fixes #270

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.81%. Comparing base (ac2cb1f) to head (59910ed). Report is 8 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #271 +/- ## ========================================== + Coverage 63.84% 72.81% +8.96% ========================================== Files 35 18 -17 Lines 2597 982 -1615 ========================================== - Hits 1658 715 -943 + Misses 939 267 -672 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

abhaasgoyal commented 6 months ago

Wouldn't the actual src files clash with the current folders created by runs of benchcab (this could further be a problem when we run benchcab clean).

└── src
    ├── benchcab <- Work on this PR
    ├── <realisation-0>
    └── <realisation-1>

For example , running benchcab clean would delete benchcab as well. Also, I believe src is holding folders for 2 different things here.

SeanBryan51 commented 6 months ago

@abhaasgoyal I think you might be confusing the benchcab source with bench_example. The src directory you mentioned is only generated when running benchcab and will not contain the benchcab source files.

abhaasgoyal commented 6 months ago

Oh yeah, my mistake.. Looks good to me! (I ran the integration tests as well)

SeanBryan51 commented 6 months ago

I've noticed the code coverage reports seem to differ when I have hardly changed the source code or the unit tests. Looking into this now.

SeanBryan51 commented 6 months ago

@abhaasgoyal I've made some new changes regarding the unit test coverage reports as coverage reports do not seem to be properly generated unless we run pytest against an editable install of benchcab. I've also restricted the coverage to measure only the source files under the src directory as files like versioneer.py were getting picked up by the coverage report.

Also please hit approve once you are happy with the changes.