Skip to content

Add inplace arg for dataset methods #100

Description

@robertjwilson

Currently, it is slightly tedious to create new datasets based on existing ones. This requires you to use the copy method.

For example, if you wanted to create a new dataset so that you could plot the spatial average of a dataset, you would have to do this:

`ds1 = ds.copy()`
`ds.spatial_mean()`
`ds1.plot()`

This is one step too many. Methods currently modify datasets in place. What's needed is a way to return a new dataset with an inplace arg similar to what happens in pandas. So the above would become:

`ds1 = ds.spatial_mean(inplace = False)`
`ds1.plot()`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions