Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers = [
{name = "PyAnsys developers", email = "pyansys.support@ansys.com"},
]
dependencies = [
"ansys-api-mapdl-v0==0.4.1", # supports at least 2020R2 - 2021R2
"ansys-api-mapdl==0.5.1", # supports at least 2020R2 - 2022R1
"ansys-corba; python_version < '3.9'",
"ansys-mapdl-reader>=0.50.15",
"appdirs>=1.4.0",
Expand Down
23 changes: 15 additions & 8 deletions src/ansys/mapdl/core/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,19 +1423,26 @@ def shape(self) -> tuple:
"""
return (self.nrow, self.ncol)

def sym(self): # BUG this is not always true
"""Return if matrix is symmetric."""
def sym(self) -> bool:
"""Return if matrix is symmetric.

Returns
-------
bool
``True`` when this matrix is symmetric.

"""

info = self._mapdl._data_info(self.id)

if meets_version(self._mapdl._server_version, (0, 5, 0)): # pragma: no cover
return info.mattype in [0, 1, 2] # [UPPER, LOWER, DIAG] respectively
else:
warn(
"Call to sym() function cannot evaluate if"
"it is symmetric or not in this MAPDL version."
)
return True

warn(
"Call to ``sym`` cannot evaluate if this matrix "
"is symmetric with this version of MAPDL."
)
return True

def asarray(self, dtype=None) -> np.ndarray:
"""Returns vector as a numpy array.
Expand Down