-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Parse string bool values in CmdStan csv header #2354
Conversation
arviz/data/io_cmdstan.py
Outdated
@@ -746,6 +747,9 @@ def _process_configuration(comments): | |||
elif match_float: | |||
key, value = match_float.group(1), match_float.group(2) | |||
results[key] = float(value) | |||
elif match_str_bool: | |||
key, value = match_str_bool.group(1), match_str_bool(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match_str_bool(2) I believe should be matr_str_bool.group(2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, because the results dictionary values are converted to strings the value False
is read incorrectly as "False"
when attempting to convert to an integer on line 807 of this PR int(pconf.get("save_warmup", 0))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, let's just turn these to int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I tried it and can now read csvs to an inference data object.
Thank you :)
I will merge this one in, given that CI errors are not related to changes done in here. |
Fixes #2353
Description
Parse string bool values in CmdStan csv header.
Checklist
📚 Documentation preview 📚: https://arviz--2354.org.readthedocs.build/en/2354/