You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4637 adds a lot of lines for adding a single pointwise function along with a compute item and pybindings. I wonder if we can eliminate some of the boilerplate code.. it distracts from spending time on the actual implementation of the function (the added equation is a single line in C++).
With boilerplate code I mean the majority of the lines in #4637 that don't require much (or any) thought, they just follow a fixed pattern:
Return-by-value and return-by-reference overloads
Compute tag + simple tag
Python bindings
Random-value tests, tag tests, Pybindings test
Here are a few ideas that @nilsdeppe and I discussed:
Eliminate the compute tag by computing quantities in a CachedTempBuffer, then expose the individual tags to the DataBox like we do for Variables (Expose CachedTempBuffer tags to DataBox #4649).
Move Python bindings into the file that defines the function so we don't have to add so many files. Have to be careful with enabling/disabling pybindings.
Test pointwise function pybindings in the C++ test by calling the python function with pypp.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
#4637 adds a lot of lines for adding a single pointwise function along with a compute item and pybindings. I wonder if we can eliminate some of the boilerplate code.. it distracts from spending time on the actual implementation of the function (the added equation is a single line in C++).
With boilerplate code I mean the majority of the lines in #4637 that don't require much (or any) thought, they just follow a fixed pattern:
Here are a few ideas that @nilsdeppe and I discussed:
CachedTempBuffer
, then expose the individual tags to the DataBox like we do forVariables
(Expose CachedTempBuffer tags to DataBox #4649).Beta Was this translation helpful? Give feedback.
All reactions