broadinstitute / gdctools

Python and UNIX CLI utilities to simplify interaction with the NIH/NCI Genomics Data Commons
Other
31 stars 4 forks source link

Minor errors in various files #30

Closed aswanipranjal closed 7 years ago

aswanipranjal commented 7 years ago

Pull Request Template

I tried to run gdc_mirror but it threw me some errors, so I changed the following files:

gdctools/GDCcli.py gdctools/GDCcore.py gdctools/GDCtool.py gdctools/lib/api.py gdctools/lib/common.py gdctools/lib/meta.py

I have mentioned in the commits, the changes that I have done.

Style Checklist

Please ensure that your pull request meets the following standards for quality. Code should not be merged into the master branch until all of these criteria have been satisfied.

Comments

Style/Execution

noblem commented 7 years ago

Thank you, Pranjal. We were not seeing those errors, needless to say. Was this from running "make test"? Either way, can you post a log file here?

aswanipranjal commented 7 years ago

Sorry for the weird commits and incomplete information, this is my first pull request! I have python3 as the default version.

I started with this:

mac ~ $ gdc_mirror

Traceback (most recent call last): File "/Users/mac/miniconda3/bin/gdc_mirror", line 7, in from gdctools.gdc_mirror import main File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/gdc_mirror.py", line 23, in from GDCcore import * ImportError: No module named 'GDCcore'

mac ~ $ cd /Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/

mac gdctools $ ls GDCcli.py pycache gdc_list.py lib GDCcore.py default.cfg gdc_loadfile.py tool_template.py GDCtool.py gdc_counts.py gdc_mirror.py init.py gdc_dice.py gdc_report.py

mac gdctools $ gdc_mirror Traceback (most recent call last): File "/Users/mac/miniconda3/bin/gdc_mirror", line 7, in from gdctools.gdc_mirror import main File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/gdc_mirror.py", line 22, in import GDCcore ImportError: No module named 'GDCcore'

mac gdctools $ python Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import GDCcore Traceback (most recent call last): File "", line 1, in File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/GDCcore.py", line 40, in import builtin ImportError: No module named 'builtin' ^Z [2]+ Stopped python

mac gdctools $ nano GDCcore.py // I changed the GDCcore.py file here

mac gdctools $ python Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import GDCcore ^Z [3]+ Stopped python

mac gdctools $ gdc_mirror Traceback (most recent call last): File "/Users/mac/miniconda3/bin/gdc_mirror", line 7, in from gdctools.gdc_mirror import main File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/gdc_mirror.py", line 22, in import GDCcore ImportError: No module named 'GDCcore'

mac gdctools $ ls GDCcli.py pycache gdc_list.py lib GDCcore.py default.cfg gdc_loadfile.py tool_template.py GDCtool.py gdc_counts.py gdc_mirror.py init.py gdc_dice.py gdc_report.py

mac gdctools $ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 25, in from GDCtool import GDCtool File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/GDCtool.py", line 20, in import ConfigParser ImportError: No module named 'ConfigParser'

mac gdctools $ nano GDCtool.py

mac gdctools $ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 25, in from GDCtool import GDCtool File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/GDCtool.py", line 27, in from lib import common File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/lib/common.py", line 82 except OSError, value: ^ SyntaxError: invalid syntax

mac gdctools $ nano GDCtool.py mac gdctools $ cd mac ~ $ cd miniconda3/lib lib/ libexec/ mac ~ $ cd miniconda3/lib/python3.5/site-packages/gdctools/lib/ mac lib $ ls GDCSampleReport.R annotations_table.tsv common.py meta.py init.py api.py convert pycache clinxml.py heatmap.py mac lib $ cd .. mac gdctools $ cd lib/ mac lib $ nano common.py mac lib $ python gdc_mirror.py python: can't open file 'gdc_mirror.py': [Errno 2] No such file or directory mac lib $ cd .. mac gdctools $ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 25, in from GDCtool import GDCtool File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/GDCtool.py", line 28, in from lib import api File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/lib/api.py", line 219 except OSError, subprocess.CalledProcessError: ^ SyntaxError: invalid syntax mac gdctools $ nano lib/api.py mac gdctools $ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 27, in import lib.meta as meta File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/lib/meta.py", line 23, in from common import DATESTAMP_REGEX, ANNOT_TO_DATATYPE ImportError: No module named 'common'

$ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 319, in main() File "gdc_mirror.py", line 316, in main gdc_mirror().execute() File "gdc_mirror.py", line 32, in init super(gdc_mirror, self).init(version="0.9.1") File "/Users/mac/Desktop/gdc/gdctools/gdctools/GDCtool.py", line 33, in init self.cli = GDCcli(version=version) File "/Users/mac/Desktop/gdc/gdctools/gdctools/GDCcli.py", line 48, in init self.add_argument('--version',action='version',version=self.version) AttributeError: 'GDCcli' object has no attribute 'version' mac (master *) gdctools $ nano GDCcli.py

$ python gdc_mirror.py Traceback (most recent call last): File "gdc_mirror.py", line 319, in main() File "gdc_mirror.py", line 316, in main gdc_mirror().execute() File "gdc_mirror.py", line 292, in execute super(gdc_mirror, self).execute() File "/Users/mac/Desktop/gdc/gdctools/gdctools/GDCtool.py", line 40, in execute self.parse_config() File "/Users/mac/Desktop/gdc/gdctools/gdctools/GDCtool.py", line 111, in parse_config config.datestamps = os.path.join(config.root_dir, "datestamps.txt") File "/Users/mac/Desktop/gdc/gdctools/gdctools/GDCcore.py", line 92, in setattr if self.dict.has_key(item): AttributeError: 'dict' object has no attribute 'has_key'

mac gdctools $ cd lib/ mac lib $ ls GDCSampleReport.R annotations_table.tsv common.py meta.py init.py api.py convert pycache clinxml.py heatmap.py mac lib $ python Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import common ^Z [4]+ Stopped python mac lib $ nano meta.py mac lib $ gdc_mirror Traceback (most recent call last): File "/Users/mac/miniconda3/bin/gdc_mirror", line 7, in from gdctools.gdc_mirror import main File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/gdc_mirror.py", line 22, in import GDCcore ImportError: No module named 'GDCcore' mac lib $ python meta.py mac lib $ python common.py mac lib $ ls GDCSampleReport.R annotations_table.tsv common.py meta.py init.py api.py convert pycache clinxml.py heatmap.py mac lib $ nano init.py mac lib $ nano meta.py mac lib $ gdc_mirror Traceback (most recent call last): File "/Users/mac/miniconda3/bin/gdc_mirror", line 7, in from gdctools.gdc_mirror import main File "/Users/mac/miniconda3/lib/python3.5/site-packages/gdctools/gdc_mirror.py", line 22, in import GDCcore ImportError: No module named 'GDCcore'

It still wasn't working for me so I had to change the import statements in some more programs. basically, I changed imports statements like: "import GDCcore" to "import gdctools.GDCcore" and "import lib.common" to "gdctools.lib.common"

it's working for me for now.

noblem commented 7 years ago

Thank you SO MUCH for contributing commits and for the log file! We kinda figured it was Python3 vs Python2 thing: we still do our primary development in Python 2 (for various reasons, including that Google cloud toolkit is still Python 2). So I'm not sure yet that we'll be able to put your code directly into the main branch as is, but being compatible with both v2 and v3 of Python is a goal, and you've helped re-establish that, so we'll figure out how to make it work.

noblem commented 7 years ago

Dear Pranjal,

Just wanted to give you a heads-up that we've integrated the bulk of your changes into the GDCtools codebase. We made a few touchups and so did not use the pull request "as is," but a version 0.2.0 with your updates should be out by early next week, after final testing. Thanks again for contributing!

noblem commented 7 years ago

Hello Pranjal,

FYI: we've pushed to master v0.2.0 and drafted a release acknowledging your contributions. Thank you again, and be sure to pull the latest code!

aswanipranjal commented 7 years ago

Awesome! Thankyou!