question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

astropy.units.isclose broken in astropy 5.1

See original GitHub issue

Description

astropy.units.isclose returns false for values within floating point precisions

Expected behavior

astropy.units.isclose returns true for values within floating point precisions

Actual behavior

astropy.units.isclose returns false for values within floating point precisions

Steps to Reproduce

In [1]: import astropy.units as u

In [2]: import numpy as np

In [3]: u.isclose(0 * u.m, np.finfo(np.float64).eps * u.m)
Out[3]: False

In [4]: u.isclose(0, np.finfo(np.float64).eps)
Out[4]: False

In [5]: np.isclose(0, np.finfo(np.float64).eps)
Out[5]: True.

System Details

Linux-5.10.109-1-MANJARO-x86_64-with-glibc2.10
Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:18) 
[GCC 10.3.0]
Numpy 1.22.3
pyerfa 2.0.0.1
astropy 5.1
Scipy 1.8.0
Matplotlib 3.5.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
maxnoecommented, May 27, 2022

Mmh. I am confused now. I cannot reproduce locally. Test passes with 5.1 locally… So it has to be something else, sorry for the fuzz. Still confusing why it worked before.

1reaction
maxnoecommented, May 27, 2022

I got a broken test in the CI of ctapipe after it started using 5.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

isclose — Astropy v5.1.1
The units (or lack thereof) of a , b , and atol must be consistent with each other. If None , atol defaults...
Read more >
Astropy Documentation, Release 0.3b1 - Read the Docs
The “Astropy Project” is distinct from the astropy package. The Astropy Project is a process intended to facilitate.
Read more >
Full Changelog — Astropy v3.2.3 - Read the Docs
Fixed a bug [#9168] where having a kernel defined using unitless astropy ... Allow conversion of Column with logarithmic units to a suitable...
Read more >
Astropy Documentation - manualzz
Specify a description, units and output formatting for columns. ... CONSTANTS) 5.1 Introduction astropy.constants contains a number of physical constants ...
Read more >
Magnetic Fields within the Hub-filament Structure in IC 5146
The output I, Q, and U maps were calibrated in units of ... Figure 4 with a bin size of 10° that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found