-
Notifications
You must be signed in to change notification settings - Fork 139
feat: allow passing strings to the converter from the terminal #3679
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
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
by the way, the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3679 +/- ##
==========================================
+ Coverage 87.88% 88.13% +0.24%
==========================================
Files 187 187
Lines 14710 14697 -13
==========================================
+ Hits 12928 12953 +25
+ Misses 1782 1744 -38 |
…. Better behavior. Adding short options. Improved tests
…tps://github.com/ansys/pymapdl into feat/adding-passing-string-to-convert-cli
Some timing: on main hyperfine --warmup 3 --runs 5 'pytest -k pipe'
Benchmark 1: pytest -k pipe
Time (mean ± σ): 5.864 s ± 0.123 s [User: 2.532 s, System: 0.885 s]
Range (min … max): 5.708 s … 5.986 s 5 runs now$ hyperfine --warmup 3 --runs 5 'pytest -k pipe'
Benchmark 1: pytest -k pipe
Time (mean ± σ): 7.719 s ± 0.304 s [User: 3.396 s, System: 1.164 s]
Range (min … max): 7.314 s … 8.135 s 5 runs the time difference is because now we do two tests instead of 1. Each one takes 2s, whereas in main it takes 1.95 aprox. |
…tps://github.com/ansys/pymapdl into feat/adding-passing-string-to-convert-cli
@pyansys-ci-bot LGTM. |
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.
…tring-to-convert-cli
Description
As the title, so we can do:
This example demonstrates the main use of this tool:
$ pymapdl convert -f mapdl.dat -o python.py
If you omit the output argument, the converted code is shown on the screen.
You can use any option from
ansys.mapdl.core.convert.convert_apdl_block
function:You can skip the imports, and the launching and exit calls if the option
--only-code
(-oc
)is given.
You can also pipe content from files o command line into the converter.
Issue linked
NA
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)