Skip to content

feat: post26 submodule #3892

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

Open
wants to merge 7 commits into
base: feat/main_commands
Choose a base branch
from
Open

Conversation

clatapie
Copy link
Contributor

@clatapie clatapie commented May 5, 2025

Description

This PR follows the PyConverter-XML2Py integration plan to automate the PyMAPDL_commands documentation.
The changes have been generated using pyconverter-xml2py and more specifically mapdl-cmd-conv.

This PR focus on the post26 submodule.

You can check the mapdl-cmd-conv documentation to have a look at the output of each submodules.

Pinging @ansys/pymapdl-developers for visibility. Feel free to provide any feedback on the way the docstrings and the source code generation are handled.

Issue linked

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

Summary by Sourcery

Implement the post26 submodule for PyMAPDL, following the PyConverter-XML2Py integration plan to automate documentation generation

New Features:

  • Add post26 submodule with comprehensive command implementations
  • Implement classes for different aspects of POST26 postprocessing such as SetUp, Controls, Display, Listing, Operations, Special Purpose, and Status

Chores:

  • Reorganize project structure to accommodate the new submodule
  • Remove old post26_ directory

@clatapie clatapie self-assigned this May 5, 2025
@clatapie clatapie requested a review from a team as a code owner May 5, 2025 16:55
@clatapie clatapie requested review from germa89 and pyansys-ci-bot and removed request for a team May 5, 2025 16:55
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot added documentation Documentation related (improving, adding, etc) new feature Request or proposal for a new feature labels May 5, 2025
@germa89
Copy link
Collaborator

germa89 commented May 6, 2025

@sourcery-ai review

Copy link

sourcery-ai bot commented May 6, 2025

Reviewer's Guide

This pull request introduces the post26 submodule, replacing the old post26_ implementation. The new submodule contains automatically generated Python classes and methods corresponding to MAPDL POST26 commands, derived from XML documentation using pyconverter-xml2py. The main Post26Commands class is updated to inherit from these new classes.

Class Diagram for Post26Commands and its New Base Classes

classDiagram
direction LR
class Post26Commands {
  +pass
}

note for Post26Commands "Inherits from new auto-generated classes in the 'post26' submodule,\nreplacing the former 'post26_' submodule and its classes."

class P26_InternalSetUp {
  "<<ansys.mapdl.core._commands.post26._set_up.SetUp>>"
  +gapf()
}

class P26_Controls {
  "<<ansys.mapdl.core._commands.post26.controls.Controls>>"
  +...
}

class P26_Display {
  "<<ansys.mapdl.core._commands.post26.display.Display>>"
  +keep()
  +plvar()
  +pltime()
  +plcplx()
  +xvar()
  +spread()
}

class P26_Listing {
  "<<ansys.mapdl.core._commands.post26.listing.Listing>>"
  +extrem()
  +prtime()
  +prcplx()
  +prvar()
  +lines()
  +nprint()
}

class P26_Operations {
  "<<ansys.mapdl.core._commands.post26.operations.Operations>>"
  +exp()
  +prod()
  +large()
  +nlog()
  +realvar()
  +int1()
  +imagin()
  +clog()
  +conjug()
  +atan()
  +add()
  +abs()
  +deriv()
  +quot()
  +sqrt()
  +small()
  +filldata()
}

class P26_SetUp {
  "<<ansys.mapdl.core._commands.post26.set_up.SetUp>>"
  +enersol()
  +esol()
  +gssol()
  +timerange()
  +vardel()
  +varnam()
  +nsol()
  +numvar()
  +nstore()
  +rforce()
  +rgb()
  +cisol()
  +ansol()
  +data()
  +jsol()
  +store()
  +solu()
}

class P26_SpecialPurpose {
  "<<ansys.mapdl.core._commands.post26.special_purpose.SpecialPurpose>>"
  +...
}

class P26_Status {
  "<<ansys.mapdl.core._commands.post26.status.Status>>"
  +...
}

Post26Commands --|> P26_InternalSetUp
Post26Commands --|> P26_Controls
Post26Commands --|> P26_Display
Post26Commands --|> P26_Listing
Post26Commands --|> P26_Operations
Post26Commands --|> P26_SetUp
Post26Commands --|> P26_SpecialPurpose
Post26Commands --|> P26_Status
Loading

File-Level Changes

Change Details Files
Add auto-generated post26 command submodule.
  • Create new directory structure for post26.
  • Add Python files with classes (SetUp, Operations, etc.) containing methods for MAPDL commands.
  • Include detailed docstrings generated from command documentation.
src/ansys/mapdl/core/_commands/post26/__init__.py
src/ansys/mapdl/core/_commands/post26/set_up.py
src/ansys/mapdl/core/_commands/post26/operations.py
src/ansys/mapdl/core/_commands/post26/special_purpose.py
src/ansys/mapdl/core/_commands/post26/display.py
src/ansys/mapdl/core/_commands/post26/listing.py
src/ansys/mapdl/core/_commands/post26/controls.py
src/ansys/mapdl/core/_commands/post26/status.py
src/ansys/mapdl/core/_commands/post26/_set_up.py
Integrate new post26 submodule into Post26Commands class.
  • Update import statements to use the new post26 submodule.
  • Modify Post26Commands class inheritance to use the new classes (post26.SetUp, post26.Controls, etc.).
src/ansys/mapdl/core/commands.py
Remove the old post26_ submodule implementation.
  • Delete the entire src/ansys/mapdl/core/_commands/post26_/ directory and its contents.
src/ansys/mapdl/core/_commands/post26_/__init__.py
src/ansys/mapdl/core/_commands/post26_/controls.py
src/ansys/mapdl/core/_commands/post26_/display.py
src/ansys/mapdl/core/_commands/post26_/listing.py
src/ansys/mapdl/core/_commands/post26_/operations.py
src/ansys/mapdl/core/_commands/post26_/setup.py
src/ansys/mapdl/core/_commands/post26_/special.py
src/ansys/mapdl/core/_commands/post26_/status.py
Update documentation for the new post26 structure.
  • Add new .rst files for the added classes/modules (set_up.rst, special_purpose.rst, etc.).
  • Remove old .rst files corresponding to the deleted post26_ submodule.
  • Update index files to reflect the new documentation structure.
doc/source/mapdl_commands/index.rst
doc/source/mapdl_commands/post26/controls.rst
doc/source/mapdl_commands/post26/display.rst
doc/source/mapdl_commands/post26/listing.rst
doc/source/mapdl_commands/post26/operations.rst
doc/source/mapdl_commands/post26/status.rst
doc/source/mapdl_commands/post26/_set_up.rst
doc/source/mapdl_commands/post26/index.rst
doc/source/mapdl_commands/post26/set_up.rst
doc/source/mapdl_commands/post26/special_purpose.rst
doc/source/mapdl_commands/post26/setup.rst
doc/source/mapdl_commands/post26/special.rst
Add changelog entry.
  • Create a new changelog file documenting the addition of the post26 submodule.
doc/changelog.d/3892.documentation.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @clatapie - I've reviewed your changes - here's some feedback:

  • Post26Commands inherits from both post26._set_up.SetUp and post26.set_up.SetUp; please clarify if both are intended.
  • The new structure includes both _set_up.py and set_up.py files within the post26 module; consider consolidating if appropriate.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Collaborator

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

I guess the biggest problems I see are:

  • Missing status commands
  • Not using footnotes for tables.
  • Codacy: Redefinition of id function in src/ansys/mapdl/core/_commands/post26/set_up.py:1040
  • Missing third rows in some tables.
  • Missing italics?

The bot raised an interesting comment about the _set_up.py and set_up.py: #3892 (review)
Does it have a point?

Comment on lines -14 to +19
Mapdl.define
Mapdl.operate
Mapdl.plotting
Mapdl.print
Status.operate
Status.plotting
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we are missing some commands?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some functions have multiple "parents". This is the case for define and print. They both appear in POST1 and POST26:
image

For now, the first parent appearing in the parent section is the one where the function will be assigned. Thus, print and define are in post1 submodule.

Are you fine with this approach?

Comment on lines 135 to 136
variable is filled. The number of loops may be controlled with the `\*VLEN
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_cmd/Hlp_C_VLEN.html#>`_ :ref:`vlen`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we separate both command versions with a /??

Suggested change
variable is filled. The number of loops may be controlled with the `\*VLEN
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_cmd/Hlp_C_VLEN.html#>`_ :ref:`vlen`
variable is filled. The number of loops may be controlled with the `\*VLEN
<https://ansyshelp.ansys.com/Views/Secured/corp/v232/en/ans_cmd/Hlp_C_VLEN.html#>`_ / :ref:`vlen`

@germa89 germa89 mentioned this pull request May 6, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related (improving, adding, etc) new feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants