1kastner / conflowgen

A generator for synthetic container flows at maritime container terminals with a focus on yard operations
MIT License
11 stars 7 forks source link

Implement DataSummariesCache #183

Closed lucedes27 closed 1 year ago

lucedes27 commented 1 year ago

Addresses Issue #40

codecov[bot] commented 1 year ago

Codecov Report

Merging #183 (a83168a) into main (5a3bf62) will increase coverage by 0.24%. The diff coverage is 99.23%.

@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
+ Coverage   94.22%   94.47%   +0.24%     
==========================================
  Files         115      116       +1     
  Lines        4501     4595      +94     
==========================================
+ Hits         4241     4341     +100     
+ Misses        260      254       -6     
Impacted Files Coverage Δ
...n/analyses/container_dwell_time_analysis_report.py 100.00% <ø> (ø)
...ustment_by_vehicle_type_analysis_summary_report.py 100.00% <ø> (ø)
...d_and_outbound_vehicle_capacity_analysis_report.py 100.00% <ø> (ø)
conflowgen/analyses/modal_split_analysis_report.py 100.00% <ø> (ø)
...n/analyses/quay_side_throughput_analysis_report.py 100.00% <ø> (ø)
.../analyses/truck_gate_throughput_analysis_report.py 95.08% <ø> (ø)
...flowgen/analyses/truck_gate_throughput_analysis.py 93.02% <75.00%> (+0.34%) :arrow_up:
conflowgen/__init__.py 100.00% <100.00%> (ø)
...nflowgen/analyses/container_dwell_time_analysis.py 93.33% <100.00%> (+0.47%) :arrow_up:
...tainer_flow_adjustment_by_vehicle_type_analysis.py 91.66% <100.00%> (+0.75%) :arrow_up:
... and 27 more
lucedes27 commented 1 year ago

Whenever the input is changed, the cache should be reset as well. Please go over each class mentioned in https://conflowgen--183.org.readthedocs.build/en/183/notebooks/input_distributions.html and make sure that when new the user sets new input, the cache is reset.

See new commit Reset cache when input distributions changed

lucedes27 commented 1 year ago

It looks like previously there was a chaching mechanism, see e.g. https://conflowgen--183.org.readthedocs.build/en/183/_modules/conflowgen/analyses/inbound_and_outbound_vehicle_capacity_analysis.html#InboundAndOutboundVehicleCapacityAnalysis.get_inbound_container_volumes_by_vehicle_type or other instances of use_cache. As you have now implemented a better option requiring less repeated lines of code, can we drop the old caching? Having two caching mechanisms in place can be very confusing I assume!

See latest commit Remove deprecated use_cache mechanism