You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To aid with debugging of OCCT issues, a tool that could extract the OCP calls (with parameter values) either statically or dynamically from build123d code would enable rapid creation of OCCT test cases.
Potentially something like this:
importsysfrombuild123dimportBoxdeftrace_func(frame, event, arg):
# We're only interested in call eventsifevent!="call":
returntry:
# Get the name of the module where the function is definedmodule_name=frame.f_globals.get("__name__")
# Filter for build123d callsifmodule_nameandmodule_name.startswith("build123d"):
func_name=frame.f_code.co_namefunc_file=frame.f_code.co_filenamefunc_line=frame.f_linenoprint(f"Calling {func_name} in {module_name} at {func_file}:{func_line}")
# Only print arguments that are safe to inspecttry:
print(f"Arguments: {frame.f_locals}")
exceptAttributeError:
print(f"Could not inspect locals for {func_name}")
exceptAttributeErrorase:
print(f"AttributeError caught in {func_name}: {e}")
returntrace_func# Set the tracesys.settrace(trace_func)
# This will trace any build123d calls, including those calling into OCPb=Box(1, 1, 1)
# Turn off tracingsys.settrace(None)
where the filtering was improved to only include OCP calls.
The text was updated successfully, but these errors were encountered:
To aid with debugging of OCCT issues, a tool that could extract the OCP calls (with parameter values) either statically or dynamically from build123d code would enable rapid creation of OCCT test cases.
Potentially something like this:
where the filtering was improved to only include OCP calls.
The text was updated successfully, but these errors were encountered: