Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: MaskedRecords.view(): Missing dtype reset when dtype is ndarray subclass #30441

Open
Labels
@stratakis

Description

@stratakis

Describe the issue:

Caught by coverity scan.

Innumpy/ma/mrecords.py, theview() method has identical code in both branches of an if/else statement making the conditional check ineffective:https://github.com/numpy/numpy/blame/3a84feb5731514fd8343543f24b171f581b3a5c6/numpy/ma/mrecords.py#L363-L368

It looks like it was copy pasted fromnumpy/ma/core.py:

numpy/numpy/ma/core.py

Lines 3254 to 3260 in3a84feb

eliftypeisNone:
try:
ifissubclass(dtype,ndarray):
output=ndarray.view(self,dtype)
dtype=None
else:
output=ndarray.view(self,dtype)

And it's missing adtype = None

Reproduce the code example:

Description

Error message:

Python and NumPy Versions:

Python 3.14, numpy 2.3.4

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp