Skip to content

Commit 256fd88

Browse files
feat: add 'save' mathod to DFPoses classes to dump it in a JSON
1 parent 4d5c71b commit 256fd88

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/gh/diffCheck/diffCheck/df_poses.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from scriptcontext import sticky as rh_sticky_dict
2-
2+
import json
33
from dataclasses import dataclass, field
44

55
@dataclass
@@ -65,3 +65,10 @@ def reset(self):
6565
"""
6666
self.n_step = 0
6767
rh_sticky_dict.clear()
68+
69+
def save(self, file_path: str):
70+
"""
71+
Save the assembly poses to a JSON file.
72+
"""
73+
with open(file_path, 'w') as f:
74+
json.dump(self.poses_per_element_dictionary, f, default=lambda o: o.__dict__, indent=4)

0 commit comments

Comments
 (0)