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

[SofaCore] Restore xml and python different naming conventions #2773

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

alxbilger
Copy link
Contributor

Based on the discussion started in #2631 and finished during a dev meeting, this PR restores the old behavior:

  • Two different conventions based on whether the scene is in XML or Python
  • XML suffixes start at 1

Nevertheless, the class that provides the names is still common.

[ci-depends-on https://github.com/sofa-framework/SofaPython3/pull/241]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request labels Mar 10, 2022
@sofabot
Copy link
Collaborator

sofabot commented Mar 10, 2022

[ci-depends-on] detected during build #1.

To unlock the merge button, you must

@alxbilger alxbilger changed the title Restore xml and python different naming conventions [SofaCore] Restore xml and python different naming conventions Mar 10, 2022
@alxbilger
Copy link
Contributor Author

[ci-build][with-all-tests]

@sofabot
Copy link
Collaborator

sofabot commented Mar 10, 2022

[ci-depends-on] detected during build #2.

To unlock the merge button, you must

@guparan guparan added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Mar 16, 2022
@fredroy fredroy merged commit 9c5e4b3 into sofa-framework:master Mar 17, 2022
fredroy pushed a commit to fredroy/sofa that referenced this pull request Mar 17, 2022
@EulalieCoevoet
Copy link
Contributor

EulalieCoevoet commented Mar 22, 2022

Hi,

Me again... Sorry I didn't notice but the old behavior has not been really restored. Before, the default name was FreeMotionAnimationLoop, for instance, and now it is freeMotionAnimationLoop which still breaks my (our) scenes.

@damienmarchal
Copy link
Contributor

damienmarchal commented Mar 22, 2022

To me this change is a perfect use case for the Lifcycle feature management introduced in:
sofa-framework/SofaPython3#184

With such it would be trivial when loading a scene to write something like that:

from Sofa.Lifecycle import __feature__

def myOldNamingScene(root):
    """A scene or prefab that use the old naming scheme"""
     pass

def myNewNamingScene(root):
    """A scene or prefab that use the new naming scheme"""
    pass

def createScene(root):
     with __feature__("uniform-naming-scheme",True):
           myNewNamingScene(root)
           
     myOldNamingScene(root)                     

@alxbilger
Copy link
Contributor Author

Before, the default name was FreeMotionAnimationLoop, for instance, and now it is freeMotionAnimationLoop which still breaks my (our) scenes.

Sorry, I thought it was the opposite due to https://peps.python.org/pep-0008/#function-and-variable-names. So, let's merge #2801

@guparan guparan added this to the v22.06 milestone Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants