beacon-biosignals / StableHashTraits.jl

Compute hashes over any Julia object simply and reproducibly
MIT License
7 stars 1 forks source link

Make use of `UseQualifiedName(UseFields())` in most cases. #22

Closed haberdashPI closed 1 year ago

haberdashPI commented 1 year ago

This greatly reduces the number of cases where you need to manually define hash_method yourself.

However this comes at the cost of changing what the hash value would be for many objects.

Since it already changed so much, I decided to clean up things a bit, so more things fallback to the Any method, breaking even more hashes.

And, since this is so ridiculously breaking anyways, I decided to throw in a bonus and make the API surface a bit more uniform: rather than using transform there is now UseTransform and UseAndReplaceContext hash methods (but see #24).

This now also changes the default hash context a bit, with the intention of making it easy to ensure your hash values don't change by explicitly specifying the version of the fallback hash context, HashVersion{1}.

codecov[bot] commented 1 year ago

Codecov Report

Merging #22 (9895f5a) into main (a894652) will decrease coverage by 0.21%. The diff coverage is 96.25%.

@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
- Coverage   97.82%   97.61%   -0.21%     
==========================================
  Files           1        1              
  Lines          92      126      +34     
==========================================
+ Hits           90      123      +33     
- Misses          2        3       +1     
Impacted Files Coverage Δ
src/StableHashTraits.jl 97.61% <96.25%> (-0.21%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

haberdashPI commented 1 year ago

@ssfrr whenever you get to reviewing this: over the weekend I realized I could simplify the API a fair bit, and so I've proposed an additional change to merge into main before 1.0 gets tagged. You can find that in #24 if you want to look at it; it's also possible that would be an easier to place to start review from (if you look at it re main rather than re `#22) if you haven't started, since I think it simplifies the code a bit.

haberdashPI commented 1 year ago

Superseded by #24