-
Notifications
You must be signed in to change notification settings - Fork 186
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
Cute compute! for AbstractOperation #2235
Conversation
Bah, I realized this won't work because we have to call We can support this if we change that interface, eg if we add something |
Honestly I think this is already pretty handy and enforces the idea that in order to compute something it needs to be a field. When I was starting with Oceananigans it took me a while to understand that I couldn't put abstract operations into the output writers because the computation would fail. I think something like you're proposing would have added to my confusion. Also, I only recently became aware that this existed. Maybe we should document the |
This makes sense to me --- after all, who cares what a |
Isn't the confusion a problem with the output writers API? I think it sounds like a great idea to support |
Hmm, I think the key concept here is that in order to store the result of a computation, we need to allocate memory. That's what invoking It's worth mentioning for posterity the subtlety that calling |
I'll close this PR because, in addition to it being unpopular, there's too much work we need to do to support it. Maybe something will come out of #2242 though. |
The confusion is that I wasn't aware that that a If we make it so that users don't have to know what a |
Might be useful at the REPL for interactive stuff cause you can write
for example.
If people like, I'll add docs and a test or two.
I guess the equivalent one-liner right now is
and the equivalent two-liner is