materialsproject / emmet

Be a master builder of databases of material properties. Avoid the Kragle.
https://materialsproject.github.io/emmet/
Other
51 stars 63 forks source link

Allow ULID for MPIDS #928

Closed jmmshn closed 5 months ago

jmmshn commented 5 months ago

Following the discussion here: https://github.com/materialsproject/jobflow/issues/519

Added support for ULID: Universally Unique Lexicographically Sortable Identifier

The idea is the UUIDs are random and they cannot be sorted for aggregate document creation. Since atomate2 will call some emmet.core documents directly we might not always have a chance to parse the task docs and assign MPIDs to everyone.

This PR does the following:

  1. Allows ULID to be used to as MPIDS
  2. The self.parts used for sorting are (ULID_ID, 0) which should enough to help sort the documents.
  3. Updated the logic in StructureGroup to allow for ULID comparison.
codecov-commenter commented 5 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4372799) 90.54% compared to head (b8be354) 88.88%.

Files Patch % Lines
emmet-core/emmet/core/mpid.py 81.81% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #928 +/- ## ========================================== - Coverage 90.54% 88.88% -1.67% ========================================== Files 139 109 -30 Lines 13203 10054 -3149 ========================================== - Hits 11955 8936 -3019 + Misses 1248 1118 -130 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.