Commit 4e922683 authored by René Fritze's avatar René Fritze
Browse files

[test|fixtures] make domain bounds strategy private

parent 0ab99387
Pipeline #150390 passed with stages
in 30 minutes and 1 second
......@@ -14,7 +14,7 @@ from pymor.discretizers.builtin.grids.tria import TriaGrid
from pymor.discretizers.builtin.grids.unstructured import UnstructuredTriangleGrid
def hy_domain_bounds(draw, grid_type):
def _hy_domain_bounds(draw, grid_type):
# domain points are limited to allow their norm2 computations
max_val = grid_type.MAX_DOMAIN_WIDTH / 2
min_val = -grid_type.MAX_DOMAIN_WIDTH / 2
......@@ -31,7 +31,7 @@ def hy_domain_bounds(draw, grid_type):
return ll, rr
def hy_rect_tria_kwargs(draw, grid_type):
def _hy_rect_tria_kwargs(draw, grid_type):
identify_left_right = draw(hyst.booleans())
identify_bottom_top = draw(hyst.booleans())
interval_i = hyst.integers(min_value=1, max_value=42)
......@@ -40,19 +40,19 @@ def hy_rect_tria_kwargs(draw, grid_type):
num_intervals = draw(hyst.tuples(interval_i.map(lambda x: x if not identify_left_right else max(2, x)),
interval_i.map(lambda y: y if not identify_bottom_top else max(2, y))))
domain = hy_domain_bounds(draw, grid_type=grid_type)
domain = _hy_domain_bounds(draw, grid_type=grid_type)
return {"num_intervals": num_intervals, "domain": domain, "identify_left_right": identify_left_right,
"identify_bottom_top": identify_bottom_top}
@hyst.composite
def hy_rect_grid(draw):
return RectGrid(**hy_rect_tria_kwargs(draw, RectGrid))
return RectGrid(**_hy_rect_tria_kwargs(draw, RectGrid))
@hyst.composite
def hy_tria_grid(draw):
return TriaGrid(**hy_rect_tria_kwargs(draw, TriaGrid))
return TriaGrid(**_hy_rect_tria_kwargs(draw, TriaGrid))
@hyst.composite
......@@ -60,7 +60,7 @@ def hy_oned_grid(draw):
identify_left_right = draw(hyst.booleans())
interval_i = hyst.integers(min_value=1, max_value=10000)
num_intervals = draw(interval_i.filter(lambda x: (not identify_left_right) or x > 1))
domain = hy_domain_bounds(draw, grid_type=OnedGrid)
domain = _hy_domain_bounds(draw, grid_type=OnedGrid)
return OnedGrid(num_intervals=num_intervals, domain=[domain[0][0], domain[1][0]],
identify_left_right=identify_left_right)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment