Skip to content

Commit 6342c68

Browse files
Update src/utils.py
Co-authored-by: Copilot <[email protected]>
1 parent 1ff3f2d commit 6342c68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ def rocketpy_encoder(obj, config: DiscretizeConfig = DiscretizeConfig()):
9595
include_outputs=True,
9696
include_function_data=True,
9797
)
98-
return json.loads(json_str)
98+
encoder = RocketPyEncoder(
99+
include_outputs=True,
100+
include_function_data=True,
101+
)
102+
return encoder.default(obj_copy)
99103
except Exception as e:
100104
logger.warning(f"Failed to encode with RocketPyEncoder: {e}")
101105
attributes = {}

0 commit comments

Comments
 (0)