Skip to content
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

Upgrade py_motmetrics code for Python 3.10 support #1045

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

michael-hoss
Copy link
Contributor

I am currently using nuscenes-devkit as a submodule in a Python 3.10 project for tracking evaluation (see also bazel integration PR #1044).

To make it work beyond Python 3.6 and 3.7, I:

  • bumped the dependency of motmetrics from <= 1.1.3 to ==1.4.0.
  • adapted the devkit code that was taken from motmetrics to their newer code from 1.4.0.
    • in doing so, I fixed one thing that I already merged back into their repo: Keep the MultiIndex of the df even if empty cheind/py-motmetrics#188
    • I saw there was a speed optimization in our code before, which I haven't yet included in the 1.4.0 code again. Feel free to do so if you're still familiar with this!
    • included the "pred_frequencies" here metric because py_motmetrics needs it now

Note: I have not yet tested if this is still compatible with Python 3.6 and 3.7.

@whyekit-motional
Copy link
Collaborator

whyekit-motional commented Mar 13, 2024

@michael-hoss if this PR is not tested to be backward-compatible with Python 3.6 and 3.7, we would not be able to merge it, as this will affect a lot of prior users if it fails

@michael-hoss
Copy link
Contributor Author

michael-hoss commented Mar 13, 2024

@whyekit-motional What exactly would the testing for backward-compatibility include? All unit tests passing in Python envs of the respective versions? How about those unit tests that are skipped right now, e.g. I saw some @unittest.skip commands here?

Edit: Please let me know if you happen to have a script or CI workflow that wraps this all. Also, which expansions of the dataset would I need to execute all relevant tests?

@dominikandreas
Copy link

Is python<=3.7 actually supported at the moment? With the current state of the master branch, I'm not able to install the dependencies using python3.7

(py37) :~/$ python --version
Python 3.7.12
(py37) :~/$ pip install git+https://github.com/nutonomy/nuscenes-devkit/#subdirectory=setup
Collecting git+https://github.com/nutonomy/nuscenes-devkit/#subdirectory=setup
  Cloning https://github.com/nutonomy/nuscenes-devkit/ to /tmp/pip-req-build-ua0_z75y
  Running command git clone --filter=blob:none --quiet https://github.com/nutonomy/nuscenes-devkit/ /tmp/pip-req-build-ua0_z75y
  Resolved https://github.com/nutonomy/nuscenes-devkit/ to commit 9df79f48bac3cc713f4dbd2b48049be845605c51
  Preparing metadata (setup.py) ... done
Collecting cachetools (from nuscenes-devkit==1.1.11)
  Using cached cachetools-5.3.3-py3-none-any.whl.metadata (5.3 kB)
Collecting descartes (from nuscenes-devkit==1.1.11)
  Using cached descartes-1.1.0-py3-none-any.whl.metadata (2.4 kB)
Collecting fire (from nuscenes-devkit==1.1.11)
  Using cached fire-0.6.0.tar.gz (88 kB)
  Preparing metadata (setup.py) ... done
Collecting matplotlib<3.6.0 (from nuscenes-devkit==1.1.11)
  Using cached matplotlib-3.5.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.metadata (6.7 kB)
INFO: pip is looking at multiple versions of nuscenes-devkit to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 1.22.0 Requires-Python >=3.8; 1.22.1 Requires-Python >=3.8; 1.22.2 Requires-Python >=3.8; 1.22.3 Requires-Python >=3.8; 1.22.4 Requires-Python >=3.8; 1.23.0 Requires-Python >=3.8; 1.23.0rc1 Requires-Python >=3.8; 1.23.0rc2 Requires-Python >=3.8; 1.23.0rc3 Requires-Python >=3.8; 1.23.1 Requires-Python >=3.8; 1.23.2 Requires-Python >=3.8; 1.23.3 Requires-Python >=3.8; 1.23.4 Requires-Python >=3.8; 1.23.5 Requires-Python >=3.8; 1.24.0 Requires-Python >=3.8; 1.24.0rc1 Requires-Python >=3.8; 1.24.0rc2 Requires-Python >=3.8; 1.24.1 Requires-Python >=3.8; 1.24.2 Requires-Python >=3.8; 1.24.3 Requires-Python >=3.8; 1.24.4 Requires-Python >=3.8; 1.25.0 Requires-Python >=3.9; 1.25.0rc1 Requires-Python >=3.9; 1.25.1 Requires-Python >=3.9; 1.25.2 Requires-Python >=3.9; 1.26.0 Requires-Python <3.13,>=3.9; 1.26.0b1 Requires-Python <3.13,>=3.9; 1.26.0rc1 Requires-Python <3.13,>=3.9; 1.26.1 Requires-Python <3.13,>=3.9; 1.26.2 Requires-Python >=3.9; 1.26.3 Requires-Python >=3.9; 1.26.4 Requires-Python >=3.9; 2.0.0b1 Requires-Python >=3.9; 3.6.0 Requires-Python >=3.8; 3.6.0rc1 Requires-Python >=3.8; 3.6.0rc2 Requires-Python >=3.8; 3.6.1 Requires-Python >=3.8; 3.6.2 Requires-Python >=3.8; 3.6.3 Requires-Python >=3.8; 3.7.0 Requires-Python >=3.8; 3.7.0rc1 Requires-Python >=3.8; 3.7.1 Requires-Python >=3.8; 3.7.2 Requires-Python >=3.8; 3.7.3 Requires-Python >=3.8; 3.7.4 Requires-Python >=3.8; 3.7.5 Requires-Python >=3.8; 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9; 3.8.3 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement numpy>=1.22.0 (from nuscenes-devkit) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6)
ERROR: No matching distribution found for numpy>=1.22.0

@michael-hoss
Copy link
Contributor Author

@dominikandreas Thanks for pointing this out. So far, I have just tested this in a Python 3.10 environment. Will look more into this for Python <=3.7

@michael-hoss michael-hoss force-pushed the perceptest/upgrade_pymotmetrics_for_pr branch from 02a689b to cbbd71f Compare April 5, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants