Skip to content
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

Added Model Python interface #963

Merged
merged 6 commits into from
Apr 22, 2022
Merged

Added Model Python interface #963

merged 6 commits into from
Apr 22, 2022

Conversation

ahcorde
Copy link
Collaborator

@ahcorde ahcorde commented Apr 11, 2022

Signed-off-by: ahcorde ahcorde@gmail.com

🎉 New feature

This PR is part of this meta ticket #931

Require

Summary

Added Model Python interface

Test it

from sdformat import Model

model = Model()

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Alejandro Hernández <ahcorde@gmail.com>
@ahcorde ahcorde added the scripting Scripting interfaces to Ignition label Apr 11, 2022
@ahcorde ahcorde self-assigned this Apr 11, 2022
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Apr 11, 2022
@ahcorde ahcorde mentioned this pull request Apr 12, 2022
8 tasks
@ahcorde ahcorde marked this pull request as draft April 19, 2022 21:45
Copy link
Collaborator

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the return_value_policy::reference in pyModel.cc should all be
return_value_policy::reference_internal since the model should outlive the
objects it's returning by reference/pointer. Otherwise, LGTM!

python/src/sdf/pyModel.cc Outdated Show resolved Hide resolved
python/src/sdf/pyModel.cc Outdated Show resolved Hide resolved
python/src/sdf/pyModel.cc Outdated Show resolved Hide resolved
python/src/sdf/pyModel.cc Show resolved Hide resolved
python/src/sdf/pyModel.cc Outdated Show resolved Hide resolved
python/test/pyModel_TEST.py Outdated Show resolved Hide resolved

class ModelTEST(unittest.TestCase):

def test_default_construction(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent with 4 spaces.

@ahcorde ahcorde marked this pull request as ready for review April 22, 2022 17:35
@ahcorde ahcorde requested a review from azeey April 22, 2022 17:35
@codecov-commenter
Copy link

Codecov Report

Merging #963 (6325ac8) into main (f7f3417) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #963   +/-   ##
=======================================
  Coverage   66.66%   66.66%           
=======================================
  Files           2        2           
  Lines          27       27           
=======================================
  Hits           18       18           
  Misses          9        9           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bda630c...6325ac8. Read the comment docs.

@ahcorde ahcorde merged commit 0f25399 into main Apr 22, 2022
@ahcorde ahcorde deleted the ahcorde/python/model branch April 22, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden mujoco scripting Scripting interfaces to Ignition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants