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

fixed .size error #213

Closed
wants to merge 1 commit into from
Closed

fixed .size error #213

wants to merge 1 commit into from

Conversation

sbarratt
Copy link

.size does not exist for tuples. Replaced with len

.size does not exist for tuples. Replaced with len
@cc7768
Copy link
Member

cc7768 commented Nov 26, 2015

Thanks for submitting this! Great for people to see these types of things and leave some feedback.

If I'm not mistaken (which is possible), q should be a numpy array. Maybe instead of changing from .size to len we should make sure the input is a numpy array (or change it to one). @jstac @mmcky @spencerlyon2 @oyamad any thoughts?

@sbarratt
Copy link
Author

You could do:

self._q = np.array(q)

@oyamad
Copy link
Member

oyamad commented Nov 26, 2015

Or,

self._q = np.asarray(q)

which does not make a copy when q is already a numpy array.

Otherwise, if one wants to keep .size (and self._q as is), could do n=self.Q.size, where self.Q is a numpy array.

@jstac
Copy link
Contributor

jstac commented Nov 26, 2015

@oyamad 's first suggestion sounds good. Just waiting for some major reorganizations of the repo and lectures to finish and then we can make this change. @sbarratt Many thanks.

@jstac
Copy link
Contributor

jstac commented Dec 22, 2015

@sbarratt Thanks again for flagging this. I'm closing the PR but we'll make the fix suggested above.

@jstac jstac closed this Dec 22, 2015
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

Successfully merging this pull request may close these issues.

4 participants