Skip to content

Update to sssom-pydantic v0.4.0 and sssom-curator v0.3.0#258

Merged
cthoyt merged 8 commits into
mainfrom
update-sssom-curator
Apr 11, 2026
Merged

Update to sssom-pydantic v0.4.0 and sssom-curator v0.3.0#258
cthoyt merged 8 commits into
mainfrom
update-sssom-curator

Conversation

@cthoyt
Copy link
Copy Markdown
Member

@cthoyt cthoyt commented Apr 11, 2026

This PR updates Biomappings to use the newer version of sssom-pydantic and sssom-curator. Importantly, this fixes a bug with the canonical sorting of SSSOM TSV files to be conformant with the spec. It also changes the way that unsure mappings are stored to use the newly added reviewer_agreement field with a value of 0.0.

This is the script used to update the "unsure" mappings file

from pathlib import Path

import click
import sssom_pydantic
from curies.vocabulary import lexical_matching_process
from sssom_pydantic import SemanticMapping

UNSURE_PATH = Path(__file__).parent.joinpath("unsure.sssom.tsv")


@click.command()
def main() -> None:
    """Fix mappings."""
    mappings, converter, metadata = sssom_pydantic.read(UNSURE_PATH)
    mappings = [fix_mapping(m) for m in mappings]
    sssom_pydantic.write(mappings, UNSURE_PATH, converter=converter, metadata=metadata)


def fix_mapping(mapping: SemanticMapping) -> SemanticMapping:
    return mapping.model_copy(
        update={
            "justification": lexical_matching_process,
            "reviewers": mapping.authors,
            "authors": None,
            "reviewer_agreement": 0.0,
        }
    )

if __name__ == "__main__":
    main()

@cthoyt cthoyt merged commit ab9d224 into main Apr 11, 2026
@cthoyt cthoyt deleted the update-sssom-curator branch April 11, 2026 18:58
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.

1 participant