Skip to content

Reformat KPI energy sector#757

Merged
Bachibouzouk merged 6 commits intodevfrom
fix/rearrange_kpis
Jan 13, 2021
Merged

Reformat KPI energy sector#757
Bachibouzouk merged 6 commits intodevfrom
fix/rearrange_kpis

Conversation

@Bachibouzouk
Copy link
Copy Markdown
Collaborator

@Bachibouzouk Bachibouzouk commented Jan 13, 2021

Addresses part of #703

Changes proposed in this pull request:

  • Format KPI_UNCOUPLED_DICT to a pd.DataFrame
  • Add KPI individual sectors to the report

The following steps were realized, as well (if applies):

  • Use in-line comments to explain your code
  • Write docstrings to your code (example docstring)
  • For new functionalities: Explain in readthedocs
  • Write test(s) for your new patch of code (pytests, assertion debug messages)
  • Update the CHANGELOG.md
  • Apply black (black . --exclude docs/)
  • Check if benchmark tests pass locally (EXECUTE_TESTS_ON=master pytest)

For more information on how to contribute check the CONTRIBUTING.md.

@Bachibouzouk Bachibouzouk changed the title Fix/rearrange kpis Reformat KPI energy sector Jan 13, 2021
@Bachibouzouk
Copy link
Copy Markdown
Collaborator Author

A test is failing, I still need to fix it

Comment on lines +190 to +194
# Format KPI about energy generation into a pd.DataFrame
dict_values[KPI][KPI_UNCOUPLED_DICT] = pd.DataFrame.from_dict(
dict_values[KPI][KPI_UNCOUPLED_DICT], orient="index"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a workaround for the EPA, or does this mean that we will keep adding parameters to the KPI_UNCOUPLED_DICT as we were, and soley reformat it so that it is easier to use in the report?

Does this fix how the values are printed in the excel-sheet?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is no workaround, it makes a pd.DF from the way we were adding the parameters (it does it at the very end of the E0 function. It does print it nicely, in the report, and in the xls sheet. The EPA parser will be done in #675 after rebasing on dev after merging this PR :)

Comment on lines +966 to +968
"This results in the following KPI of the dispatch per energy sector:"
),
# TODO the table with renewable share, emissions, total renewable generation, etc.
make_dash_data_table(df_kpi_sectors),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the table to the end of the report, below Energy System: Key Performance Indicators (KPIs) and the energy system wide KPI.

However, it does not really matter... the order of the report is a mess and should probably be changed. Probably

  1. Project and economic data
  2. Energy system plot
  3. KPI
  4. Costs
  5. Dispatch
  6. Assumptions (including resources, demands...)

would make more sense...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say, whoever wants to reschuffle the order of the report can do it now in a subsequent PR :)

@Bachibouzouk Bachibouzouk merged commit 8e8319e into dev Jan 13, 2021
@Bachibouzouk Bachibouzouk deleted the fix/rearrange_kpis branch January 13, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants