These are chat archives for data-8/datascience

22nd
Dec 2015
Sam Lau
@SamLau95
Dec 22 2015 01:08
looks like you might have an old version of the package @cboettig
do you have 0.3.dev21?
Chris Holdgraf
@choldgraf
Dec 22 2015 18:57
I can confirm that @cboettig's code works on the latest version for me
Chris Holdgraf
@choldgraf
Dec 22 2015 19:02
Also - quick quibble, but I often forget to open this package with python 3 sourced, and the error message you get for doing so is a bit cryptic (it just throws an import error)

think we could just put:

import sys
if sys.version_info < (3, 0):
    raise ValueError('This package requires python >= 3.0')

at the root __init__.py?

Sam Lau
@SamLau95
Dec 22 2015 21:00
ah, that’s a good idea
Carl Boettiger
@cboettig
Dec 22 2015 21:03
@SamLau95 yup, running on ds8.berkeley.edu and it says '0.3.dev21'
Chris Holdgraf
@choldgraf
Dec 22 2015 21:03
@SamLau95 want me to make a PR?
Carl Boettiger
@cboettig
Dec 22 2015 21:04
It's very strange. I have in my git history successful runs of the notebook with the very same code that works with multiple columns, so I'm not sure why it is failing for me now.
Chris Holdgraf
@choldgraf
Dec 22 2015 21:04
hmm, that is weird - and it works for me
problem is I can't really debug it w/o the code breaking for me
maybe just to be sure you can pull the latest changes from the git repo
Sam Lau
@SamLau95
Dec 22 2015 21:06
@choldgraf that’d be great
Chris Holdgraf
@choldgraf
Dec 22 2015 21:09
@SamLau95 hrmmm, actually it might be more complicated
because it looks like some of the changes actually result in a syntaxerror in 2.7
so it won't get to the point that it's running any code
perhaps a better option would be to prevent it from installing on any versions of python < 3.0?
Sam Lau
@SamLau95
Dec 22 2015 21:11
ah i see
would you like to look into that?
if not, feel free to make an issue
Chris Holdgraf
@choldgraf
Dec 22 2015 21:13
@cboettig so it looks like the problem is that the function is passing a list of column names to the table. E.g., this returns the same error you get:
t[['letter', 'count', 'points']]
and it looks like that function has indeed been updated. Here's the new code for it: np.array([fn(*[self.take(i)[col][0] for col in column_label]) for i in range(self.num_rows)])
note that there is another for loop: for col in column_label so now it's passing each column that you give individually, that way it never tries to pass a list
so try pulling and it should work
Carl Boettiger
@cboettig
Dec 22 2015 21:15
interesting... so somehow I am running an old version of datascience even though it says 0.3.dev21 ?
I'm running this on ds8.berkeley.edu, so I have no ability to install there, but let me try locally. What version are you on?
Chris Holdgraf
@choldgraf
Dec 22 2015 21:17
ah interesting
same version
but w/o knowing much about how the repo is organized, that's probably just the current dev branch
and presumably the version of that code being used in ds8 is a few commits behind the branch on github
Carl Boettiger
@cboettig
Dec 22 2015 21:18
maybe version number didn't get bumped;
right.
um, so can you reproduce the error on your ds8.berkeley.edu account?
(and I'll try pulling and installing locally)
Chris Holdgraf
@choldgraf
Dec 22 2015 21:18
I.......haven't figured that out yet :)
Carl Boettiger
@cboettig
Dec 22 2015 21:19
hehe, what happens when you go to ds8.berkeley.edu and try to log in with your berkeley google account?
Chris Holdgraf
@choldgraf
Dec 22 2015 21:20
ooo it works
Carl Boettiger
@cboettig
Dec 22 2015 21:20
nice
Sam Lau
@SamLau95
Dec 22 2015 21:20
oh, you know what?
it’s possible that we haven’t pushed a new version to the servers
i mean
we haven’t incremented the version number after making that change
Carl Boettiger
@cboettig
Dec 22 2015 21:21
right
Sam Lau
@SamLau95
Dec 22 2015 21:21
blah, that’s a pain
maybe there’s a way to locally install the datascience package from the github repo on ds8
Chris Holdgraf
@choldgraf
Dec 22 2015 21:22
yeah I get the error on the ds8 servers
Sam Lau
@SamLau95
Dec 22 2015 21:22
that makes sense
Chris Holdgraf
@choldgraf
Dec 22 2015 21:23
I mean, could you theoretically just glone the datascience repo using a terminal in the ipyntbk and then make install from there?
Sam Lau
@SamLau95
Dec 22 2015 21:23
yeah, that might work
i have to bother ryan manually to update the package version on the ds8 server so it’s not something i can take care of right this minute
Chris Holdgraf
@choldgraf
Dec 22 2015 21:25
hmmm, I just tried cloning + make install and it threw a permissions error
I guess I could try to specify a folder w/in my home directory, but now we are getting into the territory of "too much of a hassle to be a solution for instructors" I think
Carl Boettiger
@cboettig
Dec 22 2015 21:27
Okay, well at least my code is running successfully after pulling the latest github copy and running make
(I'm running the the jupyter/datascience-notebook docker image, so I just docker exec'd in and ran make as root, so no permissions error for me ;-) )
So once the update hits the ds8 server, my issue should be resolved. though bumping the version would be good too.
Chris Holdgraf
@choldgraf
Dec 22 2015 21:31
cool
@SamLau95 PR made for the python3 check
Sam Lau
@SamLau95
Dec 22 2015 23:49
merged! thanks