Skip to content

[MNT]: Masked arrays with units #24733

@oscargus

Description

@oscargus

Summary

In #24545 it was identified that sometimes there is a problem with masked arrays and units. The solution in #24732 is rather straightforward, but it lead me to check the code for potential other locations.

Proposed fix

These are the locations I potentially found. It should probably be confirmed that it is a problem before modifying them (and those cases will be a good base for a test):

self._offsets = np.column_stack(
(np.asarray(self.convert_xunits(offsets[:, 0]), float),
np.asarray(self.convert_yunits(offsets[:, 1]), float)))

(Here one should probably take a complete look at the set_offsets/get_offsets setup and see if one can remove redundant calls. See a bit of the discussions in #24732)

offsets = np.column_stack([xs, ys])

(Not sure if it makes sense here.)

A bunch in quiver, but not sure how well that supports units and masks. Similar with projections.

As discussed in #24732 (comment) it seems like date2num does not support masked arrays, so making it do that is also a step in the right direction for this. (This is dealt with in #24734)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy