Closed shobhitkapoor closed 10 months ago
Hi there,
Inspired by this wonderful project, I develop another sibling project that supports dynamic array pysv-numpy. Check to see if it meets your requirements.
Sorry for the late response. For some reason I didn't get the notification.
Open array is on the roadmap and I didn't have enough bandwidth to add support for it. It should be fairly straight to support since we can use pybind
's buffer protocol. I will try to get this feature done as soon as possible.
Online reminder Open array function
Hi, I am looking forward for the same update. It would be great if we could pass an array from python or sv and vice-versa.
If anybody is still watching, you can make your own 'array' type and pass that in, populate it inside your Python code and use the results:
class MyList:
@sv()
def __init__(self):
self._data = []
@sv()
def get_idx(self, idx):
return self._data[idx]
@sv
def set_idx(self, idx, value):
if len(self._data) > idx:
self._data[idx] = value
@sv()
def append(self, value):
self._data.append(value)
@sv()
def get_length(self):
return len(self._data)
def from_bytearray(self, in_byte_array):
self._data = in_byte_array
@sv(out_list=MyList, return_type=DataType.Int)
def my_function(out_list: MyList) -> int:
print(f'out_list.get_idx(100): {out_list.get_idx(0)}')
out_list.set_idx(10, 100)
...
Hi
I am trying to use your library , can we use list on python and dynamic array from SV side ? if yes then please guide how can I do it ?
Thanks Shobhit