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

Add config validation CLI #191

Closed SeanBryan51 closed 10 months ago

SeanBryan51 commented 11 months ago

Fixes #186

codecov[bot] commented 11 months ago

Codecov Report

Merging #191 (505bc50) into main (474d183) will decrease coverage by 0.01%. Report is 1 commits behind head on main. The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   85.19%   85.19%   -0.01%     
==========================================
  Files          27       27              
  Lines        1385     1391       +6     
==========================================
+ Hits         1180     1185       +5     
- Misses        205      206       +1     
Files Coverage Δ
benchcab/cli.py 100.00% <100.00%> (ø)
tests/test_cli.py 100.00% <100.00%> (ø)
benchcab/benchcab.py 23.42% <50.00%> (+0.30%) :arrow_up:
SeanBryan51 commented 11 months ago

This is a bit of a hack since the validation occurs in Benchcab.__init__() which will consequently run anything else that is inside the __init__ method. E.g. benchcab will yell at you if we are not running on Gadi due to the _validate_environment method being called.

Perhaps this issue will go away once we are able to port benchcab to other machines?

SeanBryan51 commented 11 months ago

The parse and dispatch strategy looks like a good option. I've made a new issue for this (see #196) as it is a bit out of the scope of this PR and a bit more involved.

ccarouge commented 10 months ago

I am wondering if it is time to introduce click. It's quite a bit of work so probably not necessary right away but it should remove the needs for either conditionals or a parse and dispatch strategy.