Skip to content

Changes to Coordinates broke SunPy #7069

Closed

Description

@Cadair

I am attempting to work out a minimal failing example for this but:

sunpy/coordinates/__init__.py:6: in <module>
    from .ephemeris import *
sunpy/coordinates/ephemeris.py:106: in <module>
    get_earth(_time_first_rotation).hcrs.cartesian.transform(_SUN_DETILT_MATRIX) \
sunpy/coordinates/ephemeris.py:73: in get_earth
    earth = SkyCoord(0*u.deg, earth.lat, earth.radius, frame=earth)
/home/travis/miniconda/envs/test/lib/python3.6/site-packages/astropy/coordinates/sky_coordinate.py:225: in __init__
    kwargs = self._parse_inputs(args, kwargs)
/home/travis/miniconda/envs/test/lib/python3.6/site-packages/astropy/coordinates/sky_coordinate.py:384: in _parse_inputs
    valid_kwargs.update(_get_representation_attrs(frame, units, kwargs))
/home/travis/miniconda/envs/test/lib/python3.6/site-packages/astropy/coordinates/sky_coordinate.py:2075: in _get_representation_attrs
    differential_type = frame._representation['s'].attr_classes
E   AttributeError: 'NoneType' object has no attribute 'attr_classes'

https://travis-ci.org/sunpy/sunpy/jobs/327706590#L2349

Activity

  1. added this to the v3.0.0 milestone on Jan 11, 2018
  2. Cadair commented on Jan 11, 2018

    @Cadair
    MemberAuthor

    I can't get much further than:

    In [9]: SkyCoord(0*u.deg, 10*u.deg, 100*u.km, frame=sunpy.coordinates.HeliographicStonyhurst)
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    <ipython-input-9-d722e4b666bb> in <module>()
    ----> 1 SkyCoord(0*u.deg, 10*u.deg, 100*u.km, frame=sunpy.coordinates.HeliographicStonyhurst)
    
    ~/Git/astropy/astropy/coordinates/sky_coordinate.py in __init__(self, copy, *args, **kwargs)
        223         # creating the internal self._sky_coord_frame object
        224         args = list(args)  # Make it mutable
    --> 225         kwargs = self._parse_inputs(args, kwargs)
        226 
        227         frame = kwargs['frame']
    
    ~/Git/astropy/astropy/coordinates/sky_coordinate.py in _parse_inputs(self, args, kwargs)
        382         # Grab any frame-specific attr names like `ra` or `l` or `distance` from kwargs
        383         # and migrate to valid_kwargs.
    --> 384         valid_kwargs.update(_get_representation_attrs(frame, units, kwargs))
        385 
        386         # Error if anything is still left in kwargs
    
    ~/Git/astropy/astropy/coordinates/sky_coordinate.py in _get_representation_attrs(frame, units, kwargs)
       2073 
       2074     # TODO: change _representation['s'] to `differential_type` when that exists
    -> 2075     differential_type = frame._representation['s'].attr_classes
       2076     for frame_name, repr_name in frame.get_representation_component_names('s').items():
       2077         diff_attr_class = differential_type[repr_name]
    
    AttributeError: 'NoneType' object has no attribute 'attr_classes'
    

    and to get that far I had to comment out an import in SunPy not to trigger the bug.

  3. Cadair commented on Jan 11, 2018

    @Cadair
    MemberAuthor

    a quick bisect leads me to the following commit:

    f526c7d

    which has this little comment in it:

    TODO: change _representation['s'] to differential_type when that exists

    f526c7d#diff-443cf9a7fca154e62d35de00f15d5c44R1884

  4. pllim commented on Jan 11, 2018

    @pllim
    Member

    xref #6944
    c/c @eteq and @adrn

  5. eteq commented on Jan 11, 2018

    @eteq
    Member

    will have a look ASAP (unless @adrn gets there first)

  6. Cadair commented on Jan 12, 2018

    @Cadair
    MemberAuthor
  7. eteq commented on Jan 20, 2018

    @eteq
    Member

    (FWIW I am working on this, but it's hard to track down...)

  8. added a commit that references this issue on Jan 20, 2018
  9. eteq commented on Jan 20, 2018

    @eteq
    Member

    OK I'm most of the way there (https://github.com/eteq/astropy/tree/fix-7069), but fixing things has revealed another bug that seems similarly subtle... going to have to give it a rest for tonight but will try to come back ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions