question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some issues with coordinates docstrings on representation

See original GitHub issue

I found a couple of issues with coordinates docstring on representation using Galactic frame. Codes to reproduce the issues summarized here.

  1. That the differentials must be at least 1/time and there is no unitless time (although there is unitless length) should be noted somewhere, and the error message printed when they are not can be improved?
  2. Current docstring templating gives wrong information about initializing Galactic frame with the cartesian representation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bsipoczcommented, Oct 17, 2018

Well, without any other labelling I think it’s a good assumption is that it’s the effort level of the person doing the labelling :trollface:

0reactions
astrojuanlucommented, Sep 7, 2020

After #9064, (1) was fixed:

In [9]: ICRS( 
   ...:   x=1, y=2, z=3, 
   ...:   v_x=1, v_y=2, v_z=3, 
   ...:   representation_type=r.CartesianRepresentation, 
   ...:   differential_type=r.CartesianDifferential, 
   ...: )                                                                                                                                                                                                                                     
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-916f1fc2c13a> in <module>
----> 1 ICRS(
      2   x=1, y=2, z=3,
      3   v_x=1, v_y=2, v_z=3,
      4   representation_type=r.CartesianRepresentation,
      5   differential_type=r.CartesianDifferential,

~/Personal/Astropy/astropy/astropy/coordinates/baseframe.py in __init__(self, copy, representation_type, differential_type, *args, **kwargs)
    580                     current_diff_unit = differential_data._units[f'd_{comp}']
    581                     if not current_diff_unit.is_equivalent(current_repr_unit / u.s):
--> 582                         raise ValueError(
    583                             "Differential data units are not compatible with"
    584                             "time-derivative of representation data units")

ValueError: Differential data units are not compatible withtime-derivative of representation data units

(oops, that missing whitespace!)

and (2) was addressed by adding a note on checking frame_specific_representation_info and representation_info. I think this issue can be closed, if others think there’s still something to be done here please feel free to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docstrings and annotations | Clean Code in Python
With docstrings, however, the story is different. Again, they do not represent comments, but the documentation of a particular component (a module, class, ......
Read more >
refactor coordinates classes to better separate ... - GitHub
I have a conceptual issue separating the Spherical, Cartesian, etc classes from the reference systems/frames (ICRS, etc.). For instance, ...
Read more >
Solved Using the format method, write a function | Chegg.com
Coordinates are separated by a single comma with no space. 3. Don't forget to include a docstring at the. This problem has been...
Read more >
BaseRepresentation — Astropy v5.1.1
Base for representing a point in a 3D coordinate system. Parameters. comp1, comp2, comp3 Quantity or subclass. The components of the 3D points....
Read more >
Docstrings · Geodesy.jl - JuliaHub
This object pre-caches both the ECEF coordinates and latitude and longitude ... An ellipsoidal representation of the Earth, for converting between LLA and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found