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

Deprecate get_metadata_and_prefix_map #486

Merged
merged 8 commits into from
Jan 16, 2024
Merged

Deprecate get_metadata_and_prefix_map #486

merged 8 commits into from
Jan 16, 2024

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Jan 15, 2024

This function used to be used in OAK's lexical matcher pipeline, but has since been removed. Now, the only place it's (potentially mis)used is in the MONDO ingest pipeline (see https://github.com/search?q=get_metadata_and_prefix_map+-is%3Afork+-user%3Amapping-commons&type=code)

This PR deprecates it, and we can remove it in a future version.

This function used to be used in OAK's lexical matcher pipeline, but has since been removed. Now, the only place it's (mis)used is in the MONDO ingest pipeline (see https://github.com/search?q=get_metadata_and_prefix_map+-is%3Afork+-user%3Amapping-commons&type=code)

This PR deprecates it, and we can remove it later.
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to discuss things like this on issues before we enact them, but lets leave that for the future;

Here my question is: if we make this method private, do we still have a utility method to load a externally defined sssom metadata file? Like

https://github.com/mapping-commons/sssom/blob/master/examples/external/example1.sssom.yml

In the case of
https://mapping-commons.github.io/sssom/spec/#external-mode

In other words, I am missing a bit the motivation behind the deprecation.

src/sssom/io.py Outdated Show resolved Hide resolved
@cthoyt
Copy link
Member Author

cthoyt commented Jan 16, 2024

Here my question is: if we make this method private, do we still have a utility method to load a externally defined sssom metadata file?

No, we don't. Since external metadata is a YAML file, I don't think we even need one, since you can do one of the following:

  1. Use the SSSOM-py parsers that handle these files implicitly
  2. import a standard YAML processor if you want to work with it directly

The issue with having a built in function is it has super confusing semantics about how it combines metadata already inside the YAML file with some other metadata given ad hoc. I don't think we should have a function that does this and ask downstream users to implement their own merging, since it will always have different needs.

@joeflack4
Copy link
Collaborator

@matentzn Haven't put much thought in it yet, but I think it's possible that @cthoyt may be right. I can probably refactor mondo-ingest to do what it needs to do without relying on sssom-py for this.

@matentzn
Copy link
Collaborator

matentzn commented Jan 16, 2024

I don't think we should have a function that does this and ask downstream users to implement their own merging, since it will always have different needs.

Fair enough. We can provide a wrapper of sssom parse later when a user requests it.

@matentzn Haven't put much thought in it yet, but I think it's possible that @cthoyt may be right. I can probably refactor mondo-ingest to do what it needs to do without relying on sssom-py for this.

Thanks for looking into this.

matentzn
matentzn previously approved these changes Jan 16, 2024
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @cthoyt for your infinite energy!

@cthoyt
Copy link
Member Author

cthoyt commented Jan 16, 2024

@matentzn I forgot an import, can you please approve this again

@cthoyt cthoyt merged commit d6d62cc into master Jan 16, 2024
6 checks passed
@cthoyt cthoyt deleted the make-private branch January 16, 2024 13:20
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.

3 participants