Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Analysis Class API #252

Merged
merged 50 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b01df55
add init parameters to run for aep
RHammond2 Aug 3, 2023
2bc9946
handle None in rean prod and fix deprecation warning for 1-value series
RHammond2 Aug 4, 2023
5d7987c
update run docstring for new parameters and adjust ordering for class…
RHammond2 Aug 4, 2023
04bd5de
update changelog
RHammond2 Aug 4, 2023
c3d9fbf
support analysis schema variations
RHammond2 Aug 4, 2023
1bac74b
update changelog
RHammond2 Aug 4, 2023
4a849e4
fix issue with renamed naming convention and drop aep.
RHammond2 Aug 4, 2023
f612e69
update wording of docstring
RHammond2 Aug 6, 2023
4a4de26
update electrical losses with new analysis API framework
RHammond2 Aug 6, 2023
7b5f993
fix control flow bug to get tests passing
RHammond2 Aug 6, 2023
b3d55c5
update naming convention for half-closed range validators
RHammond2 Aug 6, 2023
6faa687
fix spacing and docstring
RHammond2 Aug 6, 2023
669f11c
update renalysis product naming and convert to new analysis API
RHammond2 Aug 6, 2023
5f85ea6
fix merge conflict
RHammond2 Aug 6, 2023
e47b152
update wake analysis to new API and attribute naming conventions
RHammond2 Aug 6, 2023
adccd04
fix issues with wake losses not actually running bc of bad variable r…
RHammond2 Aug 8, 2023
1f9ad8c
fix typos
RHammond2 Aug 8, 2023
a962d31
update wake losses to ensure the correct values are being tested comp…
RHammond2 Aug 8, 2023
683df38
remove print statements
RHammond2 Aug 8, 2023
bd47a8c
update typing
RHammond2 Sep 1, 2023
e49fb9e
update docstring
RHammond2 Sep 1, 2023
d51afb3
fix typos
RHammond2 Sep 1, 2023
36ff84b
fix other typos
RHammond2 Sep 1, 2023
b96c140
fix issue with range definition in docstring
RHammond2 Sep 1, 2023
c8ea2f3
simplify control flow
RHammond2 Sep 1, 2023
bbed25c
fix bug in half-closed copypasta
RHammond2 Sep 1, 2023
8f74ae5
fix merge conflicts
RHammond2 Sep 2, 2023
9bf1825
use base data for tests every time
RHammond2 Sep 22, 2023
2066265
update plantdata validations
RHammond2 Sep 22, 2023
255ddb3
add new analysis classes and non-base cases into the schematics
RHammond2 Sep 22, 2023
219921a
update schema files for new settings
RHammond2 Sep 22, 2023
7098619
convert the yaw misalignment to the new api
RHammond2 Sep 22, 2023
4c56e1e
add missing connectors for static yaw misalignment
RHammond2 Sep 22, 2023
30b963a
add attrs validator for PlantData and convert reanalysis check to sin…
RHammond2 Sep 25, 2023
c3549f7
Merge branch 'develop_v3' into enhancement/analysis_api
RHammond2 Sep 25, 2023
00de16c
update the analysis requirements process for WakeLosses
RHammond2 Sep 25, 2023
e61a56d
update valid tower test
RHammond2 Sep 25, 2023
ab171bd
update TowerMetaData.col_map to reflect changes
RHammond2 Sep 25, 2023
820d027
ensure the original plantdata object is not modified on analysis crea…
RHammond2 Sep 25, 2023
d400c63
update analysis requirements to reflect actual uses
RHammond2 Sep 25, 2023
015f017
remove extra space
RHammond2 Sep 25, 2023
0359601
update the schemas and reference guide
RHammond2 Sep 26, 2023
18e3105
update changelog with more details on new analysis api
RHammond2 Sep 26, 2023
8c163c2
sunset 'M' for 'MS' due to lack of pandas support
RHammond2 Sep 26, 2023
57af10b
remove unused function
RHammond2 Sep 26, 2023
c50365c
update Cubico for changes in OpenOA schema
RHammond2 Sep 26, 2023
42d90c2
rerun example notebooks
RHammond2 Sep 26, 2023
cefee1c
update examples in the documentation
RHammond2 Sep 26, 2023
7de60a8
udpate schema files and tests for removed 'M' in place of 'MS'
RHammond2 Sep 27, 2023
f426744
default to using full data pipeline instead pre-cleansed data
RHammond2 Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,51 @@ All notable changes to this project will be documented in this file. If you make
- `utils.filters.bin_filter` was converted from a for loop to a vectorized method
- `utils.filters.bin_filter` and `utils.timeseries.percent_nan` were converted to be nearly pure NumPy methods operating on NumPy arrays for significant speedups of the TIE analysis method.
- `analysis.TurbineLongTermGrossEnergy.filter_turbine_data` was cleaned up for a minor gain in efficiency and readability.
- Analysis class API redesign
- Analysis classes can be created from a `PlantData` object, like the following:

```python
from openoa import PlantData

project = PlantData("""your kwargs""")
aep = project.MonteCarloAEP("""your analysis settings""")
```

- A deep copy of the original `PlantData` object is now stored in the analysis class so that the project data is stable between uses, allowing more flexibility for users running a variety of analyses.
- All analysis inputs are able to be provided at the initialization or run level, allowing more flexibility for when analyses are designed and modified. Additionally, the analysis defaults are set at initialization, so settings are only changed between runs if the users specifies a change.
- The only settings that cannot be modified in an analysis run are those that change the underlying data settings, which will now require a new analysis method. See the following example:

```python
from openoa import PlantData

project = PlantData() # note: kwargs must actually be provided to create a PlantData object

# Use and validate of the SCADA temperature data
aep = project.MonteCarloAEP(reg_temperature=True)

# No longer allowed because this adds a new wind direction data requirement, which may
# not have been validated
aep.run(reg_wind_direction=True)

# New method for running variations on the underlying data, which do not modify the original
# project data in any way
aep_temp = project.MonteCarloAEP(reg_temperature=True)
aep_wd = project.MonteCarloAEP(reg_wind_direction=True)

# Compare your results
...
```

- Analysis requirements and minimum schema have been provided in the `openoa/schema` library. To review a dictionary of the minimal data requirements for an anaylsis, users may view the `ANALYSIS_REQUIREMENTS` found in `openoa/schema/metadata.py`, or be importing it and viewing as a dictionary `from openoa.schema.metadata import ANALYSIS_REQUIREMENTS`. Alternatively there is a simple landing page for analysis-specific schema files available in the [schema readme](openoa/schema/README.md)

- Better `__repr__` methods for `PlantData` and `PlantMetaData`.
- Printing a `PlantData` object now provides a high level statistical summary of each of the
datasets in `PlantData`, alongside other key variables.
- Printing a `PlantMetaData` object now shows the default or provided column mapping with the
associated expected dtypes and units, alongside other key variables.
- Creating a class will take all of the same parameters, moving all data validation parameters to the front of the arguments for each class, so check your class initializations when changing versions.
- `AnalysisClass.run()` now takes all of the same arguments as the class initialization, except for those that modify what data will be validated. For example, `MonteCarloAEP` has arguments `reg_temperature` and `reg_wind_direction`, which flag if additional columns should be present in the reanalysis data, therefore modifying the data validation requirements. As such, they will not be able to updated in `run()`, and a new analysis class instance will need to be created.
- `reanalysis_subset` is being replaced with `reanalysis_products` in all cases to use a consistent naming convention across classes.

### Deprecations

Expand Down
32 changes: 16 additions & 16 deletions examples/00_intro_to_plant_data.ipynb

Large diffs are not rendered by default.

1,947 changes: 973 additions & 974 deletions examples/01_utils_examples.ipynb

Large diffs are not rendered by default.

1,993 changes: 997 additions & 996 deletions examples/02a_plant_aep_analysis.ipynb

Large diffs are not rendered by default.

2,450 changes: 1,222 additions & 1,228 deletions examples/02b_plant_aep_analysis_cubico.ipynb

Large diffs are not rendered by default.

Loading
Loading