-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Construction #29
Conversation
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
==========================================
+ Coverage 86.36% 92.55% +6.18%
==========================================
Files 2 2
Lines 66 94 +28
==========================================
+ Hits 57 87 +30
+ Misses 9 7 -2
Continue to review full report at Codecov.
|
Not sure whats causing the 1.0 failure on the most recent builds. I'll investigate it further. |
Previous failures were due to |
Good catch on the docstring, I forgot to test that. |
@test C("12h 0.0m 0.0s", "90:0:0") == C(π, π / 2) | ||
@test C("18h0:0", "90:0:0") == C(3π / 2, π / 2) | ||
if C == GalCoords | ||
@test C("12:0:0", "90:0:0") == C(0.20943951023931956, π / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unfortunate that
julia> deg2rad(12)
0.20943951023931956
instead of giving
julia> pi / 15
0.20943951023931953
but there is little we can do here
This PR adds the functionality for constructing coordinates using strings. It is driven by the new
str2rad
function.str2rad
There are two base regex patterns to arbitrarily parse the string as either a degree or an hour angle. In addition there is a boolean flag to force parse the string as an hour angle. Here is a clip of the documentation I've written for it

(If it's not clear, the other ticks that aren't quotation marks are
\prime
and\pprime
, which are what unitful uses for its arcminutes and arcseconds).string construction
The string construction takes all the types and adds a signature like
Coord(::AbstractString, ::AbstractString)
. For coordinates that use RA (ICRS and FK5) the first string will be force-parsed as an hour angle. Here is an example of the usageversion
bump to
0.5.0
to prep for release