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 concept from Options #171

Merged
merged 8 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
33 changes: 15 additions & 18 deletions docs/source/extra_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
if __name__ == "__main__":
here = os.path.dirname(os.path.abspath(__file__))

# here = pathlib.Path(__file__).parent.resolve()
# create md dir
md_path = os.path.abspath(os.path.join(here, "..", "md"))
# (here / "../md").resolve().mkdir(parents=True, exist_ok=True)
os.makedirs(md_path, exist_ok=True)

# 1. Show options.
Expand All @@ -25,19 +23,18 @@
derived = gus.helpers.options.ShowOption.__subclasses__()
for cls in derived:
f.write(f"## {cls.__qualname__}\n\n")
for backend, options in cls._valid_options.items():
f.write(f"### {backend}\n\n")
for option in options.values():
t_str = str(option.allowed_types)
t_str = (
t_str.replace("<class", "")
.replace("'", "")
.replace(">", "")
)
f.write(
f"<details><summary><strong>{option.key}"
"</strong></summary><p>\n"
)
f.write(f"\n{option.description} \n")
f.write(f"- _allowed types_: {t_str} \n")
f.write("</p></details> \n\n")
for option in cls._valid_options.values():
t_str = str(option.allowed_types)
t_str = (
t_str.replace("<class", "")
.replace("'", "")
.replace(">", "")
)
f.write(
f"<details><summary><strong>{option.key}"
"</strong></summary><p>\n"
)
f.write(f"\n{option.description} \n")
f.write(f"- _allowed types_: {t_str} \n")
f.write(f"- _default_: {option.default} \n")
f.write("</p></details> \n\n")
2 changes: 1 addition & 1 deletion examples/create_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main():
backslash=True,
)

gus.show.show_vedo(
gus.show(
["faces-box", mesh_faces_box],
["volumes-box", mesh_volumes_box],
["faces-triangle", mesh_faces_triangle],
Expand Down
2 changes: 1 addition & 1 deletion examples/mixd_to_nutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main():
)
mesh_npz = gus.io.nutils.load("export/export_npz.npz")

gus.show.show_vedo(
gus.show(
["gustaf-mesh", mesh],
["mixd-mesh", mesh_mixd],
["npz-mesh", mesh_npz],
Expand Down
2 changes: 1 addition & 1 deletion examples/shrink_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
direct_toedges.show_options["as_arrows"] = True

# not the most efficient way, but it is possible.
gus.show.show_vedo(
gus.show(
["v, Volumes", v],
["v.shrink()", v.shrink()],
[
Expand Down
2 changes: 1 addition & 1 deletion gustaf/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EdgesShowOption(helpers.options.ShowOption):

_helps = "Edges"

def _initialize_vedo_showable(self):
def _initialize_showable(self):
"""
Initializes edges as either vedo.Lines or vedo.Arrows

Expand Down
2 changes: 1 addition & 1 deletion gustaf/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FacesShowOption(helpers.options.ShowOption):

_helps = "Faces"

def _initialize_vedo_showable(self):
def _initialize_showable(self):
"""
Initializes Faces as vedo.Mesh

Expand Down
3 changes: 2 additions & 1 deletion gustaf/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from gustaf.helpers import data, raise_if
from gustaf.helpers import data, options, raise_if

__all__ = [
"data",
"options",
"raise_if",
]
Loading
Loading