Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue604 kpis disaggregated #606

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

javiarrobas
Copy link
Contributor

Closes #604. @dhblum could you take a look?

@javiarrobas javiarrobas self-assigned this Jan 11, 2024
@dhblum
Copy link
Collaborator

dhblum commented Jan 12, 2024

@JavierArroyoBastida Thanks for this. I'm not sure I will get to this today but will try to sometime next week.

Copy link
Collaborator

@dhblum dhblum left a comment

Choose a reason for hiding this comment

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

@JavierArroyoBastida Thanks for this and your patience. Generally this is looking good. A few inline comments.

One thing I'm thinking is that I've learned a bit in REST API design since original implementation of BOPTEST's, and I think a better way to do this would be create an endpoint GET /kpi/disaggregated. But, no other APIs use this address extension format (yet). So, I'm inclined to maybe just keep what you propose for now and this might change with a more comprehensive API format adjustment down the line (i.e. when consolidating into only using the Service architecture). Open to any discussion around this though.

Some additonal to-dos I'm thinking of:

  • update user guide with new api endpoint
  • it might be good to add a section in the design guide describing this disaggregation (e.g. ensuring to also include clarification on what the values mean for peak power, whether it is the peak power of the individual element considered separately or it is the contribution to the total peak at that time).
  • resolve any conflicts

@@ -1,5 +1,5 @@
keys,value
PCoo_y,0.0
PFan_y,0.000108999039431
PHea_y,0.111074370884
PFan_y,0.00523195389267
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these changing because of a correction on accounting for area or not within the disaggregated dictionary values? Same with pgas_dict_MultiZone.csv.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, this is due to 08a4dfc. For some reason for peak KPIs we were normalizing with the area at the contributions of each element already which is reflected at the pele_dict and pgas_dict dictionaries. This was not consistent with the rest of KPIs where we normalize only when calculating the total value (xxxx_tot).

'''Return the core KPIs of a test case disaggregated and
with absolute values (not normalized by area or zone)
to see the contributions of each element to each KPI.
Parameters
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add space before Parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Price scenario for cost kpi calculation.
'Constant' or 'Dynamic' or 'HighlyDynamic'.
Default is 'Constant'.
Returns
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add space before Returns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dkpi = dict
Dictionary with the core KPIs disaggregated and
with absolute values.
'''
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add space before '''.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

README.md Outdated
@@ -76,6 +76,7 @@ Example RESTful interaction:
| Receive control signal point names (u) and metadata. | GET ``inputs`` |
| Receive test result data for the given point names between the start and final time in seconds. | PUT ``results`` with required arguments ``point_names=<list of strings>``, ``start_time=<value>``, ``final_time=<value>``|
| Receive test KPIs. | GET ``kpi`` |
| Receive test KPIs disaggregated and in absolute values. | GET ``kpi_disaggregated`` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

@JavierArroyoBastida Suggest a bit more clarity: "Receive test KPIs disaggregated into contributing components (e.g. each equipment or zone) ... "

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@javiarrobas
Copy link
Contributor Author

Thanks for the review @dhblum! I'll go through your comments by next week.

@javiarrobas javiarrobas mentioned this pull request Mar 22, 2024
…_kpisDisaggregated

# Conflicts:
#	testing/references/bestest_hydronic/submit.json
#	testing/references/testcase3/submit.json
@javiarrobas
Copy link
Contributor Author

@dhblum this is ready to review again along with #650.

Changed from 'pgas_tot': 0.12017492256526957 to 'pgas_tot': 0.12017492256526958
@javiarrobas
Copy link
Contributor Author

@dhblum I finally got tests to pass and I believe this is ready for a second review. The change introduced in
testing/utilities.py is to display the differences with reference results in the Travis logs which has proven useful for this pull request, but please let me know if you'd prefer me to roll it back.

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.

Implement KPIs disaggregated
2 participants