Closed RHammond2 closed 1 year ago
Hi Rob, yes. I've just made a pull request for the Cubico Projects, which uses a "quick fix," but I think what you've done will work for me. Thanks, Charlie
Patch coverage: 85.10
% and project coverage change: +0.43
:tada:
Comparison is base (
91fe859
) 65.02% compared to head (4aa2dd2
) 65.46%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This pull request implements custom constructors for the analysis classes MonteCarloAEP, EYAGapAnalysis, ElectricalLosses, TurbineLongTermGrossEnergy, and WakeLosses and attaches them as attributes of the PlantData class dynamically using setattr in the init script of the OpenOA module.
I found that the correct docstrings and function signatures can be accessed for a PlantData object in Jupyter Nobteook through the Shift-Tab shortcut. The Control-Space shortcut doesn't work in VSCode's Jupyter Notebook extension. Additionally, the docs are not visible when developing code statically (e.g., in a script, outside of Jupyter).
I think this pull request can be merged as-is, but we must be aware of these limitations.
This PR attaches the analysis classes to
PlantData
at the time of import, maintaining the same behavior as a standalone analysis class import. For example, the following two import patters produce the same results when used in an analysis.This PR also closes #216. @charlie9578 does the proposed solution seem to align with the expectations from our conversation?
@jordanperr, let me know if the implemented pattern works for you. It turns out it was a little more tricky than I originally showed you, but I think it still works nicely because the
openoa
namespace stays highly limited now as wellThis should be a fairly straightforward review with the demonstrated pattern implemented in the updated 05 example notebook