-
Notifications
You must be signed in to change notification settings - Fork 13
Lazy-compute-ESS #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy-compute-ESS #52
Conversation
@sethaxen This PR adds a keyword arg for ESS calculations. If set to |
Codecov Report
@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 82.40% 82.13% -0.28%
==========================================
Files 11 11
Lines 341 347 +6
==========================================
+ Hits 281 285 +4
- Misses 60 62 +2
Continue to review full report at Codecov.
|
What I don't like about this approach is that it's still allocating a vector that the user doesn't necessarily want. I still prefer a lazy computation of the vector only if the user requests it, which can happen one of two ways:
I chose (1) earlier so that the same API is supported, but I slightly prefer something like (2). |
Do you think the extra allocation is a meaningful problem? When That being said, I just realized that memoizing |
It's not about the extra allocation, it's about complexity of the code and interface. Your proposal introduces an additional keyword argument and allocates a vector that is essentially empty, and this seems unnecessary, when you can use either of the two options I suggested. The first would do neither of these things, while the second would export one additional function; in neither case is the vector allocated unless the user requests it.
There's no need to memoize. A user is unlikely to call What do you dislike about either of the options I suggested? |
I'd be very surprised if no users at all want to see the ESS twice, given the ESS displays whenever a Psis object is called in the REPL. I suppose I have three concerns:
If you have concerns about returning an empty array for |
No description provided.