-
Notifications
You must be signed in to change notification settings - Fork 37
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
Optimized dispatches from HERON to HYBRID #202
Conversation
@PaulTalbot-INL |
Creates a list of components' capacities from the HERON inpue file plus creating placeholders for the components' capacities in HYRBID | ||
@ In, heron input, str, the HERON input XML file | ||
@ In, output_file, str, the text file where the list of components capacities should be printed. | ||
@ Out, output_file, str, text a file autoloaded with the list of components' capacities from the HERON file and placeholders for the components' capacities in HYRBID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these docstrings should be indented one more time beyond the triple quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coming back and checking, this method also doesn't return anything, so out should be None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
""" | ||
|
||
# Creating the HERON XML file tree | ||
HERON_inp_tree = ET.parse(heron_input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, but we may not always use XML and we should use the RAVEN tree reader instead. We can fix that if and when we ever get that far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
Creates a list of dispatches (components' optimized variables) from the HERON inpue file plus creating placeholders for the dispatches in HYRBID | ||
@ In, dispatch_print, str, the distpach csv file with a list of optimized variables | ||
@ In, output_file, str, the text file where the list of optimized dispatches should be printed. | ||
@ Out, output_file, str, a text file autoloaded with the optimized dispatches plus placeholders for the HYBRID dispatches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same indent needed here, 2 more spaces past the triple quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, this method doesn't look to me like it returns anything, so this should be @ Out, None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
from xml.etree import ElementTree as ET | ||
import pandas as pd | ||
from colorama import Fore | ||
from colorama import Style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is colorama part of our standard install?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it.
Identifies which component dispatch/capacity in HYBRID corresponds to which component dispatch/capacity in HERON. | ||
@ In, user-input file, str, the user-input text file | ||
@ Out, a dictionary that matches HERON and HYBRID capacities, dict, Defining the HYBRID capacity that corresponds to each HERON capacity | ||
@ Out, a dictionary that matches HERON and HYBRID dispatches, dict, Defining the HYBRID dispatch that corresponds to each HERON dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first argument here should be the variable name, so heron_hybrid_dispatch
for the second output.
I know that giving the name of an output makes no sense, but them's the rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
""" | ||
Extracts the most interesting dataset from the a CSV file that we get from HERON. This CSV file includes optimized dispatchs that are calaculated at different years and samples. | ||
@ In, dispatch_print, str, a csv file produced by HERON and includes optimized components' time-dependent variables at different years, different samples | ||
@ Out, interesting dataset, pandas.core.frame.DataFrame, time-dependent optimized variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the methods in this file also need docstrings indented within the triple quotes 1 more level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
[./OptimizedDispatch_FromHERON2HYBRID] | ||
type = RavenPython | ||
input = 'export2Hybrid.py heron_input.xml dispatch_print.csv' | ||
[../] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this missing the test to create the dispatch_print.csv?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test to create dispatch_print.csv
Thank you, Paul, for you comments. Let me know if I need to make more changes. I know that I still need to add this work to the user manual. I will send another message after I do it. |
[./createUserInput] | ||
type = RavenPython | ||
input = 'create_user_input.py heron_input.xml Debug_Run_o/dispatch_print.csv' | ||
[./dispatches2Hybrid] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does nesting these work? I've never tried that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it only ran the one test:
...
(16/32) Success( 11.24sec)/home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/var_demand_fix_price/VarDemandFixPrice
(17/32) Success( 11.86sec)/home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/var_demand_var_price/VarDemandVarPrice
(18/32) Success( 11.39sec)/home/civet/civet/build_0/HERON/tests/integration_tests/mechanics/optimizedDispatch2Hybrid/DebugMode
(19/32) Success( 3.74sec)/home/civet/civet/build_0/HERON/tests/integration_tests/workflows/MOPED/consumption/Moped_consumption
(20/32) Success( 20.24sec)/home/civet/civet/build_0/HERON/tests/integration_tests/workflows/MOPED/simple/Moped_simple
(21/32) Success( 3.57sec)/home/civet/civet/build_0/HERON/tests/integration_tests/workflows/MOPED/storage/Moped_storage
...
I think you want to separate the tests, and set up prerequisites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I thought that nesting the tests sets up the prerequisites and since I did not get any error messages, I thought that the RavenPython tests are successful. Now, I set up the prerequisites and I think all the tests are run now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I don't see the user manual changes, but I do see the readme. Do you still have user manual changes coming? |
Pull Request Description
What issue does this change request address?
Issue #201 : Using HERON OptimizedDispatch in HYBRID
What are the significant changes in functionality due to this change request?
HERON-HYBRID Integration
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.