Skip to content

Commit fdb159a

Browse files
valallansysValentin Allardpre-commit-ci[bot]pyansys-ci-botgerma89
authored
fix: Added scalar_param method to MapdlInProcess class (#4161)
* fix: Moved scalar_param method to _MapdlCore class to access in MapdlInProcess * ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci * chore: adding changelog file 4161.miscellaneous.md [dependabot-skip] * chore: empty commit to trigger CICD * fix: empty commit --------- Co-authored-by: Valentin Allard <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: German <[email protected]> Co-authored-by: Revathyvenugopal162 <[email protected]>
1 parent de1cf18 commit fdb159a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix: Added scalar_param method to MapdlInProcess class

src/ansys/mapdl/core/mapdl_console.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,3 @@ def name(self):
355355
if not self._name:
356356
self._name = f"Console_PID_{self._process.pid}"
357357
return self._name
358-
359-
def scalar_param(self, parm_name):
360-
response = self.starstatus(parm_name)
361-
response = response.splitlines()[-1]
362-
if parm_name.upper() not in response:
363-
raise ValueError(f"Parameter {parm_name} not found")
364-
return float(response.split()[1].strip())

src/ansys/mapdl/core/mapdl_core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,14 @@ def parameters(self) -> "Parameters":
939939
"""
940940
return self._parameters
941941

942+
def scalar_param(self, parm_name):
943+
response = self.starstatus(parm_name)
944+
response = response.splitlines()[-1]
945+
946+
if parm_name.upper() not in response:
947+
raise ValueError(f"Parameter {parm_name} not found")
948+
return float(response.split()[1].strip())
949+
942950
@property
943951
def platform(self):
944952
"""Return the platform where MAPDL is running."""

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
description = Default tox environments list
33
envlist =
4-
style,{py38,py39,py310,py311,py312,py313}{,-coverage},doc
4+
style,{py39,py310,py311,py312,py313}{,-coverage},doc
55
skip_missing_interpreters = true
66
isolated_build = true
77
isolated_build_env = build

0 commit comments

Comments
 (0)