Skip to content
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

docs(fix): fixed reversed description of duration magnitude #271

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

dream-dasher
Copy link
Contributor

Just a fix of what I believe is a typo, but also a couple out-of-code comments re: possible changes.

Fix: the docs said that -1 century < (-1 century + 1 ns), which I believe is the opposite of what you meant. (Had to download library and check though since, per the point of explaining, it could've gone either way :)

A couple other things that might be worth changing/clarifying:

  1. It was decided that the nanoseconds corresponds to the nanoseconds into the current century.

    • I think that's also untrue, yes? Nanoseconds are toward "the future" as it were. Rather than toward any period (absolute or dynamic). Technical correctness aside, I also found that phrasing confusing. (But I'm not a space-related scientist, so maybe this is common phrasing in your field. ?)
  2. The negative durations can be mentally modeled "BC" years. One hours before 01 Jan 0000, it was "-1" years but 365 days and 23h into the current day.

    • This is helpful, but might it be simpler to just refer to the sign of both durations and components as pointing to the past (back) or future (forward)? This also sets up the clean reading of +/- centuries, + nanoseconds as just being negative + positive.

Just figured I'd bring it up in case you thought minor re-wording could help, since I was making a (micro) PR.
(I've only just found your crate, so I have zero expertise here and may be misunderstanding its intended interpretation.)

@ChristopherRabotin
Copy link
Member

Hi Ethan,

First off, thanks for the sponsorship!

Secondly, thank you for the fix. Yes, that was a typo. Here it is in action in Python:

In [10]: (Unit.Century*-1 + Unit.Nanosecond*1).to_parts()
Out[10]: (-1, 1)

In [11]: (Unit.Century*-1).to_parts()
Out[11]: (-1, 0)

In [12]: Unit.Century*-1 < Unit.Century*-1 + Unit.Nanosecond*1
Out[12]: True

I fully agree with you that the documentation is confusing: I recall being confused when I was proof-reading it that part of it. At the same time, I couldn't quite figure out how to write it differently. With more perspective now, maybe can I find another way to explain how it works.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9b0b173) 80.73% compared to head (d669287) 80.74%.
Report is 20 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   80.73%   80.74%   +0.01%     
==========================================
  Files          16       16              
  Lines        3769     3771       +2     
==========================================
+ Hits         3043     3045       +2     
  Misses        726      726              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChristopherRabotin ChristopherRabotin merged commit 3708669 into nyx-space:master Jan 4, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants