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

[TI.by_speed] is not working with Pandas v.1.3.3 and above #317

Closed
BiancaMorandi opened this issue Jan 14, 2022 · 5 comments
Closed

[TI.by_speed] is not working with Pandas v.1.3.3 and above #317

BiancaMorandi opened this issue Jan 14, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@BiancaMorandi
Copy link
Contributor

BiancaMorandi commented Jan 14, 2022

bw.TI.by_speed(DATA[['Spd80mN']], DATA[['Spd80mNStd']]) is raising an error with Pandas v.1.3.3 and above. This error is due to an update of pandas.DataFrame.agg from Pandas v.1.3.3. see https://pandas.pydata.org/pandas-docs/stable/whatsnew/v1.3.3.html

This update is generating an error when deriving pandas.DataFrame.agg(lambda x: np.percentile(x, q=percentile)). The error is generated for dist(var_series=ti['Turbulence_Intensity'], var_to_bin_against=ti['wspd'], bins=speed_bin_array, bin_labels=speed_bin_labels, aggregation_method=lambda x: np.percentile(x, q=percentile), return_data=True)[-1].rename("Rep_TI")

when called inside TI.by_speed

@BiancaMorandi BiancaMorandi added the bug Something isn't working label Jan 14, 2022
@BiancaMorandi BiancaMorandi self-assigned this Jan 14, 2022
@BiancaMorandi BiancaMorandi added this to Backlog in brightwind kanban Feb 8, 2022
@BiancaMorandi BiancaMorandi moved this from Backlog to To do in brightwind kanban Mar 1, 2022
@BiancaMorandi BiancaMorandi moved this from To do to Backlog in brightwind kanban Mar 1, 2022
@BiancaMorandi BiancaMorandi moved this from Backlog to To do in brightwind kanban Jul 12, 2022
@BiancaMorandi BiancaMorandi moved this from To do to In progress in brightwind kanban Jul 18, 2022
@BiancaMorandi
Copy link
Contributor Author

BiancaMorandi commented Jul 25, 2022

additional error raised with numpy==1.23.1 and pandas==0.25.3 (or 1.4.3 ??)

image
image
image

@BiancaMorandi
Copy link
Contributor Author

additional error raised for
image

image

image

@BiancaMorandi
Copy link
Contributor Author

BiancaMorandi commented Sep 22, 2022

while looking at this issue a bug was found for the TI.by_speed and TI.by_sector functions when bin_labels are given as input.

Figure below shows that if speed_bin_labels is given as input then TI.by_speed is not showing the Mean_TI and Rep_TI curves in the plot.

image

for TI.by_sector if direction_bin_labels is given as input then an error is raised because plot cannot be generated.

@BiancaMorandi
Copy link
Contributor Author

As part of the debugging of this issue it was observed that:

  • turbulence intensity is derived for both TI.by_speed and TI.by_sector for speed > and not >= of 3 m/s. This bug is now fixed.
  • the min_speed input given to TI.by_sector was actually not applied to the TI calculation. This bug is now fixed

BiancaMorandi added a commit that referenced this issue Sep 23, 2022
BiancaMorandi added a commit that referenced this issue Sep 23, 2022
BiancaMorandi added a commit that referenced this issue Sep 23, 2022
@BiancaMorandi
Copy link
Contributor Author

the TI.by_speed function can accept IEC_class inputs as DataFrame but if this doesn't contain three 4 columns (windspeed+ three classes) then TI.by_speed function raises and error. This bug is now fixed.

BiancaMorandi added a commit that referenced this issue Sep 23, 2022
BiancaMorandi added a commit that referenced this issue Sep 23, 2022
@BiancaMorandi BiancaMorandi moved this from In progress to Awaiting Approval in brightwind kanban Sep 23, 2022
@stephenholleran stephenholleran moved this from Awaiting Approval to Done in brightwind kanban Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants