__pow__ method incompatible with downstream subclasses

Open
#900 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by locating the NDCube.pow method and inspect how it uses _new_instance. Reproduce the traceback described in specutils issue 1279, then verify arithmetic with downstream specutils.Spectrum objects no longer fails and compare the behavior with the workaround in specutils pull request 1291.

Written by the indexing model from the issue text.

Description

Bug
Describe the bug

The use of _new_instance in the NDCube.__pow__ method was causing a traceback when doing arithmetic with downstream specutils.Spectrum objects that inherit from NDCube. See here for a description/traceback. I worked around this in https://github.com/astropy/specutils/pull/1291 but it might be worth updating the method here to avoid this.

To Reproduce

See linked specutils issue above.

Screenshots

No response

System Details
  • ndcube 2.3.4
Installation method

No response

Dominant language
Python
Stars
49
Forks
56
Avg merge
5h 54m
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sunpy/ndcube

All issues in sunpy/ndcube

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.