Skip to content

Conversation

@eteq
Copy link
Member

@eteq eteq commented Dec 2, 2014

This contains a variety of changes I was planning to suggest as part of reviewing #3141 (but it got merged before I had a chance to suggest them).

The code approach itself is mostly unaltered, but a number of clean-up items:

  • A lot of stuff in the docstrings was no longer correct following the split - I think I've got them all cleaned up. I think this is crucial, because clear docstrings are particularly important here given the rather convoluted nature of the code. In the process, this also makes the python docstrings more like the astropy format.
  • Renamed cython_generator.py to erfa_generator.py, because it's no longer just generating cython code
  • Renamed erfa.py/erfa.pyx to core.py and core.pyx (which now compiles to _core). The rational for that is that the name erfa.pyx only made sense when it was everything in the erfa package. Now that it's two different modules, the pure-python file is nominal astropy.erfa.erfa, and double-naming like that leads to confusion. So I took a page from time (which has astropy.time.core as the main implementation file).
  • I removed from __future__ import unicode_literals in erfa_generator.py. This is deceptively important: with it in, the generated code has a bunch of u'foo'-style string literals. These are currently not in master, because it apepars @jwoillez use python 3 to generate the code, which has a different output from using python 2 when unicode_literals is in force. This will be less important if we solve Auto-generate erfa.pyx and erfa.py #3159, so if I end up rebasing, this could be removed.

Note that all the renaming means this will conflict with other ERFA PRs currently pending. Of special signficance is #3170/#3166 or similar work on auto-generating these files during build. It probably makes sense to wait for those, if they're coming soon, and rebase this on those, because that means I can expunge all of the changes to core.py and core.pyx.

cc @jwoillez @astrofrog @mhvk @mdboom

@mhvk
Copy link
Contributor

mhvk commented Dec 2, 2014

@eteq - this looks very good -- again apologies for merging too soon! (Though at least it kickstarted quite a bit of nice further work...). I particularly like the improved docstrings.

Would you want to include @jwoillez's new part exposing constants (mhvk@14a7ab8)? If it is too much hassle, I'm happy to do it after too.

@mhvk
Copy link
Contributor

mhvk commented Dec 2, 2014

p.s. Since it is more of a bug, you may also want to include mhvk@f7c59ee (of course, only the template one being important).

@eteq
Copy link
Member Author

eteq commented Dec 2, 2014

@mhvk - I included mhvk/astropy@f7c59ee just now because that's pretty straightforward and basically a bug fix. Thanks!

I didn't include the constants stuff though, as I think that's a more substantial change, so I think it makes more sense to treat it separately as part of PR #3137 . (Regardless, merging any of this should wait on #3159 or its follow-ons)

@mhvk
Copy link
Contributor

mhvk commented Dec 2, 2014

OK, no problem. It will be easy to redo #3137 once this is in.

@astrofrog
Copy link
Member

I'm working on trying to use @embray's hooks with #3166 which will take care of the auto-generation, but there are other issues with the latest astropy-helpers that need to be fixed first.

@eteq
Copy link
Member Author

eteq commented Dec 14, 2014

@astrofrog - ok, I think once the auto-generation is in this should be pretty easy to rebase. If there's serious delays to #3166 we can merge this in time for the feature freeze without it, if necessary.

@eteq
Copy link
Member Author

eteq commented Dec 17, 2014

@mhvk @astrorog - this is now rebased on #3166 .

@mhvk - the order of merging might be important here. I think this is best first because it does a lot of little fiddly things that could be a lot of effort to rebase. But definitely other work will have to rebase on this, because it renames some files (which git is sometimes a bit finiky about). Is there anything other than #3137 that you think will conflict?

@mhvk
Copy link
Contributor

mhvk commented Dec 17, 2014

@eteq - yes, #3138, but that's very easy to rebase (just have to take out the reshape again -- wish I had remembered it had moved here and not to #3166...). I'm fine with getting this in first.

@eteq eteq added this to the v1.0.0 milestone Dec 17, 2014
@eteq eteq added the Affects-dev PRs and issues that do not impact an existing Astropy release label Dec 17, 2014
@eteq
Copy link
Member Author

eteq commented Dec 17, 2014

Ok, cool, then this should be all set. Something weird is going on with travis, though, I think because of some rebasing hackery I did. I noticed some minor typos anyway, so I'll just push up another commit shortly

@eteq
Copy link
Member Author

eteq commented Dec 17, 2014

@mhvk - are you happy with just merging this if the tests pass, or do you want to look over it first?

@mhvk
Copy link
Contributor

mhvk commented Dec 17, 2014

@eteq - I had another quick look and think this is all OK, so as far as I'm concerned, go ahead and merge once travis is happy.

@eteq
Copy link
Member Author

eteq commented Dec 17, 2014

build passed, so I'll merge it now.

eteq added a commit that referenced this pull request Dec 17, 2014
@eteq eteq merged commit dd07b1a into astropy:master Dec 17, 2014
@eteq eteq deleted the erfa-tweaks branch December 17, 2014 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants