Repository navigation
Removed system_model attribute from wind and solar PySAM models - #909
Merged
Merged
Conversation
johnjasa
approved these changes
Oct 8, 2026
johnjasa
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this, Elenya! I like the simplification and test addition. I did some more cleanup in the setup() methods to remove unnecessary instantiation of the models. Will approve and merge now!
johnjasa
enabled auto-merge
October 8, 2026 03:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed
system_modelattribute from wind and solar PySAM modelsBoth the pysam wind and pysam solar models were using an attribute
self.system_modelto simulate performance, this attribute used to be instantiated insetup()and was only modified incompute(). This means that any modifications toself.system_modelduring subsequent calls tocompute()could result in different performance than ifcompute()was only called once, depending on how the object has been modified. I am not sure that either code did meaningfully modify thesystem_modelattribute in a way that would result in this behavior, but this at least prevents that possibility.Also! Updated the
recalculate_power_curve()to have "success" based on a tolerance rather than an exact==.Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
post_process()method in the pysam wind model based on recent changesType of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
post_process()method in the pysam wind model? Or should I set class attributes to be the turbine x/y positions in the pysam wind model (those attributes would only be used by post-process ... which feels silly)Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Section 5: Impacted Areas of the Software
Section 5.1: New Files
None
Section 5.2: Modified Files
h2integrate/converters/wind/wind_pysam.pyrecalculate_power_curve(): addedsystem_modelas an inputsetup(): removed creation ofsystem_modelattributecompute(): updated to makesystem_modelobjecth2integrate/converters/solar/solar_pysam.pyget_initial_angle_value(): addedsystem_modelas an inputsetup(): removed creation ofsystem_modelattributecompute(): updated to makesystem_modelobjectSection 6: Additional Supporting Information
Section 7: Test Results, if applicable