Skip to content

Remove OrderedDict from astropy.coordinates, small BaseCoordinateFrame.__init__ refactor - #10990

Merged
adrn merged 7 commits into
astropy:masterfrom
astrojuanlu:remove-ordereddict-coordinates
Nov 10, 2020
Merged

adrn merged 7 commits into
astropy:masterfrom
astrojuanlu:remove-ordereddict-coordinates

Conversation

@astrojuanlu

Copy link
Copy Markdown
Member

Description

  • Remove OrderedDict from astropy.coordinates, see Remove OrderedDict for astropy 4.3 or later #10888
  • Small refactor of BaseCoordinateFrame.__init__ to clarify some comments and move part of the code to two separate internal methods. It was not justified in itself, but used this opportunity to include it. The removal of OrderedDict is in a separate commit that applies cleanly without the rest.

Comment thread astropy/coordinates/baseframe.py
Comment thread astropy/coordinates/baseframe.py Outdated
Comment thread astropy/coordinates/baseframe.py
Comment thread astropy/coordinates/baseframe.py
Comment thread astropy/coordinates/baseframe.py
@astrojuanlu

Copy link
Copy Markdown
Member Author

RTD failure seems unrelated.

@pllim

pllim commented Nov 4, 2020

Copy link
Copy Markdown
Member

Yeah, seems to happen quite often lately. 🤔

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astrojuanlu - this looks nice! I like the gathering of those unwieldy parts of __init__ in their own methods. A few small comments about going perhaps just a little further.

p.s. Personally, I'd have slightly preferred to have the change from OrderedDict to dict in a separate PR, as it now mixes in some way trivial stuff with somewhat more tricky changes - though really what is most tricky is how the difference happens to be type-set.

Comment thread astropy/coordinates/baseframe.py Outdated
Comment thread astropy/coordinates/baseframe.py Outdated
Comment thread astropy/coordinates/baseframe.py
Comment thread astropy/coordinates/baseframe.py Outdated
@astrojuanlu

Copy link
Copy Markdown
Member Author

p.s. Personally, I'd have slightly preferred to have the change from OrderedDict to dict in a separate PR, as it now mixes in some way trivial stuff with somewhat more tricky changes

What I usually do in these cases is to review only a range of commits:

commit-range

But, if there are other reasons to split it, I'll happily do so :)

Addressing your comments now.

@astrojuanlu
astrojuanlu force-pushed the remove-ordereddict-coordinates branch from eec8bb9 to 32297ee Compare November 5, 2020 08:36
@astrojuanlu

Copy link
Copy Markdown
Member Author

Thanks for your prompt review @mhvk! Just addressed your comments.

@astrojuanlu
astrojuanlu force-pushed the remove-ordereddict-coordinates branch from 32297ee to 39ffe21 Compare November 5, 2020 08:39
Comment thread astropy/coordinates/baseframe.py Outdated
@mhvk

mhvk commented Nov 5, 2020

Copy link
Copy Markdown
Contributor

@astrojuanlu - thanks, looks pretty good now. Some more comments on the representation inferrence - I think we are thinking along the same lines there!

p.s. As you note, the ordereddict stuff is all in a separate commit, so let's leave it here.

@astrojuanlu
astrojuanlu force-pushed the remove-ordereddict-coordinates branch from 39ffe21 to c929044 Compare November 5, 2020 23:45
Comment thread astropy/coordinates/baseframe.py Outdated
@mhvk

mhvk commented Nov 6, 2020

Copy link
Copy Markdown
Contributor

This looks quite beautiful (modulo the suggestion for a shorter name for the method). @eteq, @adrn, @StuartLittlefair - it might be good if any of you could have a quick look too; does any of you want to? (I'm ready to sign off on it otherwise.) Note that the diff looks annoyingly worse than it is - mostly this is just a refactoring, but one that makes the initialization easier to follow.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it all looks good from my point of view. Will leave it open a few days just in case.

@StuartLittlefair

Copy link
Copy Markdown
Contributor

I will leave this to your capable hands @mhvk. Delving into the machinery of the coordinates classes makes my head hurt.

@adrn

adrn commented Nov 6, 2020

Copy link
Copy Markdown
Member

Planning to take a look at this but very busy week -- will get to it over the weekend!

@adrn adrn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments from me! I think this looks great, and I like the restructuring / factorization of the init! Thanks @astrojuanlu for this!

@adrn
adrn merged commit 25d1d21 into astropy:master Nov 10, 2020
@astrojuanlu
astrojuanlu deleted the remove-ordereddict-coordinates branch November 10, 2020 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants