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

Fix code for reading uberon site mapping csv file #104

Open
msierk opened this issue Feb 4, 2025 · 2 comments
Open

Fix code for reading uberon site mapping csv file #104

msierk opened this issue Feb 4, 2025 · 2 comments

Comments

@msierk
Copy link
Collaborator

msierk commented Feb 4, 2025

Need to fix code in op_uberon_mapper for reading in oncopacket/src/oncopacket/ncit_mapping_files/CDA_primary_diagnosis_site_to_uberon.csv.

@justaddcoffee
Copy link
Member

Link to failing CI

@justaddcoffee
Copy link
Member

One solution might be something like this:

import importlib.resources

# Assuming the mapping file is inside the 'ncit_mapping_files' package (which is a subpackage of your module)
with importlib.resources.open_text('oncopacket.ncit_mapping_files', 'CDA_primary_diagnosis_site_to_uberon.csv') as f:
    site_to_uberon = pd.read_csv(f)

(Also probably best practice is to make PRs before merging into develop, and fix the CI failure in the branch for the PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants