Skip to content

Data methods: make consistent references to axes of arrays and axes of Data objects #1210

Description

@ddkohler

This is an umbrella issue for the general idea that we almost always intend to use Data.axes to specify manipulations of the data, but array axes sometimes get used. This aspect hurts the transparency of the WrightTools API.

In some methods we use the idea that supplying an axis as an integer value implies you want the array axis, while supplying a string implies a Data axis. This is done especially in operations where operations are channel manipulations (e.g. in Data.gradient, Data.moment). However, this rule is not always enforced, which can make these operations confusing.

Some methods (e.g. Data.level, Data.smooth) strictly use array axes.

Proposal 1:

  • Migrate channel manipulations (e.g. gradient, moment) as Channel/Dataset methods that accept array axis arguments
  • Data objects will have wrappers/alternative methods that accept Data.axes/Data.variable arguments.

Proposal 2:

  • always take axis arg to mean data axes, and have an additional optional kwarg array_axis to switch to use array axes.

Identified methods to address

  • Data.level
  • Data.smooth
  • Data.gradient
  • Data.moment

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