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

Fixing __del__ method #1798

Merged
merged 10 commits into from
Jan 24, 2023
Merged

Fixing __del__ method #1798

merged 10 commits into from
Jan 24, 2023

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented Jan 23, 2023

Summary

This PR fixes some issues with the __del__ method implemented in #1700.

Background

Basically I have observed two issues:

  • __del__ method being called even when the mapdl object hasn't been generated.
  • __del__ method being called when exiting python. This is the normal behaviour, but we should not import any module while exiting Python process (which call __del__).

Solution

  • We only executed mapdl.exit if mapdl._exited is False.

Future

A following PR should implemente an exited method.

Close #1796

@germa89 germa89 self-assigned this Jan 23, 2023
@germa89 germa89 requested review from a team and clatapie and removed request for a team January 23, 2023 18:50
@germa89 germa89 added the BUG Issue, problem or error in PyMAPDL label Jan 23, 2023
@github-actions github-actions bot added Dependencies Maintenance General maintenance of the repo (libraries, cicd, etc) labels Jan 23, 2023
@github-actions
Copy link
Contributor

Please add one of the following labels to add this contribution to the Release Notes 👇

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Merging #1798 (2c13353) into main (be8ff4a) will increase coverage by 81.82%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           main    #1798       +/-   ##
=========================================
+ Coverage      0   81.82%   +81.82%     
=========================================
  Files         0       44       +44     
  Lines         0     7709     +7709     
=========================================
+ Hits          0     6308     +6308     
- Misses        0     1401     +1401     

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@clatapie clatapie left a comment

Choose a reason for hiding this comment

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

LGTM!

@germa89 germa89 enabled auto-merge (squash) January 24, 2023 09:32
@germa89 germa89 merged commit a1df72c into main Jan 24, 2023
@germa89 germa89 deleted the fix/inquire-returning-none branch January 24, 2023 11:12
@germa89 germa89 mentioned this pull request Feb 23, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Issue, problem or error in PyMAPDL Dependencies Maintenance General maintenance of the repo (libraries, cicd, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error/Bug in "mapdl_grpc.py" line 966, since version 0.64.0
2 participants