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

add method to update globals #767

Merged
merged 6 commits into from
Jun 12, 2024
Merged

add method to update globals #767

merged 6 commits into from
Jun 12, 2024

Conversation

koubaa
Copy link
Collaborator

@koubaa koubaa commented Jun 11, 2024

No description provided.

@koubaa koubaa requested a review from a team as a code owner June 11, 2024 18:28
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 11, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.91%. Comparing base (8b3641b) to head (6241c7e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #767      +/-   ##
==========================================
- Coverage   81.68%   80.91%   -0.77%     
==========================================
  Files          32       32              
  Lines        1982     1986       +4     
==========================================
- Hits         1619     1607      -12     
- Misses        363      379      +16     

@koubaa koubaa merged commit 85122fd into main Jun 12, 2024
57 checks passed
@koubaa koubaa deleted the simplify-update-globals branch June 12, 2024 13:58

app = App()
# The following line extracts the global API entry points and merges them into your global
# Python global variables.
globals().update(global_variables(app))
app.update_globals(globals())

Some enum types are available when scripting inside of mechanical, such as ``SelectionTypeEnum``
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mechanical

included in these global variables. To include enums, set the second argument of
``global_variables`` to True.
or ``LoadDefineBy``. Because these number in the thousands, by default, these enums are
included in these global variables. To avoid including them, set the second argument of
Copy link
Collaborator

Choose a reason for hiding this comment

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

To not include them,

`app.update_globals(globals())`

By default, all enums will be imported too. To avoid including enums, set
the `enums` argument to False.
Copy link
Collaborator

Choose a reason for hiding this comment

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

By default, all enums will also be imported. To not import enums, set the enums argument to False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants