Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to_dict utility method #1160

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix bug
  • Loading branch information
tilmantroester committed Feb 26, 2024
commit da4fe7a69f0335dcbd4221c49043d6b96b13aa9c
2 changes: 1 addition & 1 deletion pyccl/cosmology.py
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ def _make_yaml_friendly(d):
d[k] = v.tolist()
elif isinstance(v, dict):
d[k] = _make_yaml_friendly(v)
elif not (isinstance(v, (str, list)) or v is None):
elif not (isinstance(v, (int, float, str, list)) or v is None):
raise ValueError(f"{k}={v} cannot be serialised to YAML.")

return d
Loading