ValueError when setting zmin, zmax for rgb image
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 18.8k
- Forks
- 2.8k
- Merge medio
- 16 h 26 min
- PR fusionados (30 d)
- 21
Descripción
There seem to be a validation error bug for setting zmin, zmax for rgb images. It appears the validation code expects a tuple or list of size 4 ( as would be the case for rgba) and not size 3 as should be the case for rgb.
im= np.random.randint(256,size=(50,50,3),dtype=np.uint8)
fig = go.Figure(go.Image(z=im,colormodel='rgb',zmin=[10,10,10],zmax=[100,100,100]))
fig.show()
Results in the following error:
File "C:\Users\NA\Anaconda3\lib\site-packages_plotly_utils\basevalidators.py", line 283, in raise_invalid_val
valid_clr_desc=self.description(),
ValueError:
Invalid value of type 'builtins.tuple' received for the 'zmax' property of image
Received value: [100, 100, 100]
The 'zmax' property is an info array that may be specified as:
* a list or tuple of 4 elements where:
(0) The 'zmax[0]' property is a number and may be specified as:
- An int or float
(1) The 'zmax[1]' property is a number and may be specified as:
- An int or float
(2) The 'zmax[2]' property is a number and may be specified as:
- An int or float
(3) The 'zmax[3]' property is a number and may be specified as:
- An int or float
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.
Línea de trabajo
Comienza reproduciendo el ejemplo proporcionado de NumPy y go.Image con un array RGB y valores de zmin/zmax de longitud tres. Sigue la validación de la propiedad de imagen que genera el ValueError y compárala con el manejo de RGBA. Se considera terminado cuando se aceptan los límites RGB y la validación existente de RGBA sigue siendo correcta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- numpy, python
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100