usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

Get rid of Dill and the version constraint we have on it #228

Closed joefowler closed 1 year ago

joefowler commented 1 year ago

Original report by Joseph Fowler (Bitbucket: joe_fowler, ).


We have a requirement of Dill be a strict version number "dill==0.3.5.1" in setup.py. That is really not a sustainable solution.

@{557058:9524f6a0-ef9f-4466-b913-d04e51ff9093} thinks that with a certain amount of fiddling with the tests that use Dill can be rewritten to NOT use Dill.

joefowler commented 1 year ago

Original comment by Galen O'Neil (Bitbucket: oneilg, GitHub: oneilg).


It’s not just the tests, the entire functionality of saving a RecipeBook (which currently only Dan Becker is using experimentally) relies on saving lambda functions. The way to fix this is replace each use of a lambda function with a purpose built class. It’s a lot more code, and less flexible in the end. But probably cleaner in the regular cases.

Lets leave this open, but lets wait a while until we see if the functionality is actually useful in practice.

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


As you saw in the email from our Gaithersburg colleague today, this caused 2 tests to fail on his particular installation (Mac, homebrew, python 3.11). I don’t know what it means--maybe brew ignored your strict version requirement on dill?

As to how nice lambdas are…have you considered saving not the functions themselves, but strings that can evaluate to the functions? That sounds a lot more portable, though I admit to not knowing anything about this specific problem. I guess Python doesn’t have a way to convert a lambda back to an example of a string that could evaluate to it, does it?

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Fixed in c5999c4

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Removing milestone: v0.7 (automated comment)