ReagentX / purple_air_api

Python package to get and transform PurpleAir data
https://pypi.org/project/purpleair/
GNU General Public License v3.0
51 stars 19 forks source link

RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. #63

Closed ReagentX closed 3 years ago

ReagentX commented 4 years ago

Installing this package in an environment that uses Python 3.9.0 will result in the following error:

ImportError: Failed to import test module: purpleair
Traceback (most recent call last):
  File "/Users/chris/.pyenv/versions/3.9.0/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/Users/chris/.pyenv/versions/3.9.0/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/Users/chris/Documents/Code/Python/purple_air_api/tests/test_sensor.py", line 3, in <module>
    from purpleair import sensor
  File "/Users/chris/Documents/Code/Python/purple_air_api/purpleair/sensor.py", line 15, in <module>
    from .channel import Channel
  File "/Users/chris/Documents/Code/Python/purple_air_api/purpleair/channel.py", line 9, in <module>
    import pandas as pd
  File "/Users/chris/Documents/Code/Python/purple_air_api/venv/lib/python3.9/site-packages/pandas/__init__.py", line 11, in <module>
    __import__(dependency)
  File "/Users/chris/Documents/Code/Python/purple_air_api/venv/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
    raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

This is because there are no wheels built for NumPy yet. Since this package depends on numpy (it is a dependency of pandas, it will not work until numpy works on Python 3.9.0.

ReagentX commented 3 years ago

All tests pass now under Python 3.9.2:

purple_air_api on develop                                                                         Py 3.9.2
❯ python -m unittest discover tests
Child sensor requested, acquiring parent instead.
..Child sensor requested, acquiring parent instead.
.Child sensor requested, acquiring parent instead.
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Initialized 16,194 sensors!
.Child sensor requested, acquiring parent instead.
.Child sensor requested, acquiring parent instead.
.Child sensor requested, acquiring parent instead.
...Child sensor requested, acquiring parent instead.
.Child sensor requested, acquiring parent instead.
....
----------------------------------------------------------------------
Ran 26 tests in 25.866s

OK