Skip to content

Review namelist reads for consistency between single and list items #211

@georgemccabe

Description

@georgemccabe

Some values in a namelist file can be a list or a single value. Currently we only support using the first domain if multiple domain are provided (issue #133 adds support for multiple domains). We have had to add logic to ensure that only a single value is read when a list of values can be provided. Here is an example:

nx: int = geogrid.get('e_we', 0)
ny: int = geogrid.get('e_sn', 0)
# get first nx/ny values if a list of values are set
nx = nx[0] if isinstance(nx, list) else nx
ny = ny[0] if isinstance(ny, list) else ny

Describe the Enhancement

Review the existing logic to read namelist files and ensure that a single value is used when a list could potentially be provided by the user. Perhaps a helper function could be written to check and only return the first value if the item is a list. This could help implementing #133 as we could search for where this function is used and update the logic to support multiple domains if it is used to read the value of the first domain.

Time Estimate

Estimate the amount of work required here.
Issues should represent approximately 1 to 3 days of work.

Sub-Issues

Consider breaking the enhancement down into sub-issues.

  • Add a checkbox for each sub-issue here.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority

Projects and Milestone

  • Select Project
  • Select Milestone as the next official version or Backlog of Development Ideas

Enhancement Checklist

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>/<Description>
  • Complete the development and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s), Project, and Development issue
    Select: Milestone as the next official version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alert: NEED MORE DEFINITIONNot yet actionable, additional definition requiredtype: enhancementImprove something that it is currently doing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions