Precision change in regular PP-grid coordinates
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
Start by reading iris.util.regular_points and the change linked in the issue, then reproduce the reported call with the given zeroth, step, and count values. Compare the first coordinate with the float64 result and inspect the existing tests for regular point generation. Done means the generated coordinates retain the expected precision for this case and the relevant tests pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 Bug Report
A change in the handling of dtypes (introduced to iris as part of Numpy 2 upgrade) has resulted in some files being loaded at a lower precision.
The change in behaviour was introduced in iris.util.regular_points, which first attempts to create a regular set of points as float32, and if that is not regular, re-attempts with float64. There are cases where the zeroth and step are float64, but are cast to float32, resulting in a regular array at a lower precision.
How To Reproduce
Steps to reproduce the behaviour:
- Start with a UM file with the following field headers:
...
(16) lbcode : 101 # Indicates regular lat-lon grid, rotated pole
(17) lbhem : 3
(18) lbrow : 190 # Number of points in y
(19) lbnpt : 190 # Number of points in x
...
(59) bzy : -0.27500000000000213 # Zeroth y point
(60) bdy : 0.11 # Step in y
(61) bzx : 341.30499999999995 # Zeroth x point
(62) bdx : 0.11 # Step in x
...
- In the pp load, in constructing the x coordinate, the following function will be called:
x = iris.util.regular_points(zeroth=341.30499999999995, step=0.11, count=190)
- The resulting array has a dtype of
float32, even though the inputs werefloat64. Compare the first element of the array, with the result of doing the calculation with native python floats (or with explicit numpy float64):
>>> x[0]
np.float32(341.41498)
>>> 341.30499999999995 + 0.11
341.41499999999996
>>> np.add(341.30499999999995, 0.11, dtype="float64")
np.float64(341.41499999999996)
The expected start longitude is actually included in the file, as entry 4 of the real constants - and it matches the float64 calculation:
%%%%%%%%%%%%%%%%%%
* real_constants *
%%%%%%%%%%%%%%%%%%
(1) col_spacing : 0.11
(2) row_spacing : 0.11
(3) start_lat : -0.1650000000000027
(4) start_lon : 341.41499999999996
(5) north_pole_lat : 39.25
(6) north_pole_lon : 198.0
Environment
- OS & Version: Red Hat Enterprise Linux release 9.8 (Plow)
- Iris Version: 3.15, but looks to have been introduced from 3.11
Additional context
Click to expand this section...
Can provide example file on request.- Lingua principale
- Python
- Stelle
- 730
- Fork
- 323
- Merge medio
- 3g 21h
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la 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 SciTools/iris
-
Link Checker ReportForse già presa @stephenworsley l’ha presa 12 giorni fa. ApertaBot Type: Bug Type: Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SciTools/iris#7368 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
guess_bounds(yearly=True) fails on a single point, monthly=True worksForse già presa @pp-mo l’ha presa 47 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
SciTools/iris#7311 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Agentic
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SciTools/iris
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
UKGovernmentBEIS/inspect_ai#6733 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ProyectoRespira/respira-webapp#334 ·
I maintainer di solito rispondono entro 1 giorno
-
bug security-alert
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
spectrayan/carefold#391 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Jakeschincariol/instagram-agent-skill#83 ·
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100