Skip to content

Commit

Permalink
clean up interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Oct 21, 2024
1 parent 3fbb019 commit 3ad6fdf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/armadillo_cra.json

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/compas_cra/data/samples/compas_1to2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ def replace_untyped_graph_values(olddata, newdata):
newdata[key] = value


def clean_up_interface_data(olddata):
if isinstance(olddata, dict):
for key, value in olddata.items():
if isinstance(value, dict):
if "type" in value and "interaction" in value and "viewmesh" in value:
print("here")
del value["type"]
del value["interaction"]
del value["viewmesh"]
clean_up_interface_data(value)
elif isinstance(olddata, list):
for item in olddata:
clean_up_interface_data(item)


here = pathlib.Path(__file__).parent

for filepath in here.iterdir():
Expand All @@ -54,5 +69,7 @@ def replace_untyped_graph_values(olddata, newdata):
newdata = {}
replace_untyped_graph_values(olddata, newdata)

clean_up_interface_data(newdata)

with open(here / f"{filepath.stem}.json", "w+") as f:
json.dump(newdata, f)
2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/concave-long.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/concave-short.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/cube-curve-short.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/cube-curve-tall.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/compas_cra/data/samples/curve-3-blocks.json

Large diffs are not rendered by default.

0 comments on commit 3ad6fdf

Please sign in to comment.