sporkus / probe_accuracy_tests

GNU General Public License v3.0
136 stars 29 forks source link

Multi-dimensional indexing #26

Closed quattroerik closed 9 months ago

quattroerik commented 9 months ago

Hi Sporkus, was trying to run your script today, but it aborts before creating any charts with below error message which i could not solve by browsing the web :-(

Execution of the script:

`python3 $HOME/probe_accuracy_tests/probe_accuracy_test_suite.py

Klippain mode detected Running all tests

Test probe around the bed to see if there are issues with individual drives Leveling 4...3...2...1...Done min max first last mean std count range drift test
1:corner 30samples (25, 255) 5.067391 5.116141 5.067391 5.116141 5.111974 0.009004 30 0.04875 0.04875 2:corner 30samples (275, 255) 5.086141 5.117391 5.086141 5.117391 5.115099 0.005799 30 0.03125 0.03125 3:corner 30samples (25, 5) 5.092391 5.121141 5.092391 5.121141 5.116391 0.005555 30 0.02875 0.02875 4:corner 30samples (275, 5) 5.056141 5.081141 5.056141 5.081141 5.079099 0.004671 30 0.02500 0.02500 Traceback (most recent call last): File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 676, in main(args) File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 87, in main test_routine(userparams) File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 102, in test_routine dfs.append(test_corners(n=corner, force_dock=force_dock, kwargs)) File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 216, in test_corners facet_plot(df, cols=2, plot_nm=plot_nm) File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 307, in facet_plot plot_probes(x, y, measurement, ax) File "/home/pi/probe_accuracy_tests/probe_accuracy_test_suite.py", line 317, in plot_probes ax.plot(x, y, ".", x, p(x), "-.") File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 1743, in plot lines = [self._get_lines(args, data=data, **kwargs)] File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 273, in call yield from self._plot_args(this, kwargs) File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 388, in _plot_args x = _check_1d(tup[0]) File "/usr/lib/python3/dist-packages/matplotlib/cbook/init.py", line 1318, in _check_1d ndim = x[:, None].ndim File "/home/pi/.local/lib/python3.9/site-packages/pandas/core/series.py", line 1072, in getitem return self._get_with(key) File "/home/pi/.local/lib/python3.9/site-packages/pandas/core/series.py", line 1082, in _get_with return self._get_values_tuple(key) File "/home/pi/.local/lib/python3.9/site-packages/pandas/core/series.py", line 1122, in _get_values_tuple disallow_ndim_indexing(result) File "/home/pi/.local/lib/python3.9/site-packages/pandas/core/indexers/utils.py", line 341, in disallow_ndim_indexing raise ValueError( ValueError: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.`

Installed packages: pip3 install -r requirements.txt Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: pandas>=1.3 in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (2.1.3) Requirement already satisfied: numpy>=1.21 in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.25.0) Requirement already satisfied: matplotlib in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (3.3.4) Requirement already satisfied: requests in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 4)) (2.31.0) Requirement already satisfied: python-dateutil>=2.8.2 in /home/pi/.local/lib/python3.9/site-packages (from pandas>=1.3->-r requirements.txt (line 1)) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /home/pi/.local/lib/python3.9/site-packages (from pandas>=1.3->-r requirements.txt (line 1)) (2023.3.post1) Requirement already satisfied: tzdata>=2022.1 in /home/pi/.local/lib/python3.9/site-packages (from pandas>=1.3->-r requirements.txt (line 1)) (2023.3) Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas>=1.3->-r requirements.txt (line 1)) (1.16.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 4)) (2020.6.20) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 4)) (2.10) Requirement already satisfied: charset-normalizer<4,>=2 in /home/pi/.local/lib/python3.9/site-packages (from requests->-r requirements.txt (line 4)) (3.3.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 4)) (1.26.5)

sporkus commented 9 months ago

see if this version helps: https://github.com/sporkus/probe_accuracy_tests/tree/fix-pandas-incompat

quattroerik commented 9 months ago

Thanks! It works! Had to struggle with some packages, but finally pip uninstall matplotlib pip install matplotlib

did the job :-)

quattroerik commented 9 months ago

works without error now! thanks :-)