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

remove _backend layer - match gustaf's #171 #311

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions splinepy/helpme/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,7 @@ def parametric_view(spline, axes=True, conform=False):

# take shallow copy
para_spline.spline_data._saved = spline.spline_data._saved.copy()
para_spline.show_options._options[
para_spline._show_options._backend
] = spline.show_options._options[spline._show_options._backend].copy()
para_spline.show_options._options = spline.show_options._options.copy()

if axes and "axes" in spline.show_options.valid_keys():
# configure axes
Expand Down
14 changes: 3 additions & 11 deletions splinepy/helpme/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"knot_lw",
"Line width of knots. Number of pixels. "
"Applicable to para_dim > 1.",
(int),
(float, float),
),
_options.Option(
"vedo",
Expand Down Expand Up @@ -70,7 +70,7 @@
"vedo",
"control_mesh_lw",
"Line width of control mesh. Number of pixels",
(int),
(float, int),
),
_options.Option(
"vedo",
Expand Down Expand Up @@ -123,8 +123,6 @@ def __init__(self, helpee):
f"Given helpee is {type(helpee)}.",
)
self._options = {}
self._backend = _gus.settings.VISUALIZATION_BACKEND
self._options[self._backend] = {}


class MultipatchShowOption(_options.ShowOption):
Expand Down Expand Up @@ -157,12 +155,6 @@ def __init__(self, helpee):
f"Given helpee is {type(helpee)}.",
)
self._options = {}
self._backend = _gus.settings.VISUALIZATION_BACKEND
self._options[self._backend] = {}


def make_showable(spline):
return eval(f"_{spline.show_options._backend}_showable(spline)")


def _sample_knots_1d(spline):
Expand Down Expand Up @@ -456,7 +448,7 @@ def _create_fitting_queries(spline):
return fqs


def _vedo_showable(spline):
def make_showable(spline):
"""
Goes through common procedures for preparing showable splines.

Expand Down
Loading