Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stored vector cannot be list #83

Open
mkoralew opened this issue Nov 15, 2018 · 1 comment
Open

stored vector cannot be list #83

mkoralew opened this issue Nov 15, 2018 · 1 comment

Comments

@mkoralew
Copy link

mkoralew commented Nov 15, 2018

Hi, due to unitvec function there is no possibility to store 'list' vector - it has to be np.array /ndarray, otherwise None is returned.

Due to fact there is no imput check maybe it will be nice to edit unitvec function so it will change list object to np.array, e.g:

def unitvec(vec):
    """
    Scale a vector to unit length. The only exception is the zero vector, which
    is returned back unchanged.
    """
    if isinstance(vec, list):
        vec = numpy.array(vec)

    ....

BR, Marcin

@pixelogik
Copy link
Owner

@mkoralew I think the whole framework expects vectors to be of type np.array / ndarray?

I never tried it with list vectors. Are you saying that this is the only place where this conversion would be needed in order to make list vectors work?

If you want to use list vectors and they are not supported by the framework feel free to add the support including tests in a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants