-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
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 |
|
||
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`` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
No description provided.