-
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
Resourcegraph #223
Resourcegraph #223
Conversation
@@ -154,13 +168,14 @@ def main(): | |||
sim.read_input(args.xml_input_file) # TODO expand to use arguments? | |||
# print details | |||
sim.print_me() | |||
sim.plot_resource_graph() |
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 might be fine initially, but I think this network graph should be something we do at the HERON compilation stage instead of during dispatch optimization. How hard would it be to move?
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 believe this is creating the plot during HERON compilation. If debug mode is enabled it will create the plot when running heron heron_input.xml
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.
Oh, you're right, I'm sorry. I saw sim.print_me()
and immediately thought of the pyomo model. I should have looked more closely! I'm still on travel but can review this tomorrow or Friday probably.
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 looks like a cool addition. The code looks good, I did have one comment on the function annotations. I think a test case is warranted for this change. A short blurb in the documentation about this new feature would be good too.
in a HERON system. | ||
""" | ||
|
||
def __init__(self, components: list) -> 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.
I see you added annotations to method definitions (-> and the like). It is PEP compliant (3107) and I think it adds some valuable information, especially to developers at a quick glance. I haven't seen these annotations elsewhere in HERON, should we standardize this practice going forward? What I mean is, should we include these annotations going forward or remove them? I would vote for including them.
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.
Yes, I agree. I like having the annotations and the more detailed we can be with them, the more easy our code would be to understand. Perhaps maybe a soft encouragement to use them going forward? We could easily add a pylint type checking test to our Precheck on CIVET if we wanted to make it a hard standard. @PaulTalbot-INL @joshua-cogliati-inl do you have any specific ideas or reservations about this?
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 am not ready to codify it as required practice, but I certainly am happy to see it added where possible. If forced into a decision, I would prefer to include them, but it will take time and opportunity to convert existing code to this standard. I would also like to re-think the RAVEN approach to docstrings at the same time, since this info is largely included in the type hints, but that represents a significant change for a lot of code, possibly.
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 am okay with optionally adding typing annotations. We should add checking them with mypy or pyright or similar before making them required.
@dgarrett622 are you available to finish the review of this PR? |
Pull Request Description
What issue does this change request address?
#163
What are the significant changes in functionality due to this change request?
This PR implements the ability to create a resource graph png during a debug mode run
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.