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

Change path in data.py to fix travis CI fail #29

Merged
merged 7 commits into from
Nov 9, 2015

Conversation

BenjaminHsieh
Copy link
Contributor

Check to see if travis ci passes

@changsiyao
Copy link
Contributor

Maybe need to import os first

@BenjaminHsieh
Copy link
Contributor Author

do you mean in the data file?

@BenjaminHsieh
Copy link
Contributor Author

ok finally go it to work, the coverage will decrease because the hashList is being loaded from the call to main, which is ignored by travis ci. Anyway, this should work for everyone, someone can merge and test it out

@BenjaminHsieh
Copy link
Contributor Author

@BrianQIu

@BenjaminHsieh
Copy link
Contributor Author

Can also close #14

@changsiyao
Copy link
Contributor

Wait, I'm having problem with this file. If I change directory to the folder above, then the path for all the files are wrong.
Traceback (most recent call last):
File "data.py", line 42, in
check_hashes(d)
File "data.py", line 26, in check_hashes
digest = generate_file_md5(k)
File "data.py", line 13, in generate_file_md5
with open(filename, "rb") as f:
IOError: [Errno 2] No such file or directory: u'ds005/sub015/BOLD/task001_run001/QA/DVARS.png'

I got this. I think we need to change the directory back after loading the hashList, like:
if name == "main":
os.chdir('..')
with open('data/hashList.txt', 'r') as hl:
d = json.load(hl)
os.chdir('data/')
check_hashes(d)

@BenjaminHsieh
Copy link
Contributor Author

hmmm, weird, I have the opposite, if I add oc.chdir('data/') before check_hashes(d), then I get that same error

@changsiyao
Copy link
Contributor

Other people should check, otherwise, let's ask tmr in office hours.

@BenjaminHsieh
Copy link
Contributor Author

@changsiyao try this, I have this that works:

if name == "main":
with open('hashList.txt', 'r') as hl:
d = json.load(hl)
check_hashes(d)

@BenjaminHsieh
Copy link
Contributor Author

this assumes that you have the ds005/ in data directory

@changsiyao
Copy link
Contributor

This (without all the changing directory steps) works for me, but I thought this wouldn't pass the test?

@BenjaminHsieh
Copy link
Contributor Author

lol it passed just now

@BenjaminHsieh
Copy link
Contributor Author

lets get someone else to check just in case and if its good we can merge it

@changsiyao
Copy link
Contributor

eh...... But I suppose it's a good thing, lol~

@BenjaminHsieh
Copy link
Contributor Author

can someone test this and merge it thanks, it will probably allow us to pass the failure in #31 @boyinggong @BrianQIu @pigriver123

briankleinqiu added a commit that referenced this pull request Nov 9, 2015
Change path in data.py to fix travis CI fail
@briankleinqiu briankleinqiu merged commit 20a3b16 into berkeley-stat159:master Nov 9, 2015
@BenjaminHsieh BenjaminHsieh mentioned this pull request Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants