Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
worker_db: Only warn on repeated archive read if dataset changed
In larger experiments, it is quite natural for the same dataset to be read from multiple unrelated components. The only situation where multiple reads from an archived dataset are problematic is when the valeu actually changes between reads. Hence, this commit restricts the warning to the latter situation.
- Loading branch information
4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test that, also with arrays?
4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did (as in, two of our experiments are running with the commit), though not with arrays.
What are you concerned about in particular – did it break any of your code? (Writing AA code in a way that only uses one lookup is an old habit, but probably entirely unnecessary here…)
4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array equality is element-wise. Even if the shapes are compatible, the resulting boolean array does not automatically become a bool. I am pretty sure this will error when data is an array.
4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, numpy arrays… I have been using Julia a lot lately, and their design for array types is much better – for starters, it has the huge advantage that it doesn't violate the language specification ("Comparisons yield boolean values:
True
orFalse
").Easiest fix is probably just to drop the check altogether – opinions? I could also catch
ValueError
s to work around the NumPy issue.4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd handle arrays (np.all()) and catch broadcast failure.
4cfb47d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or already bail if the naive comparison fails (i.e. don't support multiple retrieval of an array)