Support `cf.Data` (consistently) for numeric array inputs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- data-visualization
Línea de trabajo
Start with cfplot/stipple.py at the failing call shown in the traceback, then search the plotting functions for numeric array inputs that handle cf.Data inconsistently. Compare how those functions accept array-like values and identify where cf.Data needs to be accepted directly. Done when numeric inputs consistently accept cf.Data without requiring callers to use .array or .datum(), and Example 17 no longer needs that conversion.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
There are places in cf-plot where one can input a numeric value or array. In all such cases we should support a cf.Data object input - in fact this should generally be our preferred object, at least in terms of being top to encourage this in the docs, though under-the-hood support should be 'equal' in terms of allowed any array with a numpy-like interface. At present there is patchy support for this, but we should consistently accept cf.Data and extract the underlying array (only) when necessary from this, rather than requiring the user to ever call .array etc. to then input that.
MRE of a case without support at present
One example, that I doubt is a lone case, where cf.Data input fails:
>>> f = cf.read("docs/source/example-datasets/tas_A1.nc")
>>> g = f[0][-1, :, :]
>>> g
<CF Field: air_temperature(time(1), latitude(73), longitude(96)) K>
>>> minim = g.min().datum() # this works, with .datum() conversion
>>> cfp.gopen()
>>> cfp.con(g, lines=False) # need this for now to not run into Issue #151
>>> cfp.stipple(g, min=minim, max=400)
>>> cfp.gclose()
>>>
>>> minim = g.min() # this does not work, without .datum() conversion
>>> cfp.stipple(g, min=minim, max=400) # otherwise the same call, hangs for ~10s then errors
Traceback (most recent call last):
File "<python-input-24>", line 1, in <module>
cfp.stipple(g, min=minim, max=400)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/home/slb93/git-repos/cf-plot/cfplot/stipple.py", line 169, in stipple
plotvars.mymap.scatter(
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'scatter'
See also Example 17 which shows datum() having to be called, where resolution of this Issue would make it unnecessary: https://github.com/NCAS-CMS/cf-plot/blob/main/docs/source/examples/example_17.rst#example-17-basic-stipple-plot
- Lenguaje dominante
- Python
- Estrellas
- 21
- Forks
- 11
- Merge medio
- 3 h 7 min
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 NCAS-CMS/cf-plot
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
docs enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
dependencies infrastructure installation testing
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
docs enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de NCAS-CMS/cf-plot
Issues similares
-
Adopt size-ratchet v4.0.3Abiertoarea: ci enhancement perceived difficulty: 1
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vllm-project/vllm-sail#398 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
DiamondLightSource/sm-bluesky#476 ·
Los mantenedores suelen responder en 1 día
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100