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

Make instantiation of Grounder more flexible #15

Merged
merged 4 commits into from Mar 17, 2020

Conversation

@cthoyt
Copy link
Contributor

cthoyt commented Mar 16, 2020

This PR allows the user to either specify the terms_file argument to Grounder.__init__() as either a:

  • None -> look up the default path using gilda.resources.get_grounding_terms() as well as ensure the data has been downloaded from Amazon
  • str -> use the grounding terms file at the given path
  • dict -> use a pre-made dictionary of normalized names to terms, with the same structure as gilda.grounder.load_terms_file() returns

As a consequence, the redundant callings of Grounder(get_grounding_terms()) have been simplified to just Grounder().

cthoyt added 3 commits Mar 16, 2020
This allows the user to either specify terms_file as:
- None -> look up the path and download the data from Amazon if necessary (old functionality)
- str -> look up the grounding terms file at the given path
- dict -> use a pre-made dictionary of normalized names to terms
Becuase of the functionality added in the last commit, the grounding terms path is looked up automatically (using the same get_grounding_terms() function) if none is given.
@bgyori bgyori force-pushed the cthoyt:improve-api-extensibility branch from 51b7851 to 3ee07f4 Mar 17, 2020
@bgyori bgyori merged commit 3e5ff23 into indralab:master Mar 17, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cthoyt cthoyt deleted the cthoyt:improve-api-extensibility branch Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.