NREL / OpenOA

This library provides a framework for assessing wind plant performance using operational assessment (OA) methodologies that consume time series data from wind plants. The goal of the project is to provide an open source implementation of common data structures, analysis methods, and utility functions relevant to wind plant OA.
https://openoa.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
194 stars 63 forks source link

Programmatically generate requirements for analysis #229

Closed jordanperr closed 1 year ago

jordanperr commented 1 year ago

We would like to be able to use the analysis_requirements to generate a query for the ENTR warehouse. This works now if you're only using required columns, but becomes tricky when you want to use optional columns. The problem is that the use of optional columns are dictated by the arguments provided to the analysis, and these may not be known at the time the PlantData is created. I propose adding an "Analysis.generate_schema()" method to analysis classes, which generates the requirements dictionary on-the-fly, based on the arguments provided to init.

Old Workflow:

plant = PlantData.from_entr("La Haute Borne", analysis_type="MonteCarloAEP")
pa = MonteCarloAEP(plant, arg1="foo", arg2="bar")
pa.run(arg3="baz")

Proposed Workflow:

pa = MonteCarloAEP(arg1="foo", arg2="bar")
plant = PlantData.from_entr("La Haute Borne", schema=pa.get_schema())
pa.run(plant, arg3="baz").
RHammond2 commented 1 year ago

As discussed in #255, this needs more details to be a workable request, and should be reconsidered at a later time.