Skip to content

Possible unnecessary error checking loading from included contexts #75

@ptgolden

Description

@ptgolden

While investigating monarch-initiative/monarch-app#819, I noticed a bottleneck in loading the "merged" context in these lines in curie:

https://github.com/biopragmatics/curies/blob/47d1f22e3aba42ea365cd7e99403eacfede4af5a/src/curies/api.py#L527-L533

Is it necessary to check for duplicate prefixes on known-good prefix maps (i.e. those bundled with this package)? If not, the converter loaded here:

if isinstance(names, str):
return load_context(names, refresh=refresh).as_converter()

can be initialized with strict=False, resulting in a speedup of about ~15s on the "merged" context. I am happy to create a PR if that sounds okay.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions