Skip to content

Up Time's __array_priority__ to above Quantity's - #1940

Merged
taldcroft merged 1 commit into
astropy:masterfrom
mhvk:time-array-priority
Jan 5, 2014
Merged

taldcroft merged 1 commit into
astropy:masterfrom
mhvk:time-array-priority

Conversation

@mhvk

@mhvk mhvk commented Dec 31, 2013

Copy link
Copy Markdown
Contributor

TimeDelta should have priority over Quantity so that constructions like (1.*u.m)/TimeDelta(100., format='sec') get handled correctly. With this, one xfail test no longer fails.

@taldcroft

Copy link
Copy Markdown
Member

Looks good to me.

@taldcroft

Copy link
Copy Markdown
Member

Sorry @mhvk I should have merged this earlier but now it needs a rebase (presumably CHANGES.rst). While we're at it, do you think this is a bug fix for 0.3.1? It seems like that's the case, but can you think of any way this would change how things behave in any way so as to be an API change?

@mhvk

mhvk commented Jan 5, 2014

Copy link
Copy Markdown
Contributor Author

OK, rebased (conflict was with my own PR, so can hardly complain!). I do think this qualifies as a bug-fix: before, the "wrong" order would have simply thrown an error (which is why the corresponding test was marked xfail), while the "right" order does not change (since the two __array_priority__ were equal, so if TimeDelta was on the left, it got precedence already).

taldcroft added a commit that referenced this pull request Jan 5, 2014
Up Time's __array_priority__ to above Quantity's
@taldcroft
taldcroft merged commit 534ab40 into astropy:master Jan 5, 2014
@mhvk
mhvk deleted the time-array-priority branch January 5, 2014 16:22
@embray

embray commented Jan 6, 2014

Copy link
Copy Markdown
Member

Same problem as #1925.

taldcroft added a commit that referenced this pull request Feb 12, 2014
Up Time's __array_priority__ to above Quantity's
Conflicts:

	CHANGES.rst
taldcroft added a commit that referenced this pull request Feb 12, 2014
Up Time's __array_priority__ to above Quantity's
Conflicts:

	CHANGES.rst
@pllim pllim added the closed-by-bot Closed by stale bot label May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-by-bot Closed by stale bot time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants