star-sexagesimal 0.1.0
Degrees ⇄ degrees/minutes/seconds and hours/minutes/seconds
Public state: Released & Verified. The registry label is RELEASED. What the states mean →
Apache-2.0 Released & Verified single file
Summary
Degrees to and from degrees/minutes/seconds and hours/minutes/seconds with one rounding on the whole angle; rounded fields identical to ERFA on 1200 of 1200 cases, joined angles within 1.2e-13 deg of ERFA and astropy, and out-of-range input refused.
Run in your browser
Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).
Runs in the browser: all 51 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026. Open it in the Workspace →
Use it on your computer
No account and no GitHub needed. Download, then install with one command:
- Install file · star_sexagesimal-0.1.0-py3-none-any.whl 3 kB
- Single file — copy it alongside your code · star_sexagesimal.py 4 kB
- Source code (.zip) 19 kB
python -m pip install star_sexagesimal-0.1.0-py3-none-any.whlIn Python: import star_sexagesimal
Cite it, and its bill of materials
For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.
@software{cavazzini_star_sexagesimal_0_1_0,
author = {Cavazzini, Andrea},
title = {{star-sexagesimal}: Degrees ⇄ degrees/minutes/seconds and hours/minutes/seconds},
version = {0.1.0},
year = {2026},
url = {https://andrea07072000.github.io/S.T.A.R.-/software/star_sexagesimal/},
note = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}
For developers
Install directly from the public repository:
python -m pip install "star-sexagesimal @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_sexagesimal"
Technical sheet
Requirements
- R1
deg_to_dms(deg, decimals)anddeg_to_hms(deg, decimals)return (sign, whole, minutes, seconds, fraction) as a '+'/'-' sign and four integers,fractionin units of 10**-decimals second; rounding to the nearest unit, ties away from zero, once on the whole angle. Reproduce 23° 26' 21.448" and 17h 48m 59.74s (Meeus). - R2
dms_to_degandhms_to_degjoin the fields; 15° = 1 h. No wrapping: 360° is 360° and 24 h. - R3 Measured on 600 angles (100 within 1e-9 deg of a whole arcminute) and 600 sets of fields: rounded fields identical to ERFA in 1200 of 1200, never a 60; joined angle within 1.2e-13 deg of ERFA and astropy; unrounded seconds within 5e-7 s of astropy (the rounding step at six decimals).
- R4 Every function returns its result or raises
ValueError: non-numeric, boolean, NaN or infinite input, an angle outside [-360, 360], decimals not an integer in 0…6, a sign other than '+' or '-', degrees not an integer in 0…360 (hours 0…24), minutes not an integer in 0…59, seconds outside [0, 60), a total above 360° (24 h).
Limits (what is not claimed)
No formatting to text and no parsing of text: fields in, fields out. No wrapping into [0, 360) or [0, 24 h). At most six decimals of a second. A binary floating-point angle that is not exactly on a tie is rounded as the float it is, not as the decimal it was typed as.
Release gate
Computed by the registry from the result files, with the same function that decides RELEASED.
- Mutation score, latest measure of each module (needs at least 0.850)
- star_sexagesimal.py 0.984 (2026-10-06)
- Independent implementations written by others (needs 2)
- astropy Angle.signed_dms / hms and string parser, ERFA a2af / a2tf / af2a / tf2a (C)
- Also compared with, not counted
- published values: Meeus, Astronomical Algorithms, ch. 22 and Example 13.b
- Result
- Released & Verified
Evidence in the registry
| Check | Status | Recorded | What was observed |
|---|---|---|---|
| Unit tests | VERIFIED | 2026-10-06 | 51 passed in 0.45s |
| Review | VERIFIED | 2026-10-06 | Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed |
| Review | VERIFIED | 2026-10-06 | Re-running the cross-check gives a byte-identical evidence file |
| Reference value | VERIFIED | 2026-10-06 | deg_to_dms(23.4392911, 3) = ('+', 23, 26, 21, 448); dms_to_deg('+', 23, 26, 21.448) = 23.43929111, within 1.2e-8 deg of the printed decimal (printed to 1e-7) (suite: 51 passed in 0.45s) |
| Cross-check with independent libraries | VERIFIED | 2026-10-06 | star_sexagesimal splits and joins angles as two independent libraries do, and never shows 60 in a field |
| Benchmark | VERIFIED | 2026-10-06 | cases one last unit apart from ERFA: 0 of 1200 |
| Clean install from the release tag | VERIFIED | 2026-10-06 | pytest outside the tree: 51 passed in 0.17s |
Fingerprints (SHA-256)
| star_sexagesimal-0.1.0-py3-none-any.whl | b804bf747da87b5dbce14a4c3905cf6f01d76ee6f7a73ff3012b29fb88a82747 |
| star_sexagesimal.py | 07e835372095a413980d157be650a4c907b9af3fd37a99ce6c26fac087e4b6ed |
| star_sexagesimal-0.1.0-source.zip | fe2b34fe73974f55cda368fd04d662f8936b2d39de401913da6975ba3cc57699 |
