Skip to content

Automatize documentation of output KPI in RTD#869

Merged
smartie2076 merged 47 commits intodevfrom
rtd/output_parameters
May 3, 2021
Merged

Automatize documentation of output KPI in RTD#869
smartie2076 merged 47 commits intodevfrom
rtd/output_parameters

Conversation

@smartie2076
Copy link
Copy Markdown
Collaborator

@smartie2076 smartie2076 commented Apr 23, 2021

Adresses #873

Changes proposed in this pull request:
❌ Create table (MVS_output_list.csv) with following column headings: :Definition:,valid_interval,:Type:,:Unit:,label,ref,categories (economic, technical, environemental? --> technical),see_also -> already implemented with file MVS_kpi_list.csv

  • Explain the categories shown in the RTD, like here a211ccf
  • Add each parameter in the RTD using .inc and so on. inc created with 3b63e37, applied with a211ccf
  • [?] Create a table-view of the parameters, like here, e5c4e79
  • Fill new file MVS_kpis_list.csv with content, use MVS_output_parameters_tooltips.xlsx to start with
  • Add a file MVS_kpi_categories.csv, relating to the :categories: in MVS_kpis_list.csv: 42707f0
  • Create bulleted list of outputs of each category, comp. here, 1d2f9ce. Done with: e2414b3, 2cd4c08
  • Check MVS_kpis_list.csv for completeness
  • Implement the references from one KPI to other related KPI
  • Decapitalize any first letters of constants in constants_json_strings.py and remove all spaces

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)

@smartie2076 smartie2076 self-assigned this Apr 23, 2021
@smartie2076 smartie2076 added the documentation Improvements or additions to documentation label Apr 23, 2021
@smartie2076
Copy link
Copy Markdown
Collaborator Author

Goal for output parameter documentation, as mentioned in #853:

Output KPI (how we calculate them)
   Short description loaded automatically form .inc files generated form a MVS_outputs.csv
   	Columns :Definition:,valid_interval,:Type:,:Unit:,label,ref,categories (economic, technical, environemental? --> technical),see_also (collection of links)
   Not in a csv file for the complete and formal mathematical definition

@smartie2076
Copy link
Copy Markdown
Collaborator Author

PR #842 shows an outline of how this worked for the input parameters.

@smartie2076
Copy link
Copy Markdown
Collaborator Author

smartie2076 commented Apr 23, 2021

@Bachibouzouk already prepared the processing of the output parameters:

  • generate_kpi_description in conf.py -> creates .inc files in model/outputs
  • fill MVS_kpis_list.csv with info
  • Add .. include:: outputs/<Datei Name>.inc at the appropriate location

@smartie2076
Copy link
Copy Markdown
Collaborator Author

I personally do not think that creating a table view of the parameters is necessary.

@Bachibouzouk
Copy link
Copy Markdown
Collaborator

Bachibouzouk commented Apr 26, 2021

@smartie2076 - Several internal references are not using the correct label names, this should be fixed

@smartie2076
Copy link
Copy Markdown
Collaborator Author

There are a couple of references calling label pdf-report-commands that do not work:

D:\PycharmProjects\mvs_eland\docs\model\simulation_outputs.rst:352: WARNING: undefined label: pdf-report-commands (if the link has no caption the label must precede a section he
ader)
D:\PycharmProjects\mvs_eland\docs\model\simulation_outputs.rst:361: WARNING: undefined label: pdf-report-commands (if the link has no caption the label must precede a section he
ader)

They are called here twice (:ref:'report section <pdf-report-commands>'). It seems that when converting the README.rst to readme.inc (here) the label that is defined here is not used?

I did not change anything here, though, so I do not think this is the issue.

@smartie2076
Copy link
Copy Markdown
Collaborator Author

I am making sure that we can not have capitalization and space typos anymore

@smartie2076 smartie2076 force-pushed the rtd/output_parameters branch 2 times, most recently from f7bd13d to 490c590 Compare April 28, 2021 08:52
@smartie2076
Copy link
Copy Markdown
Collaborator Author

@ciaradunks @Bachibouzouk I am sorry about the many commits - I actualy wanted to push the refactoring into a seperate branch and PR, but mistakenly pushed to this branch.

Personally, I dont know anymore what :type: is supposed to help me with. Currently, all are numeric. I might be able to also add the figures and dispatch flows in there, and then those would be timeseries/png/the report. Is that what was intended?

@smartie2076 smartie2076 marked this pull request as ready for review April 28, 2021 08:55
@smartie2076 smartie2076 requested a review from ciaradunks April 28, 2021 09:02
@smartie2076 smartie2076 changed the title Proper documentation of output parameters in RTD Automatize documentation of output KPI in RTD Apr 28, 2021
@Bachibouzouk
Copy link
Copy Markdown
Collaborator

Personally, I dont know anymore what :type: is supposed to help me with

I would distinguish between numeric and array of numeric
If the outputs you provide are all numeric (no arrays) we can remove the column :type: :)

@smartie2076
Copy link
Copy Markdown
Collaborator Author

Personally, I dont know anymore what :type: is supposed to help me with

I would distinguish between numeric and array of numeric
If the outputs you provide are all numeric (no arrays) we can remove the column :type: :)

I now used it in #874, and now there are also the type time series and file types

@smartie2076
Copy link
Copy Markdown
Collaborator Author

Thank you for the thorough review @ciaradunks !

- Adapt `conf.generate_parameter_description` for output KPI
- Create `conf.generate_kpi_description()`
 - Add `MVS_kpi_categories.csv`
 - Create list using `MVS_kpi_categories.csv` and `MVS_kpis_list.csv` with `conf.generate_kpi_categories()`
- Add some labels
- Add introductory text
- Minor restructuring
- Add section explaining how KPI will be defined
- Add section of suffixes of KPI, add label in `assumptions.rst`
- Add `.. include::` for each KPI that needs to be officially defined
- Restructure, so that Economic - Technical - Environmental - Figures - Autoreport
smartie2076 and others added 25 commits May 3, 2021 17:12
 -> "total_non_renewable_energy_use"
And fix
 -> "total_non-renewable_energy_use"
And fix
…ation" -> "renewable_share_of_local_generation"

And fix
…ent" -> "specific_emissions_per_electricity_equivalent"

And fix
…vider" -> "total_consumption_from_energy_provider"
@smartie2076 smartie2076 force-pushed the rtd/output_parameters branch from b20978f to d94f610 Compare May 3, 2021 15:13
@smartie2076 smartie2076 merged commit 5c0d561 into dev May 3, 2021
@smartie2076 smartie2076 deleted the rtd/output_parameters branch May 3, 2021 15:18
Copy link
Copy Markdown
Collaborator

@Bachibouzouk Bachibouzouk left a comment

Choose a reason for hiding this comment

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

I made some of the change I proposed on #878

* :ref:`Levelized cost of energy (LCOE) <lcoe>` of the energy system, in electricity equivalent
* :ref:`Levelized cost of an energy carrier <lcoe>` in electricity equivalent (LCOEleq) for each energy carrier in the energy system
* :ref:`Levelized cost of asset dispatch <lcoe_asset>`, calculated from the annuity of an asset and their throughput
* :ref:`NPC <costs_total>` and annuity of the whole energy system
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.

Are you sure you want to replace net present cost by cost_total. If yes, why call this variable NPC then? I find it confusing. LCOE is explicitly named before being abbreviated below but NPC not

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.

Yes, the name in the .csv for costs_total is also NPC (https://multi-vector-simulator.readthedocs.io/en/latest/model/simulation_outputs.html#net-present-costs-npc-costs-total) we could also use Net present costs here, though.

At some point we should actually change costs_total into NPC directly in the code, so that it is also displayed correctly in the report. Multiple ways to do this (either translate for the report/outputs only, or translate when adding the keys to the dict_values)

@smartie2076 smartie2076 mentioned this pull request May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants