Skip to content

Conversation

@Matthew-Boyd
Copy link
Collaborator

Enables custom detailed PV layout models for both the detailed (pvsamv1) and simple (pvwattsv8) technology models.

@Matthew-Boyd Matthew-Boyd added the enhancement New feature or request label Feb 28, 2023
@Matthew-Boyd Matthew-Boyd self-assigned this Feb 28, 2023
@Matthew-Boyd
Copy link
Collaborator Author

@dguittet

  • should detailed_pv_layout.py and detailed_pv_config.py be developed more before merging into master?
  • or should they maybe be located somewhere else, like in /examples?

@dguittet
Copy link
Collaborator

dguittet commented Mar 1, 2023

@Matthew-Boyd Apologies for the delay. Looking at this now. I don't think detailed_pv_layout.py and detailed_pv_config.py were intended to be merged into main HOPP since they're not complete. Do you think it makes sense to not include them in the main HOPP or would something be lacking? Examples could be a good idea, but I think it would need to be more functional / complete.

Copy link
Collaborator

@dguittet dguittet left a comment

Choose a reason for hiding this comment

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

I'm really liking the capability to pass in instantiated component classes like layout.



def get_module_attribs(pvsam_model: pv.Pvsamv1) -> dict:
def get_module_attribs(pvsam_model: pv_detailed.Pvsamv1) -> dict:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be really nice to have a docstring here linking to the attributes in the PySAM documentation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

'I_mp_ref': I_mp,
'I_sc_ref': I_sc,
'P_mp_ref': P_mp,
'P_mp_ref': P_mp * 1e-3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you add units to these key-value pairs too as you did below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

"""
if type(self.parameters) == PVGridParameters:
self.reset_solargrid(size_kw, self.parameters)
if type(self.parameters) == PVGridParameters or "DetailedPVParameters" in str(type(self.parameters)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

If someone named their parameters differently, then this code wouldn't be flexible enough to handle it. I think we should throw an error to stave off confusion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure now why I even needed to accommodate the DetailedPVParameters type, so I just removed it. I think the tests will pass, we'll see.

@Matthew-Boyd
Copy link
Collaborator Author

@Matthew-Boyd Apologies for the delay. Looking at this now. I don't think detailed_pv_layout.py and detailed_pv_config.py were intended to be merged into main HOPP since they're not complete. Do you think it makes sense to not include them in the main HOPP or would something be lacking? Examples could be a good idea, but I think it would need to be more functional / complete.

@dguittet No worries, I got to catch up on other work. I'm content putting them into examples as-is now, and let Engie use this right away. Maybe they would offer comments or a PR during their testing and implementation? I'd rather not let the changes in this PR languish, however, so if you thought it best to develop those two files more, maybe we can still merge the rest? (I would have to remove the affected tests, though.)

@dguittet
Copy link
Collaborator

dguittet commented Mar 3, 2023

@Matthew-Boyd Thanks I've moved the detailed layout files into the examples folder

@Matthew-Boyd
Copy link
Collaborator Author

@dguittet Good to merge?

@Matthew-Boyd Matthew-Boyd merged commit 1fb1e5d into master Mar 6, 2023
@Matthew-Boyd Matthew-Boyd deleted the custom_layout_models branch March 6, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants