We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d02aef4 commit fbccbe7Copy full SHA for fbccbe7
edsl/scenarios/scenario.py
@@ -574,12 +574,16 @@ def to_dict(
574
{'food': 'wood chips'}
575
576
"""
577
+ import math
578
from edsl.scenarios import FileStore
579
from edsl.prompts import Prompt
580
581
d = self.data.copy()
582
for key, value in d.items():
- if isinstance(value, FileStore) or isinstance(value, Prompt):
583
+ # Check for NaN values and replace with None for JSON serialization
584
+ if isinstance(value, float) and math.isnan(value):
585
+ d[key] = None
586
+ elif isinstance(value, FileStore) or isinstance(value, Prompt):
587
value_dict = value.to_dict(add_edsl_version=add_edsl_version)
588
if (
589
offload_base64
0 commit comments