pre-commit mypy errors
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by comparing the mypy pre-commit setup and the GitHub workflow, then inspect src/graphnet/data/extractors/icecube/i3extractor.py and the contribution guide. Reproduce the reported errors in the stated cvmfs environment and compare with a CPU environment. Done means the supported setup is documented or configured so the mypy hook passes consistently.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Currently if I follow the install guide and install graphnet on GPU with one of the newer cvmfs environments. running the pre-commits will fail on mypy giving rise the erroers like the one below
src/graphnet/data/extractors/icecube/i3extractor.py:35: error: Name "icetray.I3Frame.Calibration" is not defined [name-defined] src/graphnet/data/extractors/icecube/i3extractor.py:56: error: Module has no attribute "I3File" [attr-defined] src/graphnet/data/extractors/icecube/i3extractor.py:59: error: Module has no attribute "I3File" [attr-defined] src/graphnet/data/extractors/icecube/i3extractor.py:63: error: Module has no attribute "I3Frame" [attr-defined] src/graphnet/data/extractors/icecube/i3extractor.py:75: error: Module has no attribute "I3Frame" [attr-defined] src/graphnet/data/extractors/icecube/i3extractor.py:90: error: Name "icetray.I3Frame" is not defined [name-defined]
To Reproduce
Go to cobalt
in /data/user/"your_user" without graphnet already installed (otherwise just choose a different location)
run
eval `/cvmfs/icecube.opensciencegrid.org/py3-v4.3.0/setup.sh`
/cvmfs/icecube.opensciencegrid.org/py3-v4.3.0/RHEL_7_x86_64/metaprojects/icetray/v1.12.1/env-shell.sh
mkdir envs
cd envs
python -m venv "your_env_name"
source "your_env_name"/bin/activate
cd ..
git clone https://github.com/graphnet-team/graphnet.git
cd graphnet
pip install --upgrade pip>=20
pip install wheel setuptools==59.5.0
pip install -r requirements/torch_cu121.txt -e .[torch,develop]
pre-commit install
pre-commit run mypy --files src/graphnet/data/extractors/icecube/i3extractor.py
Expected behavior
Since no files have been changed the expected behaviour is that the hooks should pass as they are doing when being run on the github side.
Full traceback
Please include the full error message to allow for debugging
mypy.....................................................................Failed
- hook id: mypy
- duration: 2.84s
- exit code: 1
src/graphnet/data/extractors/icecube/i3extractor.py:35: error: Name "icetray.I3Frame.Calibration" is not defined [name-defined]
src/graphnet/data/extractors/icecube/i3extractor.py:56: error: Module has no attribute "I3File" [attr-defined]
src/graphnet/data/extractors/icecube/i3extractor.py:59: error: Module has no attribute "I3File" [attr-defined]
src/graphnet/data/extractors/icecube/i3extractor.py:63: error: Module has no attribute "I3Frame" [attr-defined]
src/graphnet/data/extractors/icecube/i3extractor.py:75: error: Module has no attribute "I3Frame" [attr-defined]
src/graphnet/data/extractors/icecube/i3extractor.py:90: error: Name "icetray.I3Frame" is not defined [name-defined]
Found 6 errors in 1 file (checked 1 source file)
Additional context
I have been able to find a solution which is to create another environment without linking to icetray. and just installing with cpu and running the pre-commits from that environments seems to work. I have been trying to track down differences between the package versions when they are being run on the github side and when I run the pre-commit locally but did not manage to find any issue.
So one solution could simply be to update the contribution guide instructing contributers to create a simple environment without cvmfs for when they are running the pre-commits and commiting to github.
- Lingua principale
- Python
- Stelle
- 117
- Fork
- 115
- Merge medio
- 2g 21h
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphnet-team/graphnet
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
graphnet-team/graphnet#933 ·
-
Spring cleanAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
graphnet-team/graphnet#927 · 1 commento ·
-
Time for a new version release v1.8.1Forse di nuovo libera @Aske-Rosted l’ha presa 75 giorni fa e non c’è nessuna pull request aperta. Apertadecision
graphnet-team/graphnet#924 · 1 assegnatario ·
-
Make kaggle checkpoints part of the CIForse di nuovo libera @sevmag l’ha presa 75 giorni fa e non c’è nessuna pull request aperta. Apertabug
graphnet-team/graphnet#921 · 2 commenti · 1 assegnatario ·
-
decision deferred
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
graphnet-team/graphnet#919 ·
Tutte le issue di graphnet-team/graphnet
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
vllm-project/vllm#69791 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
BCStudentSoftwareDevTeam/cas#481 ·
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno