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
Calling eprh.hfss_report_full_convergence sometimes results in ValueError: Data has no positive values, and therefore can not be log-scaled.
In this case, the simulations did not converge into tight criterion, but behaved normally
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
InputIn [14], in<cellline: 1>()
---->1eprh.hfss_report_full_convergence()
Filec:\users\iqm\pyepr\pyEPR\core_distributed_analysis.py:1637, inDistributedAnalysis.hfss_report_full_convergence(self, fig, _display)
1633plot_convergence_solved_elem(ax0t, convergence_t.iloc[:, 0])
1634plot_convergence_maxdf_vs_sol(axs[2], convergence_t.iloc[:, 1],
1635convergence_t.iloc[:, 0])
->1637fig.tight_layout(w_pad=0.1) # pad=0.0, w_pad=0.1, h_pad=1.0)1639if_display:
1640fromIPython.displayimportdisplayFile~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\figure.py:3197, inFigure.tight_layout(self, pad, h_pad, w_pad, rect)
3195renderer=_get_renderer(self)
3196withgetattr(renderer, "_draw_disabled", nullcontext)():
->3197kwargs=get_tight_layout_figure(
3198self, self.axes, subplotspec_list, renderer,
3199pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
3200ifkwargs:
3201self.subplots_adjust(**kwargs)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\tight_layout.py:320, inget_tight_layout_figure(fig, axes_list, subplotspec_list, renderer, pad, h_pad, w_pad, rect)
315return {}
316span_pairs.append((
317slice(ss.rowspan.start*div_row, ss.rowspan.stop*div_row),
318slice(ss.colspan.start*div_col, ss.colspan.stop*div_col)))
-->320kwargs=_auto_adjust_subplotpars(fig, renderer,
321shape=(max_nrows, max_ncols),
322span_pairs=span_pairs,
323subplot_list=subplot_list,
324ax_bbox_list=ax_bbox_list,
325pad=pad, h_pad=h_pad, w_pad=w_pad)
327# kwargs can be none if tight_layout fails...328ifrectisnotNoneandkwargsisnotNone:
329# if rect is given, the whole subplots area (including330# labels) will fit into the rect instead of the
(...)
334# auto_adjust_subplotpars twice, where the second run335# with adjusted rect parameters.File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\tight_layout.py:82, in_auto_adjust_subplotpars(fig, renderer, shape, span_pairs, subplot_list, ax_bbox_list, pad, h_pad, w_pad, rect)
80ifax.get_visible():
81try:
--->82bb+= [ax.get_tightbbox(renderer, for_layout_only=True)]
83exceptTypeError:
84bb+= [ax.get_tightbbox(renderer)]
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axes\_base.py:4628, in_AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4626ifself.yaxis.get_visible():
4627try:
->4628bb_yaxis=self.yaxis.get_tightbbox(
4629renderer, for_layout_only=for_layout_only)
4630exceptTypeError:
4631# in case downstream library has redefined axis:4632bb_yaxis=self.yaxis.get_tightbbox(renderer)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1103, inAxis.get_tightbbox(self, renderer, for_layout_only)
1100ifnotself.get_visible():
1101return->1103ticks_to_draw=self._update_ticks()
1105self._update_label_position(renderer)
1107# go back to just this axis's tick labelsFile~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1045, inAxis._update_ticks(self)
1040def_update_ticks(self):
1041""" 1042 Update ticks (position and labels) using the current data interval of 1043 the axes. Return the list of ticks that will be drawn. 1044 """->1045major_locs=self.get_majorticklocs()
1046major_labels=self.major.formatter.format_ticks(major_locs)
1047major_ticks=self.get_major_ticks(len(major_locs))
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1277, inAxis.get_majorticklocs(self)
1275defget_majorticklocs(self):
1276"""Return this Axis' major tick locations in data coordinates."""->1277returnself.major.locator()
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\ticker.py:2292, inLogLocator.__call__(self)
2290"""Return the locations of the ticks."""2291vmin, vmax=self.axis.get_view_interval()
->2292returnself.tick_values(vmin, vmax)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\ticker.py:2317, inLogLocator.tick_values(self, vmin, vmax)
2314vmin=self.axis.get_minpos()
2316ifvmin<=0.0ornotnp.isfinite(vmin):
->2317raiseValueError(
2318"Data has no positive values, and therefore can not be "2319"log-scaled.")
2321_log.debug('vmin %s vmax %s', vmin, vmax)
2323ifvmax<vmin:
ValueError: Datahasnopositivevalues, andthereforecannotbelog-scaled.
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib_inline\backend_inline.py:43, inshow(close, block)
39try:
40forfigure_managerinGcf.get_all_fig_managers():
41display(
42figure_manager.canvas.figure,
--->43metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
44 )
45finally:
46show._to_draw= []
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib_inline\backend_inline.py:231, in_fetch_figure_metadata(fig)
228# determine if a background is needed for legibility229if_is_transparent(fig.get_facecolor()):
230# the background is transparent-->231ticksLight=_is_light([label.get_color()
232foraxesinfig.axes233foraxisin (axes.xaxis, axes.yaxis)
234forlabelinaxis.get_ticklabels()])
235ifticksLight.sizeand (ticksLight==ticksLight[0]).all():
236# there are one or more tick labels, all with the same lightness237return {'needs_background': 'dark'ifticksLight[0] else'light'}
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib_inline\backend_inline.py:234, in<listcomp>(.0)
228# determine if a background is needed for legibility229if_is_transparent(fig.get_facecolor()):
230# the background is transparent231ticksLight=_is_light([label.get_color()
232foraxesinfig.axes233foraxisin (axes.xaxis, axes.yaxis)
-->234forlabelinaxis.get_ticklabels()])
235ifticksLight.sizeand (ticksLight==ticksLight[0]).all():
236# there are one or more tick labels, all with the same lightness237return {'needs_background': 'dark'ifticksLight[0] else'light'}
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1249, inAxis.get_ticklabels(self, minor, which)
1247ifminor:
1248returnself.get_minorticklabels()
->1249returnself.get_majorticklabels()
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1201, inAxis.get_majorticklabels(self)
1199defget_majorticklabels(self):
1200"""Return this Axis' major tick labels, as a list of `~.text.Text`."""->1201ticks=self.get_major_ticks()
1202labels1= [tick.label1fortickinticksiftick.label1.get_visible()]
1203labels2= [tick.label2fortickinticksiftick.label2.get_visible()]
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1371, inAxis.get_major_ticks(self, numticks)
1369r"""Return the list of major `.Tick`\s."""1370ifnumticksisNone:
->1371numticks=len(self.get_majorticklocs())
1373whilelen(self.majorTicks) <numticks:
1374# Update the new tick label properties from the old.1375tick=self._get_tick(major=True)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\axis.py:1277, inAxis.get_majorticklocs(self)
1275defget_majorticklocs(self):
1276"""Return this Axis' major tick locations in data coordinates."""->1277returnself.major.locator()
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\ticker.py:2292, inLogLocator.__call__(self)
2290"""Return the locations of the ticks."""2291vmin, vmax=self.axis.get_view_interval()
->2292returnself.tick_values(vmin, vmax)
File~\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\ticker.py:2317, inLogLocator.tick_values(self, vmin, vmax)
2314vmin=self.axis.get_minpos()
2316ifvmin<=0.0ornotnp.isfinite(vmin):
->2317raiseValueError(
2318"Data has no positive values, and therefore can not be "2319"log-scaled.")
2321_log.debug('vmin %s vmax %s', vmin, vmax)
2323ifvmax<vmin:
ValueError: Datahasnopositivevalues, andthereforecannotbelog-scaled.
The text was updated successfully, but these errors were encountered:
Calling
eprh.hfss_report_full_convergence
sometimes results in ValueError: Data has no positive values, and therefore can not be log-scaled.In this case, the simulations did not converge into tight criterion, but behaved normally
The text was updated successfully, but these errors were encountered: