Skip to content

Commit

Permalink
Merge branch 'perf/reduce-testing-time' of https://github.com/ansys/p…
Browse files Browse the repository at this point in the history
…ymapdl into perf/reduce-testing-time
  • Loading branch information
germa89 committed Sep 23, 2024
2 parents 52270f9 + 7f1d6f9 commit d4c015c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ jobs:
uses: ansys/actions/branch-name-style@v7


commit-name:
pull-request-name:
if: github.event_name == 'pull_request'
name: Check the name of the commit
name: Check the name of the pull-request
runs-on: ubuntu-latest
steps:
- name: Check commit name
- name: Check pull-request name
uses: ansys/actions/commit-style@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 8 additions & 3 deletions src/ansys/mapdl/core/mapdl_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def __init__(
self._start_parm: Dict[str, Any] = start_parm
self._jobname: str = start_parm.get("jobname", "file")
self._path: Union[str, pathlib.Path] = start_parm.get("run_location", None)
self._path_cache = None # Cache
self._print_com: bool = print_com # print the command /COM input.
self.check_parameter_names = start_parm.get("check_parameter_names", True)

Expand Down Expand Up @@ -510,10 +511,14 @@ def directory(self) -> str:
# new line to fix path issue, see #416
self._path = repr(self._path)[1:-1]
else: # pragma: no cover
raise IOError(
f"The directory returned by /INQUIRE is not valid ('{self._path}')."
)
if self._path_cache:
return self._path_cache
else:
raise IOError(
f"The directory returned by /INQUIRE is not valid ('{self._path}')."
)

self._path_cache = self._path # update
return self._path

@directory.setter
Expand Down
3 changes: 1 addition & 2 deletions src/ansys/mapdl/core/mapdl_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,6 @@ def exit(self, save=False, force=False):
elif self._exited:
# Already exited.
return
else:
mapdl_path = self.directory

if save:
self._log.debug("Saving MAPDL database")
Expand All @@ -1095,6 +1093,7 @@ def exit(self, save=False, force=False):
self._log.debug("Exiting MAPDL")

if self._local:
mapdl_path = self.directory

Check warning on line 1096 in src/ansys/mapdl/core/mapdl_grpc.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/mapdl_grpc.py#L1096

Added line #L1096 was not covered by tests
self._cache_pids() # Recache processes

if os.name == "nt":
Expand Down

0 comments on commit d4c015c

Please sign in to comment.