MCPcopy
hub / github.com/tum-pbs/PhiFlow / _get_range

Function _get_range

phi/vis/_matplotlib/_matplotlib_plots.py:196–206  ·  view source on GitHub ↗
(bounds: Box, index: int)

Source from the content-addressed store, hash-verified

194
195
196def _get_range(bounds: Box, index: int):
197 lower = float(bounds.lower.vector[index].min)
198 upper = float(bounds.upper.vector[index].max)
199 if not math.is_finite(lower) and not math.is_finite(upper):
200 lower = -.1
201 upper = .1
202 elif not math.is_finite(lower):
203 lower = upper - .1
204 elif not math.is_finite(upper):
205 upper = lower + .1
206 return lower if math.is_finite(lower) else None, upper if math.is_finite(upper) else None
207
208
209def _next_line_color(axes: Axes, kind: str = None, get_index=False):

Callers 1

create_figureMethod · 0.70

Calls 1

is_finiteMethod · 0.80

Tested by

no test coverage detected