Skip to content

Commit

Permalink
Merge branches 'feat/piping-MAPDL-output-to-a-given-file', 'main' and…
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Dec 9, 2024
2 parents 8644812 + 6853571 commit a97fb6c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ repos:

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.30.0
hooks:
- id: check-github-workflows
1 change: 1 addition & 0 deletions doc/changelog.d/3589.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: linkchecker and cheatsheet links
1 change: 1 addition & 0 deletions doc/changelog.d/3590.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: improving load_array to reduce format line length
1 change: 1 addition & 0 deletions doc/changelog.d/3593.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump imageio from 2.36.0 to 2.36.1 in the documentation group
1 change: 1 addition & 0 deletions doc/changelog.d/3599.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: pre-commit autoupdate
10 changes: 6 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
with open("links.rst") as f:
rst_epilog += f.read()

rst_epilog = rst_epilog.replace("%%VERSION%%", "v231")
rst_epilog = rst_epilog.replace("%%VERSION%%", "v242")
rst_epilog = rst_epilog.replace("%%PYMAPDLVERSION%%", release)


Expand All @@ -219,8 +219,10 @@
linkcheck_ignore = [
"https://github.com/ansys/pymapdl/*",
"https://mapdl.docs.pyansys.com/*",
"https://ansysaccount.b2clogin.com/*", # behind payfirewall
"https://ansyshelp.ansys.com/*", # behind payfirewall
"https://www.ansys.com/*", # behind firewall
"https://download.ansys.com/*", # behind firewall
"https://ansysaccount.b2clogin.com/*", # behind authentication
"https://ansyshelp.ansys.com/*", # behind authentication
"https://forum.ansys.com/forums/*", # It is detected as broken
"https://courses.ansys.com/*", # It is detected as broken
]
Expand All @@ -239,7 +241,7 @@
f"https://github.com/ansys/pymapdl/releases/tag/v{__version__}"
)

user_agent = """curl https://www.ansys.com -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3"""
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.2420.81" # noqa: E501

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Downloads

.. jinja:: cheat_sheet

- View and download :download:`PyMAPDL cheatsheet <https://mapdl.docs.ansys.com/version/{{ version }}/_static/cheatsheet.pdf>`
- View and download :download:`PyMAPDL cheatsheet <https://github.com/ansys/pymapdl/blob/gh-pages/version/{{ version }}/_static/cheat_sheet.pdf>`
to help you to learn PyMAPDL.

- Visit :ref:`ref_examples` to learn how PyMAPDL can be used to solve different real problems.
Expand Down
5 changes: 3 additions & 2 deletions doc/source/getting_started/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ In the upper right corner of the documentation's title bar, there is an option f
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.

You can also `download <pymapdl_cheat_sheet>`_ the PyMAPDL cheat sheet. This one-page reference provides
syntax rules and commands for using PyMAPDL.
You can also download the
:download:`PyMAPDL cheat sheet <https://github.com/ansys/pymapdl/blob/gh-pages/version/{{ version }}/_static/cheat_sheet.pdf>`.
This one-page reference provides syntax rules and commands for using PyMAPDL.

On the `PyMAPDL Issues <https://github.com/ansys/pymapdl/issues>`_ page,
you can create issues to report bugs and request new features. On the `PyMAPDL Discussions
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ doc = [
"ansys-tools-visualization-interface==0.5.0",
"grpcio==1.68.0",
"imageio-ffmpeg==0.5.1",
"imageio==2.36.0",
"imageio==2.36.1",
"jupyter_sphinx==0.5.3",
"jupyter==1.1.1",
"jupyterlab>=3.2.8",
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/mapdl_extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ def load_array(self, name, array):
np.savetxt(
filename,
array,
delimiter=",",
delimiter="",
header="File generated by PyMAPDL:load_array",
fmt="%24.18e",
)
Expand All @@ -2329,7 +2329,7 @@ def load_array(self, name, array):
n2 = imax
n3 = kmax
self.vread(name, filename, n1=n1, n2=n2, n3=n3, label=label, nskip=1)
fmt = "(" + ",',',".join(["E24.18" for i in range(jmax)]) + ")"
fmt = f"({jmax}E24.18)"
logger.info("Using *VREAD with format %s in %s", fmt, filename)
self.run(fmt)

Expand Down
19 changes: 14 additions & 5 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,20 @@ def test__get_parameter_array(mapdl, cleared, number):
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# High number
with pytest.raises(MapdlRuntimeError):
shape = (100, 100)
array = np.ones(shape) * number
mapdl.load_array(name=name, array=array)
mapdl.parameters._get_parameter_array(name, shape)
shape = (100, 100)
array = np.ones(shape) * number
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# Random number
array = np.random.rand(*shape)
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# Random big number
array = np.random.rand(*shape) * number
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))


def parameters_name(mapdl, func, par_name):
Expand Down

0 comments on commit a97fb6c

Please sign in to comment.