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

fix: command issues #374

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

fix: command issues #374

wants to merge 23 commits into from

Conversation

clatapie
Copy link
Collaborator

This PR fixes the following main issues:

First issue

The first one was discovered in ansys/pymapdl#3385 (comment).
It was mainly involving empty argument handling as the following commands are not identical in MAPDL due to an additional coma in the first command:

*TREAD,PAR,FNAME,EXT,,NSKIP
*TREAD,PAR,FNAME,EXT,NSKIP

Second issue

Digging into the code, I also discovered some commands needed specific treatment. This is the case for SECMODIF for instance.

  • PyMAPDL current documentation:
    image

  • MAPDL documentation:
    image

  • Incorrect MAPDL-CMD-CONV documentation:
    image

The current proposition is the following:

    def secmodif(self, secid: str = "", kywrd: str = "", addional_command_arg: str = "", **kwargs):
        r"""Modifies a pretension section

        Mechanical APDL Command: `SECMODIF <https://ansyshelp.ansys.com/Views/Secured/corp/v232/en//ans_cmd/Hlp_C_SECMODIF.html>`_

        Parameters
        ----------
        secid : str
            Unique section number. This number must already be assigned to a section.

        kywrd : str
            The description of the argument is missing in the Python function. Please, refer to the product
            documentation for further information.

        addional_command_arg : str
            Additional arguments can be passed to the intial command. Please, refer to the product
            documentation for further information.

        Notes
        -----
        The :ref:`secmodif` command either modifies the normal for a specified pretension section, or
        changes the name of the specified pretension surface.
        """
        command = f"SECMODIF,{secid},{kywrd},{addional_command_arg}"
        return self.run(command, **kwargs)

An addional_command_arg has been added to the python argument that enable the user to pass whatever needed additional arguments (which vary depending on kywrd value).

@clatapie clatapie self-assigned this Dec 11, 2024
@github-actions github-actions bot added the bug Something isn't working label Dec 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 91.95980% with 16 lines in your changes missing coverage. Please review.

Project coverage is 84.20%. Comparing base (d0ec620) to head (7590cc9).

Files with missing lines Patch % Lines
src/pyconverter/xml2py/ast_tree.py 93.26% 13 Missing ⚠️
src/pyconverter/xml2py/cli.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #374      +/-   ##
==========================================
- Coverage   84.37%   84.20%   -0.18%     
==========================================
  Files          13       13              
  Lines        2432     2500      +68     
==========================================
+ Hits         2052     2105      +53     
- Misses        380      395      +15     
Flag Coverage Δ
coverage 84.20% <91.95%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@clatapie
Copy link
Collaborator Author

As discussed with @RobPasMue, a link has been added to redirect the user to the correct documentation webpage for additional or missing arguments.

image

I decided not to add the SECMODIF mention but the command documentation one to reducing repetitions in the docstring. This can be modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants