mapping-commons / sssom-py

Python toolkit for SSSOM mapping format
https://mapping-commons.github.io/sssom-py/index.html#
MIT License
49 stars 12 forks source link

Update type hints for prefix map merging #454

Closed cthoyt closed 10 months ago

cthoyt commented 11 months ago

This PR does the following:

  1. Creates a literal type for the 3 different prefix map merge modes
  2. Updates type hints based on that
cthoyt commented 11 months ago

@matentzn actually, I would much rather delete this functionality entirely and only support the PREFIX_MAP_MODE_MERGED mode. Given we spent lots of effort to make the curies integration, this option is much more powerful than before and I can't see why one would choose either of the others.

matentzn commented 11 months ago

We should be able at CLI time to allow an option to "fail if a prefix is not declared", like a "strict parsing" mode. This prevents cases like completely automated systems that accidentally infer a completely wrong prefix map for a dataset. I'd prefer to continue supporting that functionality, but I would be ok to move MERGED mode as default..

cthoyt commented 10 months ago

@matentzn I simplified this PR and took all of the questionable parts out. Now it's just about using type hints better.