Skip to content

feat: post1 submodule (1/2) - disabled due to merging branch issue #3983

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

Closed
wants to merge 16 commits into from

Conversation

clatapie
Copy link
Contributor

@clatapie clatapie commented Jun 4, 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 post1 submodule, part 1. A follow-up PR will come right after with part 2.

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

Generate and integrate the post1 submodule as part one of the XML-to-Python conversion, providing a full suite of APDL postprocessing command wrappers and corresponding documentation.

New Features:

  • Introduce the post1 submodule with automated command wrappers for postprocessing (Animation, Controls, ElementTable, Fatigue, Load Case Calculations, Listing, SpecialPurpose, FailureCriteria).

Enhancements:

  • Refactor Post1Commands to inherit from new post1 classes instead of legacy implementations.

Documentation:

  • Add Sphinx documentation for all post1 commands under doc/source/mapdl_commands/post1.
  • Update ANSYS vocabulary acceptance list to accommodate new command terminology.

@clatapie clatapie self-assigned this Jun 4, 2025
@clatapie clatapie requested a review from a team as a code owner June 4, 2025 09:41
@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

Copy link
Contributor

sourcery-ai bot commented Jun 4, 2025

Reviewer's Guide

This PR automates the generation of the post1 submodule by applying the PyConverter-XML2Py toolchain: it restructures the legacy underscore package into a proper post1 package, updates the core commands.py to import and compose new classes, and adds matching Sphinx documentation for each generated APDL command.

Class Diagram: New ElementTable Class in post1 Submodule

classDiagram
    class ElementTable {
        <<ansys.mapdl.core._commands.post1.element_table.ElementTable>>
        +esort(item: str, lab: str, order: int | str, kabs: int | str, numb: str)
        +etable(lab: str, item: str, comp: str, option: str)
        +eusort()
        +pletab(itlab: str, avglab: str)
        +plls(labi: str, labj: str, fact: str, kund: int | str, viewup: int | str)
        +pretab(lab1: str, lab2: str, lab3: str, lab4: str, lab5: str, lab6: str, lab7: str, lab8: str, lab9: str)
        +sabs(key: int | str)
        +sadd(labr: str, lab1: str, lab2: str, fact1: str, fact2: str, const: str)
        +sallow(strs1: str, strs2: str, strs3: str, strs4: str, strs5: str, strs6: str)
        +sexp(labr: str, lab1: str, lab2: str, exp1: str, exp2: str)
        +sfact(type_: int | str)
        +sfcalc(labr: str, labs: str, labt: str, type_: int | str)
        +smax(labr: str, lab1: str, lab2: str, fact1: str, fact2: str)
        +smin(labr: str, lab1: str, lab2: str, fact1: str, fact2: str)
        +smult(labr: str, lab1: str, lab2: str, fact1: str, fact2: str)
        +ssum()
        +tallow(temp1: str, temp2: str, temp3: str, temp4: str, temp5: str, temp6: str)
        +vcross(labxr: str, labyr: str, labzr: str, labx1: str, laby1: str, labz1: str, labx2: str, laby2: str, labz2: str)
        +vdot(labr: str, labx1: str, laby1: str, labz1: str, labx2: str, laby2: str, labz2: str)
    }
Loading

Class Diagram: New Controls Class in post1 Submodule

classDiagram
    class Controls {
        <<ansys.mapdl.core._commands.post1.controls.Controls>>
        +avprin(key: int | str, effnu: str)
        +avres(key: int | str, opt: str)
        +efacet(num: int | str)
        +ernorm(key: str)
        +force(lab: str)
        +inres(item1: str, item2: str, item3: str, item4: str, item5: str, item6: str, item7: str, item8: str)
        +layer(num: str)
        +rsys(kcn: int | str)
        +shell(loc: str)
    }
Loading

Class Diagram: New SpecialPurpose Class in post1 Submodule

classDiagram
    class SpecialPurpose {
        <<ansys.mapdl.core._commands.post1._special_purpose.SpecialPurpose>>
        +kcalc(kplan: int | str, mat: str, kcsym: int | str, klocpr: int | str)
        +plcrack(loc: int | str, num: int | str)
    }
Loading

File-Level Changes

Change Details Files
Updated core commands import and Post1Commands composition
  • Imported the new post1 package in commands.py
  • Replaced old post1_.* base classes with new post1.* classes
  • Renamed and reordered base classes (e.g., LoadCaseCalculations) in Post1Commands
src/ansys/mapdl/core/commands.py
Generated new post1 command modules
  • Added 9 auto-generated Python modules defining APDL commands as classes and methods
  • Embedded full docstrings linked to ANSYS help for each command
  • Leveraged xml2py/mapdl-cmd-conv for code generation
src/ansys/mapdl/core/_commands/post1/animation.py
src/ansys/mapdl/core/_commands/post1/controls.py
src/ansys/mapdl/core/_commands/post1/element_table.py
src/ansys/mapdl/core/_commands/post1/_fatigue.py
src/ansys/mapdl/core/_commands/post1/load_case_calculations.py
src/ansys/mapdl/core/_commands/post1/listing.py
src/ansys/mapdl/core/_commands/post1/failure_criteria.py
src/ansys/mapdl/core/_commands/post1/_special_purpose.py
src/ansys/mapdl/core/_commands/post1/__init__.py
Added Sphinx documentation for post1 commands
  • Created individual .rst files per command with generated content
  • Built an index.rst to expose the submodule commands in the docs
doc/source/mapdl_commands/post1/animation.rst
doc/source/mapdl_commands/post1/controls.rst
doc/source/mapdl_commands/post1/element_table.rst
doc/source/mapdl_commands/post1/failure_criteria.rst
doc/source/mapdl_commands/post1/listing.rst
doc/source/mapdl_commands/post1/magnetics_calc.rst
doc/source/mapdl_commands/post1/setup.rst
doc/source/mapdl_commands/post1/special.rst
doc/source/mapdl_commands/post1/load_case_calculations.rst
doc/source/mapdl_commands/post1/_fatigue.rst
doc/source/mapdl_commands/post1/_special_purpose.rst
doc/source/mapdl_commands/post1/index.rst
Cleaned up legacy underscore subpackage
  • Removed src/ansys/mapdl/core/_commands/post1_/ and its modules
  • Deleted outdated Sphinx rst in doc/source/mapdl_commands/post1/
src/ansys/mapdl/core/_commands/post1_/*
doc/source/mapdl_commands/post1/load_case.rst
Updated project configuration
  • Appended new terms to the ANSYS accept vocabulary
doc/styles/config/vocabularies/ANSYS/accept.txt

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

@github-actions github-actions bot added documentation Documentation related (improving, adding, etc) new feature Request or proposal for a new feature labels Jun 4, 2025
Copy link
Contributor

@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:

  • Rather than manually listing every new post1 submodule in commands.py, consider using dynamic discovery or a registration helper to auto-import modules and reduce boilerplate maintenance.
  • The deep multiple‐inheritance in Post1Commands is hard to follow—group related commands into cohesive mixin classes or use composition to simplify the class hierarchy.
  • Since these files are auto-generated, integrate the conversion tool into CI (e.g. a regen step) so updates stay in sync and avoid merge conflicts with stale generated code.
Here's what I looked at during the review
  • 🟡 General issues: 20 issues 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

codecov bot commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.11%. Comparing base (4494edd) to head (f323335).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3983      +/-   ##
==========================================
- Coverage   89.12%   89.11%   -0.02%     
==========================================
  Files         187      190       +3     
  Lines       14970    15008      +38     
==========================================
+ Hits        13342    13374      +32     
- Misses       1628     1634       +6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added dependencies maintenance General maintenance of the repo (libraries, cicd, etc) labels Jun 4, 2025
@clatapie clatapie removed dependencies maintenance General maintenance of the repo (libraries, cicd, etc) labels Jun 4, 2025
@github-actions github-actions bot added dependencies maintenance General maintenance of the repo (libraries, cicd, etc) labels Jun 4, 2025
@github-actions github-actions bot added the CI/CD Related with CICD, Github Actions, etc label Jun 4, 2025
@clatapie clatapie requested a review from RobPasMue June 4, 2025 13:15
@clatapie
Copy link
Contributor Author

clatapie commented Jun 4, 2025

This PR is ready for review @germa89.

As mentioned in the PR description, another PR will follow this one for post1 submodule.

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.

Review in progress.

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.

LGTM. Very minor comments.

@clatapie clatapie added the DO NOT MERGE Not ready to be merged yet label Jun 11, 2025
@clatapie
Copy link
Contributor Author

This PR cannot be merged as it would be merged into main. I will address all the remaining comments, then close it and reopen a new one, with a link to this one for reference.

@clatapie
Copy link
Contributor Author

All the comments have been addressed.
Closing this PR and opening a new one that will be merged into feat/main_commands.

@clatapie clatapie changed the title feat: post1 submodule (1/2) feat: post1 submodule (1/2) - disabled due to merging branch issue Jun 11, 2025
@clatapie clatapie mentioned this pull request Jun 11, 2025
10 tasks
@clatapie clatapie closed this Jun 11, 2025
@germa89
Copy link
Collaborator

germa89 commented Jun 11, 2025

This PR cannot be merged as it would be merged into main. I will address all the remaining comments, then close it and reopen a new one, with a link to this one for reference.

You could have just changed the target of the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Related with CICD, Github Actions, etc dependencies DO NOT MERGE Not ready to be merged yet documentation Documentation related (improving, adding, etc) maintenance General maintenance of the repo (libraries, cicd, etc) new feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants