nismod / smif

Simulation Modelling Integration Framework
http://www.itrc.org.uk
MIT License
22 stars 6 forks source link

I351 list results #358

Closed fcooper8472 closed 5 years ago

fcooper8472 commented 5 years ago

New behaviour

smif list

smif list will now append an asterisk to model run names if full results exist

smif available_results <run_name>

smif available_results <run_name> will detail the results available for a single <run_name>: for instance (with results):

model run: energy_water_cp_cr
  - sos model: energy_water
    - sector model: water_supply
      - output: cost
        - decision 0: 2010, 2015, 2020
      - output: energy_demand
        - decision 0: 2010, 2015, 2020
      - output: water
        - decision 0: 2010, 2015, 2020
      - output: reservoir_level
        - decision 0: 2010, 2015, 2020
    - sector model: energy_demand
      - output: cost
        - decision 0: 2010, 2015, 2020
      - output: water_demand
        - decision 0: 2010, 2015, 2020

And, without results:

model run: energy_water_cp_cr
  - sos model: energy_water
    - sector model: water_supply
      - output: cost
        - no results
      - output: energy_demand
        - no results
      - output: water
        - no results
      - output: reservoir_level
        - no results
    - sector model: energy_demand
      - output: cost
        - no results
      - output: water_demand
        - no results

Omitting the <run_name> will print all information for every model run.

Closes #351 and #352

codecov[bot] commented 5 years ago

Codecov Report

Merging #358 into develop will increase coverage by 0.58%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #358      +/-   ##
===========================================
+ Coverage    70.59%   71.18%   +0.58%     
===========================================
  Files           59       59              
  Lines         5183     5292     +109     
  Branches       615      647      +32     
===========================================
+ Hits          3659     3767     +108     
+ Misses        1431     1430       -1     
- Partials        93       95       +2
Flag Coverage Δ
#javascript 71.18% <100%> (+0.58%) :arrow_up:
#python 78.99% <100%> (+0.5%) :arrow_up:
Impacted Files Coverage Δ
src/smif/data_layer/store.py 95.23% <100%> (+0.38%) :arrow_up:
src/smif/data_layer/file/file_data_store.py 87.61% <0%> (+0.53%) :arrow_up:
src/smif/decision/decision.py 95.15% <0%> (+1.93%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b303134...40ce640. Read the comment docs.

fcooper8472 commented 5 years ago

@willu47 I have made the complete results checking optional: it's now an additional flag smif list <-c/--complete>.

Would be interesting to what is actually slowing up the smif list, but unfortunately I've not been able to get my dev version of smif working with nismod2...

I suspect the slowdown must be in _get_canonical_expected_results rather than _get_canonical_available_results but it only seems to be reading some YAML config - any ideas?

tomalrussell commented 5 years ago

I'm happy to ignore appveyor/branch failures here where they relate to conda-forge or dependency errors, so long as appveyor/pr and travis get :heavy_check_mark:s.

fcooper8472 commented 5 years ago

The new functionality builds the list of available results based on calls to store.canonical_expected_results and store.available_results. This removes some code duplication and should also improve performance.

All methods (including new cli functionality) are now unit tested.

Ready for another review @willu47