NREL / flasc

A rich floris-driven suite for SCADA analysis
https://nrel.github.io/flasc/
BSD 3-Clause "New" or "Revised" License
32 stars 18 forks source link

set observed to false #225

Closed paulf81 closed 1 month ago

paulf81 commented 1 month ago

The previous pull request #223 assumed the observed keyword would not have an effect on the computation, and so went for the incoming pandas default value of True, based on my read of: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.groupby.html

However, this really did change the behavior, which I now understand is because of the preceding cut line:

        ws_bin_cuts_subset = [
            pd.cut(df[f"ws_{ti:03d}"], bins=self._pw_curve_ws_bins) for ti in turbine_subset
        ]

ws is a categorical in this context. Therefore reverting back to the current default value made explicit by setting observed=False