Skip to content

Bump ansys-mapdl-core from 0.63.4 to 0.64.0 #35

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jan 30, 2023
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
1 change: 0 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"jupyter_sphinx",
"notfound.extension", # for the not found page.
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"numpydoc",
"sphinx.ext.coverage",
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ dependencies = [

[project.optional-dependencies]
tests = [
"ansys-mapdl-core==0.63.4",
"ansys-mapdl-core==0.64.0",
"scipy==1.10.0",
"pyansys-tools-report==0.5.0",
"pytest==7.2.1",
"pytest-cov==4.0.0",
"pytest-rerunfailures==11.0",
Expand All @@ -43,7 +44,7 @@ tests = [
]
doc = [
"Sphinx==5.3.0",
"ansys-mapdl-core==0.63.4",
"ansys-mapdl-core==0.64.0",
"ansys-mapdl-reader==0.52.7",
"ansys-sphinx-theme==0.8.1",
"jupyter_sphinx==0.4.0",
Expand Down
16 changes: 11 additions & 5 deletions src/ansys/math/core/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ansys.api.mapdl.v0 import ansys_kernel_pb2 as anskernel
from ansys.api.mapdl.v0 import mapdl_pb2 as pb_types
from ansys.mapdl.core.check_version import VersionError, meets_version, version_requires
from ansys.mapdl.core.common_grpc import (
ANSYS_VALUE_TYPE,
DEFAULT_CHUNKSIZE,
Expand All @@ -18,6 +17,9 @@
from ansys.mapdl.core.launcher import launch_mapdl
from ansys.mapdl.core.misc import load_file
from ansys.mapdl.core.parameters import interp_star_status
from ansys.tools.versioning import requires_version
from ansys.tools.versioning.exceptions import VersionError
from ansys.tools.versioning.utils import server_meets_version
import numpy as np

MYCTYPE = {
Expand Down Expand Up @@ -1174,7 +1176,7 @@ def _set_mat(self, mname, arr, sym=False, dtype=None, chunk_size=DEFAULT_CHUNKSI
else: # must be dense matrix
self._send_dense(mname, arr, dtype, chunk_size)

@version_requires((0, 4, 0))
@requires_version((0, 4, 0))
def _send_dense(self, mname, arr, dtype, chunk_size):
"""Send a dense NumPy array/matrix to MAPDL."""
if dtype is not None:
Expand Down Expand Up @@ -1427,7 +1429,7 @@ def __mul__(self, vec):
AnsVec
Hadamard product between this vector and the other vector.
"""
if not meets_version(self._mapdl._server_version, (0, 4, 0)): # pragma: no cover
if not server_meets_version(self._mapdl._server_version, (0, 4, 0)): # pragma: no cover
raise VersionError("``AnsVec`` requires MAPDL version 2021 R2.")

if not isinstance(vec, AnsVec):
Expand Down Expand Up @@ -1530,8 +1532,12 @@ def sym(self) -> bool:

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
if server_meets_version(self._mapdl._server_version, (0, 5, 0)): # pragma: no cover
return info.mattype in [
0,
1,
2,
] # [UPPER, LOWER, DIAG] respectively

warn(
"Call to ``sym`` method cannot evaluate if this matrix is symmetric "
Expand Down
7 changes: 4 additions & 3 deletions tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import os
import re

from ansys.mapdl.core.check_version import VersionError, meets_version
from ansys.mapdl.core.errors import ANSYSDataTypeError
from ansys.mapdl.core.launcher import get_start_instance
from ansys.mapdl.core.misc import random_string
from ansys.tools.versioning.exceptions import VersionError
from ansys.tools.versioning.utils import server_meets_version
import numpy as np
import pytest
from scipy import sparse
Expand Down Expand Up @@ -688,7 +689,7 @@ def test_mult(mapdl, mm):

rand_ = np.random.rand(100, 100)

if not meets_version(mapdl._server_version, (0, 4, 0)):
if not server_meets_version(mapdl._server_version, (0, 4, 0)):
with pytest.raises(VersionError):
AA = mm.matrix(rand_, name="AA")

Expand All @@ -709,7 +710,7 @@ def test__parm(mm):
mat = sparse.random(sz, sz, density=0.05, format="csr")

rand_ = np.random.rand(100, 100)
if not meets_version(mm._mapdl._server_version, (0, 4, 0)):
if not server_meets_version(mm._mapdl._server_version, (0, 4, 0)):

with pytest.raises(VersionError):
AA = mm.matrix(rand_, name="AA")
Expand Down