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

Code cleanup: Improve CLI #23

Merged
merged 14 commits into from
Apr 30, 2019
Merged

Code cleanup: Improve CLI #23

merged 14 commits into from
Apr 30, 2019

Conversation

ayan-b
Copy link
Collaborator

@ayan-b ayan-b commented Apr 12, 2019

  • equal_matrices (tests added)
  • make_metadata (tests added)
  • merge_xena (tests added)
  • gdc_check_new
  • gdc2xena

Also set-up initial parser
Related to #16.

See also https://github.com/yunhailuo/xena-GDC-ETL/pull/17#issuecomment-475110147

@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 12, 2019

Current argparser setup:
xge xena-eql df1 df2
Let me know if this is good to go, I will then send a commit updating the docs.

@yunhailuo
Copy link
Collaborator

Can you remind me about the overall structure/design of the CLI?

@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 13, 2019

@yunhailuo, it is discussed here: https://github.com/yunhailuo/xena-GDC-ETL/issues/16#issue-421366023. Our target is to have a single CLI for the whole package instead of for individual modules.

@yunhailuo
Copy link
Collaborator

Trying to test this PR but find a potential problem with 4c11c57. Somehow having xena_gdc_etl/scripts/__init__.py prevent me from installing using pip install ./ under a simple conda python 2.7 environment. Part of the error log:

  running build_scripts
  creating build/scripts-2.7
  copying and adjusting xena_gdc_etl/scripts/make_metadata.py -> build/scripts-2.7
  copying and adjusting xena_gdc_etl/scripts/gdc2xena.py -> build/scripts-2.7
  copying and adjusting xena_gdc_etl/scripts/gdc_check_new.py -> build/scripts-2.7
  copying xena_gdc_etl/scripts/equal_matrices.py -> build/scripts-2.7
  copying and adjusting xena_gdc_etl/scripts/TARGET-CCSK_phenotype_ETL.py -> build/scripts-2.7
  copying and adjusting xena_gdc_etl/scripts/panTCGA.py -> build/scripts-2.7
  warning: build_scripts: xena_gdc_etl/scripts/__init__.py is an empty file (skipping)
  
  copying and adjusting xena_gdc_etl/scripts/merge_xena.py -> build/scripts-2.7
  copying xena_gdc_etl/scripts/join_xena.sh -> build/scripts-2.7
  copying xena_gdc_etl/scripts/union_xena.sh -> build/scripts-2.7
  changing mode of build/scripts-2.7/make_metadata.py from 644 to 755
  changing mode of build/scripts-2.7/gdc2xena.py from 644 to 755
  changing mode of build/scripts-2.7/gdc_check_new.py from 644 to 755
  changing mode of build/scripts-2.7/TARGET-CCSK_phenotype_ETL.py from 644 to 755
  changing mode of build/scripts-2.7/panTCGA.py from 644 to 755
  error: [Errno 2] No such file or directory: 'build/scripts-2.7/__init__.py'
  
  ----------------------------------------
  Failed building wheel for xena-gdc-etl
  Running setup.py clean for xena-gdc-etl
Failed to build xena-gdc-etl

I know travis tests all pass. I'm wondering:

  1. Do we test the install of the repo in travis?
  2. Do you have any problems pip install?

@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 15, 2019

During development, I use python setup.py develop in order to install the package. So, I have never faced the issue, thanks for pointing out.

  1. Do we test the install of the repo in travis?

No, I will add a commit addressing this.
[UPD: Done in 3dfd603]

  1. Do you have any problems pip install?

Yes, it turns out that the problem lies in the name of directory scripts. If we change the directory name to something else (say xena_scripts), pip install works as expected. Let me know if you have a suitable name for the directory in your mind.

@yunhailuo
Copy link
Collaborator

If we change the directory name to something else (say xena_scripts), pip install works as expected.

I think this is defined in setup.py. They are scripts, not modules. So it shouldn't have__init__.py.

However, I do know we are going to have command line and get rid of scripts for good eventually.

Let me know when the PR is ready.

@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 16, 2019

Ok, I will get rid of __init__py. However this creates a problem, it seems pytest can only discover and test modules, not individual scripts.

@ayan-b ayan-b changed the title Code cleanup: Move equal_matrices into utils Code cleanup: Improve CLI Apr 28, 2019
@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 28, 2019

@yunhailuo This PR is ready except for gdc2xena module. It is a bit large and requires proper test cases before moving into utils.

Also add tests for make_metadata
@ayan-b ayan-b force-pushed the prog branch 2 times, most recently from 8620412 to b4de160 Compare April 29, 2019 09:13
@ayan-b
Copy link
Collaborator Author

ayan-b commented Apr 29, 2019

@yunhailuo, please review.

@yunhailuo
Copy link
Collaborator

Looks good. Thank you!

@yunhailuo
Copy link
Collaborator

If possible, it will be better to have commits group together. Or separate features into different PRs. @ayan-b

@yunhailuo yunhailuo merged commit 59682e1 into ucscXena:master Apr 30, 2019
@ayan-b ayan-b deleted the prog branch May 1, 2019 02:36
@ayan-b ayan-b mentioned this pull request May 1, 2019
This was referenced May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants