Skip to content

Read energy totals from network meta data #48

@maxnutz

Description

@maxnutz

Goal

all pypsa-at networks include the energy_totals data directly in the network-output-file in n.meta.energy_totals. in case this exists, data for energy_totals should be read from there, so there is no extra dependency on another file. If n.meta.energy_totals is not present, read the data from an extra file as is. If this file does not exist, raise an error.

Include all code in one central function get_energy_totals_domestic_share in utils, that reliably returns the domestic to international ratio and cache the energy_totals - data, so that it is available after the first call of this function.

Testing

include a mock energy_totals table to mock_network and check all possiblities:

  • network includes energy_totals table -> use it
  • network does not include energy_totals table and path to energy_totals file exist -> use energy_totals from file
  • network does not include energy_totals table and path to energy_totals file does not exist -> raise an Error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions