Conversation
(cherry picked from commit 1fcc76f931d3173620471dd3da146927425da6e3)
…eing bytes instead of str
|
Will this approach work with asynchronous loading, as done in the Lab? |
It needs more work, but it should be fairly easy. How does the asynchronicity work in Lab? Are the WX callbacks different threads? |
While loading, the length of an |
|
I think the way I would choose to do it would be to use a lock so that if the file is still loading (but not caching) it would have to wait. Here's basically how I would want to change it:
This should be a fast and thread-safe way to access the data. |
|
|
||
| def _initializeCache(self, *args, **kwargs): | ||
| """ Creates a cache of the raw data, either in memory or on disk """ | ||
| from .parsers import ChannelDataArrayBlock |
There was a problem hiding this comment.
It is probably best to avoid imports within functions/methods unless there's a special reason for it.
| and self.allowMeanRemoval == other.allowMeanRemoval | ||
|
|
||
| def _initializeCache(self, *args, **kwargs): | ||
| raise NotImplemented("EventArrays don't support caching") |
There was a problem hiding this comment.
Since this isn't a method called by a user, would this be better as a warning?
There was a problem hiding this comment.
I should probably just have it refer up to the parent instead of raising an error. I'm going to be reworking the caching soon-ish so it may become moot.
…uff and update old x-unit unittest code to pytest
|
caching is now sufficiently implemented in #49 to remove this PR |
Still some work left to be done, but here's an overview of what's been finished so far.
arraySliceinEventArrayto more effectively utilize the cached datarawArraySliceandcalibrateRawArraymethods which will reduce computation even further.inPlacetransform methods which will, when possible, re-use memory.EventArray