You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sir, I have faced an error while trying to plot histograms for AEP using GAM Model (02c_augmented_aep_analysis). In the plant data for the availability, I have taken negative availability as 'Zero' and left everything as it is for positive availability. If the availability loss is positive at the negative net energy timestamps, then the error occurs while generating GAM AEP histograms. If availability loss is zero for negative net energy timestamps, the error disappears. Does using zero availability loss at negative net energy impact the results? Or is it the condition that availability loss should be zero when net energy is negative?
I have attached error for your reference. Thak you!
ValueErrorTraceback (mostrecentcalllast)
CellIn[50], line21# Plot a distribution of AEP values from the Monte-Carlo OA method - gam model---->2aep_gam.plot_result_aep_distributions()
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\analysis\aep.py:1456, inMonteCarloAEP.plot_result_aep_distributions(self, xlim_aep, xlim_availability, xlim_curtail, ylim_aep, ylim_availability, ylim_curtail, return_fig, figure_kwargs, plot_kwargs, annotate_kwargs)
1454plot_results=self.results.copy()
1455plot_results[["avail_pct", "curt_pct"]] =plot_results[["avail_pct", "curt_pct"]] *100->1456returnplot.plot_distributions(
1457data=plot_results,
1458which=["aep_GWh", "avail_pct", "curt_pct"],
1459xlabels=["AEP (GWh/yr)", "Availability Loss (%)", "Curtailment Loss (%)"],
1460xlim=(xlim_aep, xlim_availability, xlim_curtail),
1461ylim=(ylim_aep, ylim_availability, ylim_curtail),
1462return_fig=return_fig,
1463figure_kwargs=figure_kwargs,
1464plot_kwargs=plot_kwargs,
1465annotate_kwargs=annotate_kwargs,
1466 )
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\openoa\utils\plot.py:726, inplot_distributions(data, which, xlabels, xlim, ylim, return_fig, figure_kwargs, plot_kwargs, annotate_kwargs, title)
724vals=data[col].values725u_vals=vals.mean()
-->726ax.hist(vals, 40, density=1, **plot_kwargs)
727ax.annotate(
728f"Mean = {u_vals:.1f}",
729 (0.05, 0.9),
730xycoords="axes fraction",
731**annotate_kwargs,
732 )
733uncertainty= (vals.std() /u_vals) ifu_vals!=0.0else0.0File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\matplotlib\__init__.py:1478, in_preprocess_data.<locals>.inner(ax, data, *args, **kwargs)
1475 @functools.wraps(func)
1476definner(ax, *args, data=None, **kwargs):
1477ifdataisNone:
->1478returnfunc(ax, *map(sanitize_sequence, args), **kwargs)
1480bound=new_sig.bind(ax, *args, **kwargs)
1481auto_label= (bound.arguments.get(label_namer)
1482orbound.kwargs.get(label_namer))
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\matplotlib\axes\_axes.py:6862, inAxes.hist(self, x, bins, range, density, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, **kwargs)
6858# Loop through datasets6859foriinrange(nx):
6860# this will automatically overwrite bins,6861# so that each histogram uses the same bins->6862m, bins=np.histogram(x[i], bins, weights=w[i], **hist_kwargs)
6863tops.append(m)
6864tops=np.array(tops, float) # causes problems later if it's an intFile~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\numpy\lib\histograms.py:780, inhistogram(a, bins, range, density, weights)
680r""" 681 Compute the histogram of a dataset. 682 (...) 776 777 """778a, weights=_ravel_and_check_weights(a, weights)
-->780bin_edges, uniform_bins=_get_bin_edges(a, bins, range, weights)
782# Histogram is an integer or a float array depending on the weights.783ifweightsisNone:
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\numpy\lib\histograms.py:426, in_get_bin_edges(a, bins, range, weights)
423ifn_equal_bins<1:
424raiseValueError('`bins` must be positive, when an integer')
-->426first_edge, last_edge=_get_outer_edges(a, range)
428elifnp.ndim(bins) ==1:
429bin_edges=np.asarray(bins)
File~\AppData\Local\anaconda3\envs\openoa-env\lib\site-packages\numpy\lib\histograms.py:315, in_get_outer_edges(a, range)
312raiseValueError(
313'max must be larger than min in range parameter.')
314ifnot (np.isfinite(first_edge) andnp.isfinite(last_edge)):
-->315raiseValueError(
316"supplied range of [{}, {}] is not finite".format(first_edge, last_edge))
317elifa.size==0:
318# handle empty arrays. Can't determine range, so use 0-1.319first_edge, last_edge=0, 1ValueError: suppliedrangeof [-inf, -inf] isnotfinite
The text was updated successfully, but these errors were encountered:
Hi @ajayxcel I would need to see the values being passed to the histogram method as it appears some of the results themselves are invalid data. Do you have more information to replicate this error?
Hi Sir, I have faced an error while trying to plot histograms for AEP using GAM Model (02c_augmented_aep_analysis). In the plant data for the availability, I have taken negative availability as 'Zero' and left everything as it is for positive availability. If the availability loss is positive at the negative net energy timestamps, then the error occurs while generating GAM AEP histograms. If availability loss is zero for negative net energy timestamps, the error disappears. Does using zero availability loss at negative net energy impact the results? Or is it the condition that availability loss should be zero when net energy is negative?
I have attached error for your reference. Thak you!
The text was updated successfully, but these errors were encountered: