You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an array that internally, I would like to treat it as a vector with shape (3,), but I would like to allow the user to input something that is (3,1). I realize this could be achieved with a validator, but this case comes up quite a bit (and is easy to forget about). Without a validator, the user will get the error
Would it make sense to add a coerce_shape=True keyword to the Array property (eg. it tries to flatten a 1D array to a vector if the shape is ('*',) or, alternatively, if a 2D array was expected and a vector input, it performs a np.atleast_2d on it?
The text was updated successfully, but these errors were encountered:
lheagy
added a commit
to simpeg/simpeg
that referenced
this issue
Jul 4, 2018
I have an array that internally, I would like to treat it as a vector with shape

(3,)
, but I would like to allow the user to input something that is(3,1)
. I realize this could be achieved with a validator, but this case comes up quite a bit (and is easy to forget about). Without a validator, the user will get the errorWould it make sense to add a
coerce_shape=True
keyword to the Array property (eg. it tries to flatten a 1D array to a vector if the shape is('*',)
or, alternatively, if a 2D array was expected and a vector input, it performs anp.atleast_2d
on it?The text was updated successfully, but these errors were encountered: