Skip to content

Copying assets #1966

@Flix6x

Description

@Flix6x

Copying pre-configured template assets (from a public datalake) will make it easier to start new projects and scale existing ones.

  • Add logic that copies an asset tree, and keeps asset/sensor ID references intact, for instance:
    • Parent asset references
    • Sensor references in the flex-config
    • Sensor references in sensors_to_show and kpi_sensors_to_show
    • Our first idea is to cycle twice:
      • on first cycle, create the asset/sensor structure, and in parallel build a mapping (dict) of asset&sensor IDs, from original ID to the new ID. Each time a new asset/sensor is created by copying it, update the mapping. It's a bit tricky to keep track of known assets/sensors - only copy assets/sensors within the asset tree - the ones outside should stay as-is (e.g. a public asset's market sensor).
      • on second cycle, replace all ID references with the new ones.
    • During development, already make a few test cases. This needs test-driven development, that helps both dev and reviewer.
    • Could be triggered by a new CLI command at first, but I'm not sure this is needed
  • Add UX to copy template assets into own asset tree (how, what auth do we need?)
    • Select account (defaults to your own account)
    • Select parent asset (defaults to None, making it a top-level asset)
  • Add way to store asset templates publicly
    • I envision a public datalake (within FlexMeasures) with admin-curated asset templates
    • flexmeasures add initial-structure could set up a few templates to start first-time users off with
  • Add datalake documentation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions