Skip to content

Coordinates tweaks - #7

Closed
embray wants to merge 4 commits into
eteq:coordinatesfrom
embray:coordinates-tweaks
Closed

embray wants to merge 4 commits into
eteq:coordinatesfrom
embray:coordinates-tweaks

Conversation

@embray

@embray embray commented Dec 6, 2012

Copy link
Copy Markdown

A few tweaks to the coordinates branch, including some PEP8 cleanup (we're nearing the end, right? It's just in this one file) and the new versions of hours_to_string() and degrees_to_string() I promised. Plus took care of a couple other todo items. Test seems to pass except for the two that are xfail.

…ys so might as well get it out of the way so it doesn't get mixed in with other changes.
…format strings and fill in exception info such as the file/function/lineno in which the exception occurred. This might be useful elsewhere in Astropy but I haven't looked yet.)
@eteq

eteq commented Dec 7, 2012

Copy link
Copy Markdown
Owner

@iguananaut - this looks fine except for one thing: changing the trig functions to np.sin and such. It's using math right now because this currently never gets an array, and using np.sin on a single value vs. math.sin is a 2000x slowdown. So we have to adjust this once we bring in the arrays, but for now I think it's better to keep using math.

Also, some of my recent changes are now conflicting with this, although I think nothing too crucial.

So in the interest of moving forward, I will resolve the conflict with a manual merge. And I will also rebase your branch here to just remove the one commit that does the numpy changes. I'll be curious to see how github interprets that... Fun git times!

eteq added a commit that referenced this pull request Dec 8, 2012
… conflict resolutions and stripping numpy trig function changes
@eteq

eteq commented Dec 8, 2012

Copy link
Copy Markdown
Owner

Interesting... so it's showing a reference, but did not close it, despite the fact that 3 of the four commits are now merged in. I'm going to go ahead and close this, since its (mostly) merged, but @iguananaut - if you disagree with my actions re: numpy vs. math, feel free to continue discussing it here. Or, alternatively, wait until astropy#471 is merged and then issue a PR against master.

@eteq eteq closed this Dec 8, 2012
@embray

embray commented Dec 10, 2012

Copy link
Copy Markdown
Author

Fine by me--I'm surprised the np. math functions are so much slower--I always assumed that for scalar input they would just fall back to the simple non-vectorized implementations. For the record I'm seeing something like a 10x slowdown rather than 2000x but I don't know what tests that's based on.

@eteq

eteq commented Dec 10, 2012

Copy link
Copy Markdown
Owner

Hmm, I'm now seeing more like 20x, as well, so I'm not sure why the 2000x was happening earlier. But 20x is still enough that it makes sense for now.

But yeah, it's weird how much slower they are. We'll have to consider how we want to work around this later (when we put in arrays), I suppose.

eteq pushed a commit that referenced this pull request Jan 5, 2014
Don't do two copies of data on inplace operations unless it is non-contiguous and we really need to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants