nils-braun / b2luigi

Task scheduling and batch running for basf2 jobs made simple
GNU General Public License v3.0
17 stars 11 forks source link

add ability to pass a custom hash function #189

Closed MarcelHoh closed 1 year ago

MarcelHoh commented 1 year ago

I often find myself getting a bit annoyed at just how human unfriendly the hashed parameters are. In many cases, while the set of parameters might be a large dictionary, I can produce a unique string which allows me to identify the exact parameters passed, or it would be useful to just prepend a little information to a hash to make it easier to identify broad groups of tasks.

This PR adds the ability to use a custom hash function, for hashed parameters. This can be as easy as just joining the values of a list parameter with "_".join(x). It is up to the user to ensure that no duplicates are created and that names are of a reasonable length. The default behaviour remains unchanged.