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

added utility function to parse npx files and added specific artifact… #158

Merged
merged 5 commits into from Sep 4, 2019

Conversation

@jim-bo
Copy link
Contributor

commented Sep 4, 2019

… to hold detailed information

@jim-bo jim-bo requested a review from jacoblurye Sep 4, 2019

@jacoblurye
Copy link
Collaborator

left a comment

Looks good! Just one question about invalid Olink files.

def parse_npx(xlsx_path: Union[str, BinaryIO]):
"""
Parses the given NPX file from OLINK
to extrat a list of aliquot IDs

This comment has been minimized.

Copy link
@jacoblurye

jacoblurye Sep 4, 2019

Collaborator

extract 🙂

This comment has been minimized.

Copy link
@jim-bo

jim-bo Sep 4, 2019

Author Contributor

fixed

seen_onlinkid = False
for i, row in enumerate(worksheet.iter_rows()):

# Convert to string and extract type annotation

This comment has been minimized.

Copy link
@jacoblurye

jacoblurye Sep 4, 2019

Collaborator

Don't think this comment still applies

This comment has been minimized.

Copy link
@jim-bo

jim-bo Sep 4, 2019

Author Contributor

cleaned this up

# simplify.
worksheet = workbook[worksheet_name]
header_width = 0
seen_onlinkid = False

This comment has been minimized.

Copy link
@jacoblurye

jacoblurye Sep 4, 2019

Collaborator

What if we never encounter an Olink ID row? Does that mean the file is invalid? If so, we should probably raise some sort of error.

This comment has been minimized.

Copy link
@jim-bo

jim-bo Sep 4, 2019

Author Contributor

added to docstring explaining it will return empty list for poorly formatted xlsx. For files which it is unable to open, it will raise whatever errors openpyxl does.

jim-bo added 2 commits Sep 4, 2019

@jim-bo jim-bo requested a review from jacoblurye Sep 4, 2019

@jim-bo

This comment has been minimized.

Copy link
Contributor Author

commented Sep 4, 2019

@jacoblurye I addressed comments, please confirm

@jacoblurye

This comment has been minimized.

Copy link
Collaborator

commented Sep 4, 2019

Oh, and be sure to bump the cidc-schemas package version before merging.

@jim-bo jim-bo merged commit d33c55e into master Sep 4, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jim-bo jim-bo deleted the npx_artifact branch Sep 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.