-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add PiecewisePolynomial, QuaternionFunctionofTime, and Serialize Pybindings #6336
base: develop
Are you sure you want to change the base?
Add PiecewisePolynomial, QuaternionFunctionofTime, and Serialize Pybindings #6336
Conversation
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.
You can squash everything in directly. No need for fixups
std::shared_ptr<domain::FunctionsOfTime::FunctionOfTime>>& | ||
shared_deserialized_functions_of_time) { |
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.
You can just call this argument functions_of_time
. The fact that it's shared is just a python thing, and they are clearly deserialized (since it's not a vector<char>
)
unique_deserialized_functions_of_time{}; | ||
if (shared_deserialized_functions_of_time.contains("Expansion")) { |
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.
Just loop over all keys in the input map and call get_clone
. No need to get specific names
py::arg("serialized_functions_of_time")); | ||
py::class_<FunctionsOfTime::PiecewisePolynomial<3>, |
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.
Just for organization, move these classes right after the FunctionsOfTime::FunctionOfTime
class.
py::class_<FunctionsOfTime::PiecewisePolynomial<3>, | ||
FunctionsOfTime::FunctionOfTime, | ||
std::shared_ptr<FunctionsOfTime::PiecewisePolynomial<3>>>( |
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.
For the PiecewisePolynomial, let's bind both order 2 and 3. To avoid duplicating code, write a lambda that's templated and call that for 2 and 3 like so
const auto bind_piecewise_polynomial = [&]<size_t Order>() {
// code that you have now using Order
// Have each name be "PiecewisePolynomial" + std::to_string(Order)
};
bind_piecewise_polynomial.template operator()<2>();
bind_piecewise_polynomial.template operator()<3>();
(no need to do this for the Quat)
Proposed changes
Adds some pybindings necessary for creating volume data with functions of time in python.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments