Skip to content

feat: prep7 submodule #3872

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 9 commits into
base: feat/main_commands
Choose a base branch
from
Open

Conversation

clatapie
Copy link
Contributor

@clatapie clatapie commented Apr 24, 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 prep7 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

@clatapie clatapie self-assigned this Apr 24, 2025
@clatapie clatapie requested a review from a team as a code owner April 24, 2025 17:10
@clatapie clatapie requested review from germa89 and pyansys-ci-bot and removed request for a team April 24, 2025 17:10
@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 Apr 24, 2025
@germa89
Copy link
Collaborator

germa89 commented Apr 30, 2025

@clatapie

This PR is HUGE... 37k lines... The previous #3750 was around 5k. Please break this PR into smaller ones, most 4k otherwise, it gets very, very difficult to review it.

@RobPasMue
Copy link
Member

@clatapie

This PR is HUGE... 37k lines... The previous #3750 was around 5k. Please break this PR into smaller ones, most 4k otherwise, it gets very, very difficult to review it.

I don't really agree on this @germa89 -- I get that the PR is huge but the purpose of the current PRs is that the content gets autogenerated for a whole module. If the module is this large then so be it... but we shouldn't do a full, thorough review IMO. Rather.. just understand the changes and see what general improvements can be done. We can't be fixing all errors on the first shot sadly.

@germa89
Copy link
Collaborator

germa89 commented Apr 30, 2025

@clatapie
This PR is HUGE... 37k lines... The previous #3750 was around 5k. Please break this PR into smaller ones, most 4k otherwise, it gets very, very difficult to review it.

I don't really agree on this @germa89 -- I get that the PR is huge but the purpose of the current PRs is that the content gets autogenerated for a whole module. If the module is this large then so be it... but we shouldn't do a full, thorough review IMO. Rather.. just understand the changes and see what general improvements can be done. We can't be fixing all errors on the first shot sadly.

I agree but how I am going to review without reading it all? If the PR is 37k lines, I am not going to do all at once... probably I will do the first 5-7k and then stop. Long reviews are a pain on the web, it gets stuck.
I agree we cannot fix everything at once, but at least we should take note of what is broken (as @clatapie is doing). Otherwise, I think we are not going to revisit these files ever. Once they are merged, we are "done" with them.

So yeah, I still think we should break the PRs in smaller ones.

@clatapie
Copy link
Contributor Author

clatapie commented Apr 30, 2025

IMO, the main goal of these PRs is to check whether the submodules are complete and that each commands are properly working. Indeed, I think we all agree on the fact that the new documentation is more detailed than the previous one. The question is, thus, not about its content but mainly about the structure of the module (= all the functions are well defined with the correct arguments).

For instance, we can notice that there is an issue with the tbft command here, which would have been difficult to catch without this PR. This is a major issue that needs to be fixed before merging the PR.

Also, as you probably noticed, handling every comment is time-consuming, even though some comments just need to be converted into an issue because I always need to check the source of issue. If we want these modules to be published soon, we might need to think of a more scalable strategy. For instance:

  • checking the module doesn't miss any information in general
  • checking the documentation is understandable and most of the renderings are correct
  • if an issue is repeated, open a comment for it to be address
  • if an issue is local, add a mention local at the beginning of the comment or directly open an issue on the pyconverter-xml2py

We could then have a more detailed review on the documentation content for the remaining modules.

Please, share your views on those points.
Pinging @germa89, @RobPasMue, @MaxJPRey for visibility.

@RobPasMue
Copy link
Member

The question is, thus, not about its content but mainly about the structure of the module (= all the functions are well defined with the correct arguments).

Completely agreed

  • checking the module doesn't miss any information in general
  • checking the documentation is understandable and most of the renderings are correct

These 2 are the ones we should focus on the review of these PRs.

  • if an issue is repeated, open a comment for it to be address
  • if an issue is local, add a mention local at the beginning of the comment or directly open an issue on the pyconverter-xml2py

The remaining 2 focus on how to surface the problem. I would either add a comment or open the issue on the converter if it is a common problem

We could then have a more detailed review on the documentation content for the remaining modules.

We should focus on moving forward. Iterations can come afterwards. A minimal good state of these PRs will be better than what we already have for sure.

Thanks for the suggestions @clatapie!

"""
command = f"ASUB,{na1},{p1},{p2},{p3},{p4}"
return self.run(command, **kwargs)

Copy link
Contributor

Choose a reason for hiding this comment

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

git will normally track a changed file if it can map the old file to the new one as a modification. In this case, I think because the order of the commands is different, git doesn't realize that this is a move of preproc/areas.py, which makes this code harder to review.

p17: str = "",
p18: str = "",
**kwargs,
):
Copy link
Contributor

Choose a reason for hiding this comment

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

this is missing the typehint for the integer return

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. I guess we could use decorators for this, and add them to the mapdl_extended.py

# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see where there are two constraint equation and status files

@koubaa
Copy link
Contributor

koubaa commented Apr 30, 2025

One reason the PR is so big and hard to review is that the ordering and naming changed. Otherwise, git will recognize a moved file and only include the changed lines in a diff.

I agree with German that these changes are difficult to review. If there is a code generation change that is simple to review, then it should make very localized changes to the generated code.

For example, if you make a codegen change that adds a typehint to every argument of every command, the codegen system PR can be reviewed alongside a pymapdl PR in which only the typehints are added. That is easy to review, even if it affects 2000 methods.

I would rather see 10s of such PRs than 1 PR combining multiple codegen changes, as that makes it impossible to verify and leans on the test coverage which does not (and would likely never) cover all possible commands.

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.

5 participants