-
Notifications
You must be signed in to change notification settings - Fork 67
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
Adds python interface to MaterialType and Material. #234
Conversation
Signed-off-by: LolaSegura <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-math6 #234 +/- ##
==========================================
Coverage 99.41% 99.41%
==========================================
Files 67 67
Lines 6347 6347
==========================================
Hits 6310 6310
Misses 37 37 Continue to review full report at Codecov.
|
friendly ping @scpeters |
Signed-off-by: ahcorde <[email protected]>
53a6420
to
e69094b
Compare
Thanks @ahcorde for taking over the PR and completing it! 🚀 |
🎉 New feature
Related to #101 #210
Summary
Adds Python interface for three math classes: MaterialType, Material. For each Material a python test has been created.
Related issues and notes
MaterialType
This file contains an
enum class
declaration. Swig supports strongly typed enumerations, so binding this wasn't a problem. But the result was a series of variables contained in the moduleignition.math
defined asMaterialType_MATERIAL
. A work around is needed to be implemented in order to follow the pep-8 naming convention.Material
The test is not passing.
This class contains a method
Predefined()
that returns a reference to anstd::map<MaterialType, Material>
. InSignalStats
a map was used as well, so a similar approach was taken for this case. There are two main differences in both of this classes:SignalStats
the map is returned as a copy andstd::string
anddouble
.In the case of
Material
the method is not being wrapped correctly. Instead of being part of theMaterial
class, is defined outside of it, and when it is used in the test as follow:it arises an error:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge