Skip to content

Fixing numpy version #1709

New issue

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

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

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ env:
# You should go up in number, if you go down (or repeat a previous value)
# you might end up reusing a previous cache if it haven't been deleted already.
# It applies 7 days retention policy by default.
RESET_PIP_CACHE: 4
RESET_EXAMPLES_CACHE: 4
RESET_DOC_BUILD_CACHE: 4
RESET_AUTOSUMMARY_CACHE: 4
RESET_PIP_CACHE: 5
RESET_EXAMPLES_CACHE: 5
RESET_DOC_BUILD_CACHE: 5
RESET_AUTOSUMMARY_CACHE: 5

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
3 changes: 3 additions & 0 deletions doc/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
.. _pyvista_docs: https://docs.pyvista.org
.. _jupyter: https://jupyter.org/
.. _grpc: https://grpc.io/
.. _pandas_org: https://pandas.pydata.org
.. _numpy_org: https://numpy.org
.. _numpy_docs: https://numpy.org/doc/stable/
.. _matplotlib_docs: https://matplotlib.org/stable/contents.html
.. _matplotlib_main: https://matplotlib.org
Expand Down Expand Up @@ -64,6 +66,7 @@
.. _article_good_unit_test: https://stackoverflow.com/questions/61400/what-makes-a-good-unit-test
.. _vscode_attach_to_container: https://code.visualstudio.com/docs/devcontainers/attach-container
.. _ubuntu_firewall: https://ubuntu.com/server/docs/security-firewall
.. _pyvista_eye_dome_lighting: https://docs.pyvista.org/examples/02-plot/edl.html

.. #Github links:
.. _gh_creating_pat: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

Additional Packages used
~~~~~~~~~~~~~~~~~~~~~~~~
* `Numpy <https://numpy.org>`_ for using data as arrays
* `Pandas <https://pandas.pydata.org>`_ to import csv file (to install use: **pip install pandas**)
* `PyVista <https://docs.pyvista.org>`_ for performing Gauissian interpolation
* `Numpy <numpy_org_>`_ for using data as arrays
* `Pandas <pandas_org_>`_ to import csv file (to install use: **pip install pandas**)
* `PyVista <pyvista_docs_>`_ for performing Gaussian interpolation

Boundary Conditions
~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions examples/00-mapdl-examples/lathe_cutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@

###############################################################################
# Let's try out some scalar bar options from the
# `PyVista documentation <https://docs.pyvista.org/>`_.
# `PyVista documentation <pyvista_docs_>`_.
# For example, let's set black text on a beige background.
#
# The scalar bar keywords defined as a Python dictionary are an alternate
Expand Down Expand Up @@ -393,7 +393,7 @@
# .. note::
# We're using ``eye_dome_lighting`` here to enhance the plots of our slices.
# Read more about it at `Eye Dome Lighting
# <https://docs.pyvista.org/examples/02-plot/edl.html>`_
# <pyvista_eye_dome_lighting_>`_

single_slice = grid.slice(normal=[0, 0, 1], origin=[0, 0, 0])
single_slice.plot(
Expand Down
2 changes: 1 addition & 1 deletion examples/00-mapdl-examples/transient_thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
# Visualize a Slice
# ~~~~~~~~~~~~~~~~~
# Visualize a slice through the dataset using ``pyvista``
# for more details visit <https://docs.pyvista.org/>`_.
# for more details visit `pyvista documentation <pyvista_docs_>`_.

# get the temperature of the 30th result set
mapdl.set(1, 30)
Expand Down
2 changes: 1 addition & 1 deletion examples/02-geometry/01-lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
# Line Geometry
# ~~~~~~~~~~~~~
# Get the VTK ``PolyData`` containing lines. This VTK mesh can be
# saved or plotted. For more details, visit https://docs.pyvista.org/
# saved or plotted. For more details, visit `Pyvista documentation <pyvista_docs_>`_
lines = mapdl.geometry.lines
lines

Expand Down
2 changes: 1 addition & 1 deletion examples/02-geometry/02-areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
# Area Geometry
# ~~~~~~~~~~~~~
# Get the VTK ``PolyData`` containing lines. This VTK mesh can be
# saved or plotted. For more details, visit https://docs.pyvista.org/
# saved or plotted. For more details, visit `Pyvista documentation <pyvista_docs_>`_
#
# Note that this is a method so you can select the quality of the
# areas (mesh density), and if you would like a merged output or
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ classifiers = [

[project.optional-dependencies]
tests = [
"ansys-dpf-core==0.7.0",
"ansys-dpf-core==0.7.2",
"autopep8==2.0.0",
"matplotlib==3.6.2",
"scipy==1.9.3",
Expand All @@ -59,13 +59,13 @@ tests = [
"pytest-cov==4.0.0",
"pyvista==0.37.0",
"pyansys-tools-report==0.4.1",
"vtk==9.0.3",
"vtk==9.2.2",
"pytest-rerunfailures==10.3",
]
doc = [
"Sphinx==5.3.0",
"ansys-dpf-core==0.7.0",
"ansys-mapdl-reader==0.52.3",
"ansys-dpf-core==0.7.2",
"ansys-mapdl-reader==0.52.5",
"ansys-sphinx-theme==0.8.0",
"grpcio==1.43.0",
"imageio-ffmpeg==0.4.7",
Expand All @@ -87,7 +87,7 @@ doc = [
"sphinx-notfound-page==0.8.3",
"sphinxcontrib-websupport==1.2.4",
"sphinxemoji==0.2.0",
"vtk==9.0.3",
"vtk==9.2.2",
]

[tool.flit.module]
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/mapdl_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def _select_items(self, items, item_type, sel_type):
items = np.asarray(items)
if not np.issubdtype(items.dtype, np.number):
raise TypeError("Item numbers must be a numeric type")
items = items.ravel().astype(np.int, copy=False)
items = items.ravel().astype(np.int_, copy=False)

# consider logic for negative values to support ranges. This
# is the 'ORDER' option
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ def asarray(self, dtype=None) -> np.ndarray:
>>> v = mm.ones(10)
>>> v.asarray()
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
>>> v.asarray(dtype=np.int)
>>> v.asarray(dtype=np.int_)
[1 1 1 1 1 1 1 1 1 1]

"""
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/mesh_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def key_option(self):
keyopt = einfo[2:20]
if keyopt.any():
# convert to fortran/ANSYS format
valid_keyopt = keyopt[keyopt.astype(np.bool)]
valid_keyopt = keyopt[keyopt.astype(np.bool_)]
ans_keyopt = np.vstack((np.nonzero(keyopt)[0] + 1, valid_keyopt))
key_opt[einfo[0]] = ans_keyopt.T.tolist()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def test_set_vec_large(mm):


def test_dot(mm):
a = np.arange(10000, dtype=np.float)
b = np.arange(10000, dtype=np.float)
a = np.arange(10000, dtype=np.float_)
b = np.arange(10000, dtype=np.float_)
np_rst = a.dot(b)

vec_a = mm.set_vec(a)
Expand Down