Skip to content

Pymechanical update1#69

Draft
rs-bh-n wants to merge 3 commits into
mainfrom
pymechanical-update1
Draft

Pymechanical update1#69
rs-bh-n wants to merge 3 commits into
mainfrom
pymechanical-update1

Conversation

@rs-bh-n

@rs-bh-n rs-bh-n commented Feb 27, 2024

Copy link
Copy Markdown
Collaborator

fixed a typo.
added add_mechanical_python_libraries
added Enum argument on globals() and modified the example code accordingly

@rs-bh-n rs-bh-n marked this pull request as draft February 27, 2024 06:46
@rs-bh-n rs-bh-n requested a review from klmcadams February 27, 2024 06:47
@rs-bh-n rs-bh-n marked this pull request as ready for review February 27, 2024 06:50
@rs-bh-n

rs-bh-n commented Feb 27, 2024

Copy link
Copy Markdown
Collaborator Author

Hi @klmcadams ,

please review .

@RobPasMue

Copy link
Copy Markdown
Member

I think we should include the version of PyMechanical somewhere... and if it is already there, we should update it to the latest released version

@klmcadams klmcadams left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks good! I added comments with the version of ansys-mechanical-core required to use the code that was added to the cheatsheet. @RobPasMue is this what you were thinking, or were you talking about adding the latest version in the title instead?

# Merge them into your Python global variables
globals().update(global_variables(app))
# Optional argument for Enums without namespaces
globals().update(global_variables(app),True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
globals().update(global_variables(app),True)
# Available in ansys-mechanical-core >= v0.10.3
globals().update(global_variables(app),True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has been modified with latest way of updating globals

globals().update(global_variables(app))
# Optional argument for Enums without namespaces
globals().update(global_variables(app),True)
# Import Python modules shipped with Mechanical

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
# Import Python modules shipped with Mechanical
# Import Python modules shipped with Mechanical
# Available in ansys-mechanical-core >= v0.10.3

@klmcadams klmcadams requested a review from koubaa February 27, 2024 14:50
globals().update(global_variables(app),True)
# Import Python modules shipped with Mechanical
from ansys.mechanical.core.embedding import add_mechanical_python_libraries
add_mechanical_python_libraries(241)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Two comments -

  1. I don't see where these libraries are used.

  2. better to make the version number a variable so that the same number is guaranteed to be used by add_mechanical_python_libraries() and app = App()

@rs-bh-n

rs-bh-n commented Mar 13, 2024

Copy link
Copy Markdown
Collaborator Author

I think we should include the version of PyMechanical somewhere... and if it is already there, we should update it to the latest released version

Hi @RobPasMue @koubaa , Do you think we can minor version too on the header (like pyAEDT cheatsheet does. snapshot below)?
image

@rs-bh-n rs-bh-n marked this pull request as draft April 15, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants