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

Validation of reanalysis data is too limiting #216

Closed charlie9578 closed 1 year ago

charlie9578 commented 2 years ago

Hi,

I think the validator for the reanalysis datasets limits them specifically to those called "merra2", "ncep2", "erai" and "era5." I propose removing this requirement, as I wanted to add "era5_monthly" as a dataset, and I'm sure other people will have other datasets too, which might not have these names. In the end I used "erai" to avoid touching the aep.py file!

Thanks, Charlie

RHammond2 commented 2 years ago

Hi @charlie9578,

Thanks for the feedback, we noticed that this might not be the best way forward when working on the v3rc1 release, though we didn't change the current functionality in that release. Our initial thinking is to remove any hard limitations on what the naming convention is, and allow free-form input. Is this the type of solution you were thinking, or did you have something else in mind?

Best, Rob

charlie9578 commented 2 years ago

Hi Rob, yes, that's all I was thinking. Thanks, Charlie

charlie9578 commented 2 years ago

Hi,

For running "project_Cubico" I just made the following update to the reanalysis validator:

member_validator=attrs.validators.instance_of(str)

which means any name can then be used for the reanalysis data sets.

Thanks, Charlie

RHammond2 commented 2 years ago

Thanks, @charlie9578! While I think the approach in theory is nice, in practical terms it will fail when no reanalysis data is passed in because there isn't a conditional evaluation of attrs validators (something I've desired many times now). Currently I have just removed the validation stage of the dictionary keys, but am in search of something a bit more automated and elegant like your proposal above.