Skip to content

Unable to distinguish exported curves with packer #129

@robcalon

Description

@robcalon

Context

Exporting the curves with the packer doesn't provide a useful dataframe as all types of hourly curves dataframes are concatenated together without a unique key. This makes it impossible to subset specific curves after export.

Steps to reproduce

See the following notebook snippet and resulting dataframe.

from pyetm.models import Session, Scenarios, ScenarioPacker

s1 = Session.load(1172446)
s2 = Session.load(1172447)
s3 = Session.load(1172450)

scenarios = Scenarios(items=[s1, s2, s3])

packer = ScenarioPacker()
packer.add(*scenarios)

exports = packer.exports()
exports
Image

Proposed solution

Please add a (named) level to the multi index column that specifies the type of curve so that this curve type can be extracted. It would also be very useful if the curve type(s) to be exported can be added as an optional parameter in the exports call itself, e.g. packer.exports(curves=["electricity", "electricity_price"]). Furthermore you could consider offering the exported curves as a dictionary of dataframes instead of concatenating them all together into a single dataframe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions