Skip to content

datetime: fix _fromtimestamp for small-range floats #4

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 2 commits into from
Mar 3, 2021

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Mar 3, 2021

A typical timestamp is 1614803568. A CircuitPython float's granularity at this magnitude is several minutes!

By avoiding the use of modf when t is an integer, the datetime.now() classmethod is usable, i.e., it returns a time that increases from second to second instead of mostly being stuck and occasionally jumping forward.

A typical timestamp is 1614803568. A CircuitPython float's granularity
at this magnitude is several minutes!

By avoiding the use of modf when t is an integer, the `datetime.now()`
classmethod is usable, i.e., it reutnrs a time that increases from second
to second instead of mostly being stuck and occasionally jumping forward.
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.

@jepler thanks! lgtm, failing on CI pylint

@jepler jepler merged commit 25f8de0 into master Mar 3, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 11, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#11 from FoamyGuy/pylintrc_and_versions

Updating https://github.com/adafruit/Adafruit_CircuitPython_BH1750 to 1.0.4 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BH1750#1 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO08X to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO08x#17 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO08X_RVC to 1.0.4 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO08x_RVC#2 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_CLUE to 2.2.9 from 2.2.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_CLUE#40 from AlexColello/patch-2

Updating https://github.com/adafruit/Adafruit_CircuitPython_EMC2101 to 1.1.4 from 1.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_EMC2101#5 from FoamyGuy/pylint_to_precommit

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.6 from 3.5.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#124 from FoamyGuy/pylintrc
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#125 from brentru/rp2040

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.0.2 from 3.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#40 from dglaude/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_LC709203F to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_LC709203F#9 from FoamyGuy/pylintrc_and_versions

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.1.3 from 4.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#38 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP2515 to 1.0.8 from 1.0.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP2515#8 from FoamyGuy/pylintrc_and_versions

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 2.0.5 from 2.0.4:
  > Re-added pylint install to build.yml
  > Removed pylint process from github workflow
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#27 from SAK917/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_MS8607 to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_MS8607#6 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8591 to 1.0.4 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCF8591#3 from FoamyGuy/pylint_ignore_imports

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.11.2 from 2.11.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#59 from adamcandy/fix-page-addressing-mode-spi

Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.2.3 from 5.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#66 from brentru/rp2040-example
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#65 from FoamyGuy/pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#3 from FoamyGuy/pylint_to_pre_commit
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#4 from adafruit/jepler-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Hue to 1.1.5 from 1.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Hue#16 from OBITORASU/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 2.2.1 from 2.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#64 from FoamyGuy/pylintrc
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#69 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_SSD1680
@evaherrada evaherrada deleted the jepler-patch-1 branch June 21, 2021 13:58
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