Closed joamatab closed 11 months ago
long story short: I don´t think we should just allow anything as input into the cell. convert it to something that is hashable. if you ask for numpy arrays, the next guy will ask for dataframes. How are you handling it in gdsfactory?
tl;dr give it something hashable or one of the types that are autoconverted ;)
I see, it's a bit of an edge case, we wrote custom serializers in gdsfactory but it's a pain to maintain :)
yeah, I agree. The reason I also push back hard on this: if you ever pass numpy values to any klayout objects, they will complain with a cryptic error message
>>> import klayout.db as kdb
>>> import numpy as np
>>>
>>> kdb.Trans(1,1)
r0 1,1
>>> kdb.Trans(np.int64(1),1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: No overload with matching arguments in Trans.__init__
how can we support numpy arrays as cell inputs?