energyquantified / eq-python-client

Python library for Energy Quantified's Time Series API.
https://energyquantified-python.readthedocs.io/
Apache License 2.0
15 stars 2 forks source link

Unit Parameter #70

Closed komape closed 1 year ago

komape commented 1 year ago

Please have a look at https://github.com/energyquantified/eq-python-client/issues/66#issuecomment-1525043630

Closes #66.

komape commented 1 year ago

Rebased branch on master.

komape commented 1 year ago

Rebased on master and resolved conflicts.

komape commented 1 year ago
  • Should unit and denominator be included in dataframes? (Timeseries.to_df()

How would you add them?

fredriksvendsen commented 1 year ago
  • Should unit and denominator be included in dataframes? (Timeseries.to_df()

How would you add them?

I don't know if we want to add it, but I think it makes sense considering we include curve names (which includes unit pre-conversion) in the columns.

One option to include the unit is to append it to name in Timeseriesto_dataframe(). That way we don't have to change each of the different dataframe methods (e.g., _timeseries_to_dataframe_value_single_header, _timeseries_to_dataframe_scenarios).

if name is None:
        name = timeseries.name
        include_instance = True
    else:
        include_instance = False
if timeseries.unit is not None:
    name = f"{name}, unit: {timeseries.unit}"
    # If denominator can be set while unit is not, tab the statement below one step out
    if timeseries.denominator is not None:
        name = f"{name}, denominator: {timeseries.denominator}"

@jonmd What do you think?