Issue with vertcross function when using Fortran-order data from .npy files
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
Comienza en el punto de entrada de vertcross y reproduce el ValueError informado con datos en orden Fortran cargados mediante np.load. Compara ese comportamiento con np.ascontiguousarray(vorticity); se considera terminado cuando vertcross gestiona correctamente la entrada o documenta y comunica claramente su requisito sobre el orden de los datos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I encountered an issue when using the vertcross function from the wrf-python package to perform vertical interpolation on data stored in a .npy file. Specifically, when I load the .npy file , the data is stored in Fortran-order (column-major) format by default.
The vertcross function seems to require C-order (row-major) data storage format to work correctly. When passing Fortran-order data, I received a ValueError: invalid shape for argument 1 (got (38,), expected (360,)), which suggests a misinterpretation of the data shape due to the storage format mismatch.
Steps to Reproduce:
-
Load vorticity data counted by wrfout (e.g., vorticity) from a
.npyfile:vorticity = np.load("vorticity.npy") -
Attempt to use vertcross to perform vertical interpolation:
vs_cross = vertcross(vorticity, z, ...) -
Encounter the error: ValueError: invalid shape for argument 1 (got (38,), expected (360,))
The vertcross function should work correctly when the data is in Fortran-order (which is the default when reading .npy files). If the function requires C-order, it would be helpful to include a clear message in the documentation or provide an automatic conversion inside the function.
solution:
Manually converting the data to C-order format using np.ascontiguousarray() resolves the issue:
vorticity = np.ascontiguousarray(vorticity)
vs_cross = vertcross(vorticity, z, ...)
It would be helpful if the vertcross function could automatically handle Fortran-order data or provide better error handling or documentation related to data format expectations.
- Lenguaje dominante
- Python
- Estrellas
- 498
- Forks
- 178
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NCAR/wrf-python
-
NCAR/wrf-python#309 · 1 asignado ·
-
Windows builds on conda-forge Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
NCAR/wrf-python#307 · 5 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
NCAR/wrf-python#286 · 3 comentarios ·
-
Windows builds and testing Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
NCAR/wrf-python#282 · 1 comentario ·
-
PyPI releases Abierto
NCAR/wrf-python#274 · 5 comentarios · 1 reacción · 1 asignado ·
Todos los issues de NCAR/wrf-python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stephrobert/dsoxlab#238 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sublimehq/package_control#1780 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
nwg-piotr/nwg-displays#145 ·