JuliaPy / JuliaPy/PythonCall.jl

Support more of abstract array interface

Abierto
#462 11 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Julia
Estrellas
1.1k
Forks
86
Merge medio
1 d 22 h
PR fusionados (30 d)
3

Descripción

Currently `similar` will return an array of a different type:

```python
from juliacall import Main as jl
import numpy as np

x = np.random.randn(5)
y = jl.similar(x)

print(jl.typeof(x))
# PyArray{Float64, 1, true, true, Float64}
print(jl.typeof(y))
# Vector{Float64}
```

This can introduce some type instabilities in libraries due to the assumption that container type is preserved by `similar`.

I guess we just need the "optional methods" from here: https://docs.julialang.org/en/v1/manual/interfaces/#man-interface-array

Guía de contribución

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

Línea de trabajo

No implementation file or test is named. Reproduce the Python/Julia `similar` example from the issue, then read the linked Julia array-interface documentation and trace the existing `similar` handling in PythonCall.jl. Done means the relevant optional array-interface methods are supported and the example preserves the expected container type.

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

Evaluación

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.