Skip to content

Proposal: move iris.cube.Cube to iris.Cube #891

Open
@shoyer

Description

@shoyer

I find myself constructing a lot of cubes and cubelists manually when I implement new functions to manipulate cubes.

Since these are core API objects, I suggest they should be moved from iris.cube.Cube and iris.cube.CubeList to iris.Cube and iris.CubeList (via an import statement in /lib/iris/__init__.py). This would be consistent with many other Python libraries (e.g., Pandas), for which the core API is also usually exposed at the top level.

As a library user, it's just easier not to need to know about the structure of Iris's code to find a class or function. I can see a case for consolidating other functions into a broader namespace as well, but Cube and CubeList are the worse offenders (in my view). In my view, exposing submodules in a library's API should be done with caution, and only when it is clearly easier for library users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions