-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat: apdl
submodule
#3385
base: feat/main_commands
Are you sure you want to change the base?
feat: apdl
submodule
#3385
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
I am setting this PR as draft because I think it is still not ready until you fix the line length thing. Ping us and switch this PR to non-draft when you feel it is ready for it. |
I can rework on it if docstring length is a priority. I already fixed some issues related in ansys/pyconverter-xml2py#222 but not all of them as you can see. Also, I had to comment the |
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
ac7b46a
to
04dac45
Compare
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.
Overall LGTM - couldn't really evaluate whether all the changes make sense or not but the logic seems properly done and the docstrings are really nicely formatted (for being autogenerated).
My concern is only about modules that have been renamed completely (take array_param
to array_parameters
. Maybe we should "keep" the old file, throw a warning saying that this module is deprecated, and import all the "new module" objects in this module (through a star import). But I'd only do this if users are frequently accessing the _commands subpackage directly... otherwise, let the Mapdl object handle it for them.
Good point, thanks for reminding it @RobPasMue! |
Error with Currently in PyMAPDL: command = f"*TREAD,{par},{fname},{ext},,{nskip}" With the auto-generated package: command = f"*TREAD,{par},{fname},{ext},{nskip}" Fixing this coma error might solve other failing tests as well. |
@@ -33,7 +33,7 @@ env: | |||
DPF_PORT: 21004 | |||
MAPDL_PACKAGE: ghcr.io/ansys/mapdl | |||
ON_CI: True | |||
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html' | |||
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=100 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html' |
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.
This will be reverted once the tests will pass
Users are not expected to access
|
Thanks for your feedback @germa89. The issue I found here is unrelated to the unit test stability. However, if after fixing it the error persists, I will remove the random argument. You are right! Then, changes should already be in place as I manually modified src/ansys/mapdl/core/commands.py. |
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.
Very good progress, this is looking great.
I would say there a few pain points we need to fix first before final merging.
- Paragraphs in Notes are being merged into one.
- Identations are wrong in some arguments (fname mainly)
- we should decide what to do when the arguments descriptions are the same.
- Many places have strange line lengths... like way too long... sometimes they have links.
- the
mkdir
command is missing the argument - It seems bold format is not respected (it is always ignored)
*SET
notes section is bad formatted, I think it is missing stuff.
Another things to consider:
- For some reason the left side bar is not in alphabetical order:
(it did take a while this review... damn)
.pre-commit-config.yaml
Outdated
# - repo: https://github.com/codespell-project/codespell | ||
# rev: v2.3.0 | ||
# hooks: | ||
# - id: codespell | ||
# args: ["--toml", "pyproject.toml"] | ||
# additional_dependencies: ["tomli"] |
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.
Why this was deleted?
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.
I commented it as explained in #3385 (comment)
I have planned to rework on it. For the moment, I don't know why the repository can not be ignored.
Abbreviations.ucmd | ||
Abbreviations.abbres | ||
Abbreviations.abbr | ||
Abbreviations.abbsav |
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.
If we are going to extend this commands on _MapdlCommandExtended
class... shouldn't we use Mapdl
or _MapdlCommandExtended
instead of Abbreviations
??
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.
Same for all the rest.
.. _ref_apdl: | ||
|
||
<!-- vale off --> | ||
Apdl |
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.
I think APDL should be all capital.
<!-- vale on --> | ||
|
||
.. list-table:: | ||
|
||
* - :ref:`ref_macro_files` | ||
* - :ref:`ref_parameter_definition` | ||
* - :ref:`ref_matrix_operations` | ||
* - :ref:`ref_abbreviations` | ||
* - :ref:`ref_process_controls` | ||
* - :ref:`ref_array_parameters` | ||
* - :ref:`ref_encryption_decryption` | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
macro_files | ||
parameter_definition | ||
matrix_operations | ||
abbreviations | ||
process_controls | ||
array_parameters | ||
encryption_decryption |
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.
This is amazing.
\*TAXIS,longtable(1,4,1,1),2,1.0,2.2,3.5,4.7,5.9 | ||
``nAxis`` 2 (column location), starting at location 4. |
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.
Missing tex and newline.
\*TAXIS,longtable(1,4,1,1),2,1.0,2.2,3.5,4.7,5.9 | |
``nAxis`` 2 (column location), starting at location 4. | |
\*TAXIS,longtable(1,4,1,1),2,1.0,2.2,3.5,4.7,5.9 | |
would fill index values 1.0, 2.2, 3.5, 4.7, and 5.9 in ``nAxis`` 2 (column location), starting at location 4. |
Assigns values to user-named parameters that may be substituted later | ||
in the run. The equivalent (and recommended) format is | ||
Reads data from a file and fills in an array parameter vector or matrix. Data are read from a | ||
formatted file or, if the menu is off ( :ref:`menu` ,OFF) and ``Fname`` is blank, from the next input lines. The format of the data to be read must be input immediately following the :ref:`vread` command. The format specifies the number of fields to be read per record, the field width, and the placement of the decimal point (if none specified in the value). The read operation follows the available FORTRAN FORMAT conventions of the system (see your system FORTRAN manual). Any standard FORTRAN `real` format (such as (4F6.0), (E10.3,2X,D8.2), etc.) or alphanumeric format (A) may be used. Alphanumeric |
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.
I'm puzzled with the line lengths.. they are so random...
to (blank). A defined parameter must be deleted ( :ref:`starset` ) before its dimensions can be changed. Scalar (single valued) parameters should not be dimensioned. :ref:`dim` ,A,,3 defines a vector array with elements A(1), A(2), and A(3). :ref:`dim` ,B,,2,3 defines a 2x3 array with elements B(1,1), B(2,1), B(1,2), B(2,2), B(1,3), and B(2,3). Use :ref:`starstatus`, ``Par`` to display elements of array ``Par`` . You can write formatted data files (tabular formatting) from data held in arrays through the :ref:`vwrite` command. | ||
|
||
If you use table parameters to define boundary conditions, then ``Var1``, ``Var2``, and/or ``Var3`` can either specify a primary variable (listed in ) or can be an independent parameter. If specifying an independent parameter, then you must define an additional table for the independent parameter. The additional table must have the same name as the independent parameter and may be a function of one or more primary variables or another independent parameter. All independent parameters must relate to a primary variable. | ||
|
||
Tabular load arrays can be defined in both global Cartesian (default), cylindrical, spherical, or |
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.
Looong...
def endif(self, **kwargs): | ||
r"""Ends an if-then-else. | ||
Mechanical APDL Command: `\*ENDIF <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_ENDIF.html>`_ | ||
Notes |
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.
In the future I would like to add bits here.. like how these commands are compared to the python ones.
----- | ||
Optional intermediate block separator within an if-then-else construct. All seven characters of the | ||
command name (\*ELSEIF) must be input. This command is similar to the :ref:`if` command except that | ||
the ``Base`` field is not used. The :ref:`if`, :ref:`elseif`, :ref:`else`, and :ref:`endif` |
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.
:ref:else
is also taken from the python guide...
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.
You might need to go for :ref:ansys.mapdl.core.mapdl.MapdlBase.if
or similar...
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.
(double check the above)
Just double checking that the version with the empty argument is the correct one. :) |
@germa89 - this PR should be "automated". I don't understand the reason to make local changes. |
@germa89 's previous changes might be automatic since the branch is connected to feat/main_commands and not to the |
…into feat/apdl_submodule
This PR is the first one in order to automate the PyMAPDL
_commands
documentation.The changes have been generated using
pyconverter-xml2py
.This PR focus on the
apdl
submodule.Pinging @ansys/pymapdl-developers for visibility. Feel free to provide any feedback on the way the docstrings and the source code generation are handled.
Note
This PR is meant to be merged within the feat/main_commands branch. The latter will gather all the submodule changes, one by one, prior to be merged to the main branch.
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)