Skip to content

Changed tz_offset to seconds, updated docstring #11

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

Merged
merged 15 commits into from
Jun 22, 2020

Conversation

theelectricmayhem
Copy link
Contributor

No description provided.

@theelectricmayhem
Copy link
Contributor Author

theelectricmayhem commented May 13, 2020

@brentru - Apparently I'm not formatting the docstring correctly. Where can I find info on what the formatting rules are?

(sorry for all the hassle for such a small change)

@brentru
Copy link
Member

brentru commented May 13, 2020

@theelectricmayhem Looks like it's failing on Sphinx (https://github.com/adafruit/Adafruit_CircuitPython_NTP/pull/11/checks?check_run_id=668814279#step:14:1). Try adding a blank line at the end of your docstring:

        positive in the US, zero in the UK).

        """

We have some instructions about running sphinx locally here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1,

@brentru brentru requested a review from a team May 13, 2020 14:29
@ladyada ladyada requested review from brentru and removed request for a team May 13, 2020 14:35
@ladyada
Copy link
Member

ladyada commented May 13, 2020

@brentru please do the full review :)

Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theelectricmayhem I think keeping it as minutes is OK (http://man7.org/linux/man-pages/man2/settimeofday.2.html).

Is there any reason you're modifying it to use seconds?

@theelectricmayhem
Copy link
Contributor Author

@brentru I modified it to seconds (from hours) based on feedback from @jepler. Also, it seemed to make the most sense for making adjustments to, say time.localtime() since it's in seconds.

I saw the error about "Field list ends without a blank line; unexpected unindent." but the previous version also did not have a trailing blank line and it did not fail the Sphinx test.

Let me know if you'd prefer minutes rather than seconds and I'll make changes.

@theelectricmayhem
Copy link
Contributor Author

Mercy! @brentru if you could take a look at this, I'd appreciate it. I can't, for the life of me find the offending formatting.

@brentru
Copy link
Member

brentru commented May 15, 2020

@theelectricmayhem I'm not sure where the issue is, @sommersoft could you please take a look? Thanks!

@jepler
Copy link
Contributor

jepler commented Jun 20, 2020

The documentation building process is finished. I think the remaining question is: minutes or seconds.

UNIX seems inconsistent on the subject.

Reasons to use minutes:

  • It suffices for the UTC offset of all time zones in existence at this time
  • It is used in struct timezone (though the zone argument of gettimeofday/settimeofday is largely unused)

Reasons to use seconds:

  • Some historical timezones have less-than-minute offsets
  • Some modern systems move towards using TAI or GPS time as the system time, and represent leap seconds by accounting for them in the local time zone offset (https://www.ucolick.org/~sla/leapsecs/right+gps.html)
  • Python uses it in time.timezone, time.altzone

Many newer systems store time zone offsets as general time intervals (similar to datetime.timedelta in CPython3) so they can represent arbitrary durations without the problem of knowing what the basic unit actually is.

@brentru
Copy link
Member

brentru commented Jun 22, 2020

@jepler I think using seconds would be useful for this library, for now. We could move to time deltas in a future PR (I didn't know about them, thanks for mentioning). Are you OK with this?

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am happy with the current state of the pr

@brentru brentru merged commit 48a2521 into adafruit:master Jun 22, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 23, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#45 from jerryneedell/jerryn_size

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.3.1 from 2.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#51 from cjsieh/customcolorchase
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#52 from kattni/sequence-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 3.1.1 from 3.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#41 from brentru/example-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_NTP to 2.1.0 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_NTP#11 from theelectricmayhem/patch-1
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.

5 participants