src.eddie.digitaltwin.cache_new_results

This script facilitates caching model results, allowing results to be retrieved immediately if the same scenario options are queried later.

Attributes

log

sample_polygon

Functions

main(→ int)

Cache the scenario options used to generate the existing model with the given model id, for faster retrieval later.

Module Contents

src.eddie.digitaltwin.cache_new_results.log
src.eddie.digitaltwin.cache_new_results.main(selected_polygon_gdf: geopandas.GeoDataFrame, model_id: int, scenario_options: dict, log_level: eddie.digitaltwin.utils.LogLevel = LogLevel.DEBUG) int

Cache the scenario options used to generate the existing model with the given model id, for faster retrieval later.

Parameters:
  • selected_polygon_gdf (gpd.GeoDataFrame) – The selected area of interest to cache, any area fully intersecting this one can be retrieved later if the other parameters match.

  • model_id (int) – The database id of the existing model output to attach the cached parameters to.

  • scenario_options (dict) – The input parameters to the model to cache, which must match for later retrieval.

  • log_level (LogLevel = LogLevel.DEBUG) – The log level to set for the root logger. Defaults to LogLevel.DEBUG.

Returns:

model_id re-returned to allow method chaining.

Return type:

int

src.eddie.digitaltwin.cache_new_results.sample_polygon