Skip to content

Commit 1876d75

Browse files
pyansys-ci-botvalallansysgerma89
authored
fix: migrated (PR 4146): Set _post as a property so it's initialized when needed (#4147)
* Set _post as a property so it is not called anymore when it's not initialised yet * chore: adding changelog file 4147.miscellaneous.md [dependabot-skip] * chore: adding changelog file 4147.miscellaneous.md [dependabot-skip] * refactor: improve post-processing object initialization in _MapdlCore --------- Co-authored-by: valallansys <valentin.allard@ansys.com> Co-authored-by: German <28149841+germa89@users.noreply.github.com>
1 parent c1ac774 commit 1876d75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/changelog.d/4147.miscellaneous.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix: migrated (PR 4146): Set _post as a property so it's initialized when needed

src/ansys/mapdl/core/mapdl_core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ def __init__(
375375
if log_apdl:
376376
self.open_apdl_log(log_apdl, mode="w")
377377

378-
self._post = PostProcessing(self)
378+
# Empty object that will store the `PostProcessing` object
379+
self._post_object = None
379380

380381
# Wrapping listing functions for "to_array" methods
381382
self._wrap_listing_functions()
@@ -963,7 +964,11 @@ def post_processing(self) -> "PostProcessing":
963964
raise MapdlRuntimeError(
964965
"MAPDL exited.\n\nCan only postprocess a live " "MAPDL instance."
965966
)
966-
return self._post
967+
968+
if self._post_object is None:
969+
self._post_object = PostProcessing(self)
970+
971+
return self._post_object
967972

968973
@property
969974
def print_com(self):

0 commit comments

Comments
 (0)