-
Notifications
You must be signed in to change notification settings - Fork 120
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
refactor: clean mapdl inprocess and move mute to MapdlCore #3220
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3220 +/- ##
==========================================
+ Coverage 85.08% 85.15% +0.06%
==========================================
Files 55 55
Lines 9926 9925 -1
==========================================
+ Hits 8446 8452 +6
+ Misses 1480 1473 -7 |
@germa89 Some comments:
|
@Gryfenfer97 you can test it by mocking the backend in a test |
We are deploying v251 (See #3210). I can also add the daily build (tag If you are strictly working with MAPDL (starting MAPDL without the
Assuming you mean @koubaa Mocking might not be the best for this case, if we are expecting to have tight coupling. Maintaining the mocked version might be a lot of burden. |
Furthermore... the |
I guess we might have issues when executing an |
If having the grpc server running doesn't block MAPDL there is no reason to have a problem with both of them running at the same time |
Good. Test that. Remember also, that there is another... There is another backend... the console one. I never used it, but I think it worked by directy typing the commands in the MAPDL terminal (sort of). We do not test it, nor develop against it, so it is going to be fun if we have to activate it. |
why would we have this issue? It can run at the same time but I don't think we should, at least not only for the purpose of testing pymapdl |
I disagree. Here's how it could work:
I don't see why this would be hard to maintain, and this can give 100% code coverage to all the logic we add to the MapdlInProcess class |
How are we sending the |
I think the method you proposed makes sense when on the client we are having some postprocessing (PyMAPDL postprocessing module for instance) or preprocessing (PyHPS for instance, building the REST request) of the server response. We fake the server response, pre/post-process it normally, and compare it with something. But I see no reason to fake the server response when there is not much pre/post-processing. Since we are testing the backend, we need to make sure we can send commands, and that the server can process them and give something correct back. What PyMAPDL is doing with the server response is not important in testing the backend. This approach could be interesting for testing the post-processing module. We can have MAPDL command responses and make sure that PyMAPDL processes them correctly. |
How it is done is not the concern of the |
What do you mean by server? There is no server. |
Talking with @koubaa we did both agree that I was applying wrong logic here. The indications given by @koubaa and @Gryfenfer97 are correct from my new perspective. @koubaa mentioned that since we are only preparing the backend, it does not need to be explicitly called Additionally, I believe we are still missing some "pseudo-testing". Assuming that most of the in-process backend will be tested in MAPDL CICD, I still would like to make sure that the object we are attaching to |
@Gryfenfer97 ping me when everything is ready. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Also should we consider changing all the "NotImplementedError" to abstract methods ? it seems to be an anti-pattern
|
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.
Two things to think about it.
- Include a method (even if it is private) to check wheter yo are using
MapdlInMemory
or not. Same as we havemapdl.is_grpc
andmapdl.is_console
. We checkmapdl._mode
for that. - Can someone use this backend by mistake in PyMAPDL? For instance:
mapdl = launch_mapdl(mode="inmemory")
I know it does not make sense.. so I want to make sure that no one is going to (by mistake or almost purposely) try to start this backend, and not getting a good formatter exception.
Hello! 👋 Your PR is changing the image cache. So I am attaching the new image cache in a new commit. This commit does not re-run the CICD workflows (since no changes are made in the codebase) therefore you will see the actions showing in their status You might want to rerun the test to make sure that everything is passing. You can retrigger the CICD sending an empty commit You will see this message everytime your commit changes the image cache but you are not attaching the updated cache. 🤓 |
How are we doing with this @Gryfenfer97 ?? |
Description
Cleanup of MapdlInProcess and light refactor
This PR is a followup to the suggestion made in #3198
Points to address:
_before_run()
and_after_run()
to let the backend do specific tasks_session_id
tomapdl_grpc
add tests (?)