Skip to content

Allow empty string "" in columns to be overridden with default values in priors #384

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

PaulJonasJost
Copy link
Collaborator

The check only looked for whether it was not a string, but empty string values that are passed as "" were not caught here. This should fix the error.

@PaulJonasJost PaulJonasJost requested a review from dweindl April 28, 2025 16:57
@PaulJonasJost PaulJonasJost self-assigned this Apr 28, 2025
@PaulJonasJost PaulJonasJost requested a review from a team as a code owner April 28, 2025 16:57
Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine as is

@@ -278,7 +278,10 @@ def from_par_dict(
:return: A distribution object.
"""
dist_type = d.get(f"{type_}PriorType", C.PARAMETER_SCALE_UNIFORM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the default can come first, and the override can then be stated in the "positive" case, instead of nots. This is how it's mostly done elsewhere in the code as I recall.

But fine as is too.

This suggestion is for the changed code too, but github wouldn't let me edit the block.

Suggested change
dist_type = d.get(f"{type_}PriorType", C.PARAMETER_SCALE_UNIFORM)
dist_type = C.PARAMETER_SCALE_UNIFORM
if _table_dist_type := d.get(f"{type_}PriorType") and (isinstance(_table_dist_type, str) or not np.isnan(_table_dist_type)):
dist_type = _table_dist_type

Copy link
Member

@dweindl dweindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants