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

Clean up sys-param code that reads parameters #668

Merged
merged 4 commits into from
Oct 27, 2024
Merged

Conversation

vtnate
Copy link
Contributor

@vtnate vtnate commented Oct 21, 2024

Any background context you want to provide?

A while ago we removed the 'defaults' section of sys-param files. This removes the code for reading those sections.

What does this PR accomplish?

Refactor the get_param code in system_parameters.py to remove references to defaults which haven't existed for some time.

How should this be manually tested?

CI is sufficient

What are the relevant tickets?

Resolves #495

@vtnate vtnate added the enhancement New feature or request label Oct 21, 2024
@vtnate vtnate self-assigned this Oct 21, 2024
@vtnate vtnate requested a review from nllong October 21, 2024 22:51

if len(results) == 1:
# If only one value, then return that value and not a list of values
# If only one value, then return that value and not a list of values.
results = results[0]
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that we do this. I think we should always return a list. I don't know why I did this (I'm guilty for it). I think I was following another API pattern. Regardless, leave it as is, otherwise it will break lots of things.

results = results[0]
elif len(results) == 0:
return default_value
return None
Copy link
Member

Choose a reason for hiding this comment

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

nice, no results means NONE!

@nllong nllong merged commit 7236a71 into develop Oct 27, 2024
10 checks passed
@nllong nllong deleted the refactor-get-param branch October 27, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor get_param since there is no longer a default section of the sys-param file
2 participants