Adds python interface to MaterialType and Material.#234
Merged
Conversation
Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
45 tasks
7 tasks
Signed-off-by: ahcorde <ahcorde@gmail.com>
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.
|
Contributor
|
friendly ping @scpeters |
Signed-off-by: ahcorde <ahcorde@gmail.com>
53a6420 to
e69094b
Compare
scpeters
approved these changes
Oct 7, 2021
Contributor
|
Thanks @ahcorde for taking over the PR and completing it! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 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 classdeclaration. Swig supports strongly typed enumerations, so binding this wasn't a problem. But the result was a series of variables contained in the moduleignition.mathdefined 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>. InSignalStatsa map was used as well, so a similar approach was taken for this case. There are two main differences in both of this classes:SignalStatsthe map is returned as a copy andstd::stringanddouble.In the case of
Materialthe method is not being wrapped correctly. Instead of being part of theMaterialclass, is defined outside of it, and when it is used in the test as follow:it arises an error:
Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge