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

Add additional options to compress and expand #79

Merged
merged 11 commits into from
Oct 13, 2023
Merged

Add additional options to compress and expand #79

merged 11 commits into from
Oct 13, 2023

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Oct 13, 2023

Closes #63

This PR adds the strict and passthrough option, since many people typically implement these operations themselves. It also adds more specific examples to the "getting started" tutorial for these.

This means for @shawntanzk's use case, you can add passthrough=True when calling

import curies
import pandas as pd

uris = [
    "http://purl.obolibrary.org/obo/GO_0000010",
    "http://purl.obolibrary.org/obo/GO_0000011",
    "http://gudt.org/schema/gudt/baseCGSUnitDimensions",
    "http://qudt.org/schema/qudt/conversionMultiplier",
]
df = pd.DataFrame({"uri": uris})

converter = curies.get_obo_converter()
converter.pd_compress(df, column="uri", target_column="curie")

Gives

uri curie
http://purl.obolibrary.org/obo/UBPROP_0000010 GO:0000010
http://purl.obolibrary.org/obo/UBPROP_0000011 GO:0000011
http://gudt.org/schema/gudt/baseCGSUnitDimensions
http://qudt.org/schema/qudt/conversionMultiplier

But when adding passthrough=True in converter.pd_compress(df, column="uri", target_column="curie", passthrough=True), gives:

uri curie
http://purl.obolibrary.org/obo/GO_0000010 GO:0000010
http://purl.obolibrary.org/obo/GO_0000011 GO:0000011
http://gudt.org/schema/gudt/baseCGSUnitDimensions http://gudt.org/schema/gudt/baseCGSUnitDimensions
http://qudt.org/schema/qudt/conversionMultiplier http://qudt.org/schema/qudt/conversionMultiplier

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Merging #79 (892bc15) into main (135988c) will decrease coverage by 0.98%.
Report is 9 commits behind head on main.
The diff coverage is 95.54%.

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
- Coverage   99.32%   98.35%   -0.98%     
==========================================
  Files           9       10       +1     
  Lines         593      729     +136     
  Branches      127      170      +43     
==========================================
+ Hits          589      717     +128     
- Misses          3       10       +7     
- Partials        1        2       +1     
Files Coverage Δ
src/curies/__init__.py 100.00% <100.00%> (ø)
src/curies/version.py 100.00% <100.00%> (ø)
src/curies/reconciliation.py 99.06% <99.06%> (ø)
src/curies/api.py 97.42% <87.50%> (-1.47%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cthoyt cthoyt enabled auto-merge (squash) October 13, 2023 15:39
@cthoyt cthoyt disabled auto-merge October 13, 2023 15:48
@cthoyt cthoyt merged commit 9c1d965 into main Oct 13, 2023
6 of 8 checks passed
@cthoyt cthoyt deleted the overloads branch October 13, 2023 15:49
cthoyt added a commit that referenced this pull request Oct 13, 2023
As a follow-up to #79, this PR adds options for strict and passthrough
to standardization
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

Successfully merging this pull request may close these issues.

curies convertor returns none instead of ignoring when it does not match anything
2 participants