CABLE-LSM / benchcab

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

Add parse and dispatch strategy #198

Closed SeanBryan51 closed 1 year ago

SeanBryan51 commented 1 year ago

The current method of executing subcommands can be improved using a "parse and dispatch" strategy. Whereby you don't need to run a conditional to work out which subcommand to use.

This change refactors the Benchcab class so that its "public" methods can be dispatched easily when inspecting the argparse.Namespace object returned by the command line parser.

Fixes #196

codecov[bot] commented 1 year ago

Codecov Report

Merging #198 (474d183) into main (d1192c9) will decrease coverage by 1.55%. Report is 1 commits behind head on main. The diff coverage is 45.79%.

@@            Coverage Diff             @@
##             main     #198      +/-   ##
==========================================
- Coverage   86.74%   85.19%   -1.55%     
==========================================
  Files          27       27              
  Lines        1396     1385      -11     
==========================================
- Hits         1211     1180      -31     
- Misses        185      205      +20     
Files Coverage Δ
benchcab/cli.py 100.00% <100.00%> (ø)
tests/test_cli.py 100.00% <100.00%> (ø)
benchcab/main.py 50.00% <50.00%> (ø)
benchcab/benchcab.py 23.12% <23.88%> (-9.84%) :arrow_down:
SeanBryan51 commented 1 year ago

Integration tests seem to be working. Merging now.