Skip to content

GridConfig class to help with instantiation #253

@jjuyeonkim

Description

@jjuyeonkim

Description
This originally came up out of PR #246, which is related to Issue #64.

While trying to clean up the soon-to-be-removed NDSL Namelist, we needed a way to extract grid parameters from a namelist file. A simple dict was used to move forward, but it really makes sense to have a class replace that.

Potential solution
Currently, in the translate tests (conftest.py), we do something like the following to create a dict to eventually use to initialize the grid:
grid_params = grid_params_from_f90nml(namelist)

Rather than return a dict, a potential class could be (suggestion from @romanc and @FlorianDeconinck):

class CartesianGridConfig
    nx: int,
    ny: int,
    nz: int,
    
class CubeSphereGridConfig:
   layout: tuple[int, int]
   cartesian_dims: CartesianGridConfig

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestRefactorTechnical internal work to improve systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions