JuliaPy / JuliaPy/PyCall.jl

indexing using pycall get differs from python

Abierto
#234 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Julia
Estrellas
1.5k
Forks
186
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I have read this:

Given o::PyObject, get(o, key) is equivalent to o[key] in Python, with automatic type conversion. To get as a PyObject without type conversion, do get(o, PyObject, key), or more generally get(o, SomeType, key). You can also supply a default value to use if the key is not found by get(o, key, default) or get(o, SomeType, key, default)

With this I successfully sliced a Python object ndarray in the first direction using:
image = get(image, PyObject, 5:70)
The problem is that I want to be able to do (in python) img[5:70, 5:200], use multiple arguments in brackets, but when typing
image = get(image, PyObject, 5:70, 5:200)
the second argument in seen as the default argument. So wouldn't it be nice to be able to give multiple arguments using get?

image = get(image, PyObject, (5:70, 5:200)) results in

LoadError: Only two or three spatial dimensions are permitted
while loading In[55], in expression starting on line 102
in call at /home/frank/.julia/v0.4/ImageView/src/display.jl:143
in view at /home/frank/.julia/v0.4/ImageView/src/display.jl:239
in obtainDataFromImages at In[55]:88
[inlined code] from In[55]:108
in anonymous at no file:0

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza por seguir la API get de PyCall descrita en el issue y reproducir la indexación multidimensional sobre un ndarray de Python. Compara los argumentos de slice separados con la forma de tupla y determina cómo se distinguen actualmente los argumentos predeterminados. Se considera terminado cuando la indexación multidimensional funciona como se solicita o cuando el comportamiento compatible queda aclarado mediante una prueba de regresión.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
julia, python
Área
backend-api-design
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.