From 4d5edad7f3784819b9edec994f2acf8d21c4964c Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Thu, 29 Apr 2021 20:47:10 -0600 Subject: [PATCH] add api docs (#25) * add api docs * hamburger to white --- ansys/mapdl/reader/archive.py | 5 +---- ansys/mapdl/reader/cell_quality.py | 5 +++++ ansys/mapdl/reader/emat.py | 2 +- docs/source/_static/css/ansys.css | 3 +++ docs/source/api/archive.rst | 14 ++++++++++++++ docs/source/api/cyclic_result.rst | 8 ++++++++ docs/source/api/emat.rst | 8 ++++++++ docs/source/api/full.rst | 8 ++++++++ docs/source/api/index.rst | 17 +++++++++++++++++ docs/source/api/mesh_quality.rst | 6 ++++++ docs/source/api/rst.rst | 8 ++++++++ docs/source/index.rst | 1 + 12 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 docs/source/api/archive.rst create mode 100644 docs/source/api/cyclic_result.rst create mode 100644 docs/source/api/emat.rst create mode 100644 docs/source/api/full.rst create mode 100644 docs/source/api/index.rst create mode 100644 docs/source/api/mesh_quality.rst create mode 100644 docs/source/api/rst.rst diff --git a/ansys/mapdl/reader/archive.py b/ansys/mapdl/reader/archive.py index 0fe0019f..0f0b181b 100644 --- a/ansys/mapdl/reader/archive.py +++ b/ansys/mapdl/reader/archive.py @@ -234,7 +234,7 @@ def plot(self, *args, **kwargs): def save_as_archive(filename, grid, mtype_start=1, etype_start=1, - real_constant_start=1, mode='w', nblock=True, + real_constant_start=1, mode='w', enum_start=1, nnum_start=1, include_etype_header=True, reset_etype=False, allow_missing=True, include_surface_elements=True, @@ -284,9 +284,6 @@ def save_as_archive(filename, grid, mtype_start=1, etype_start=1, mode : str, optional File mode. See ``help(open)`` - nblock : bool, optional - Write node block when writing archive file. - enum_start : int, optional Starting element number to assign to unset cells. Can be manually set by adding the cell array "ansys_elem_num" to the diff --git a/ansys/mapdl/reader/cell_quality.py b/ansys/mapdl/reader/cell_quality.py index e9a6a1e5..cfdfd0eb 100644 --- a/ansys/mapdl/reader/cell_quality.py +++ b/ansys/mapdl/reader/cell_quality.py @@ -14,6 +14,11 @@ def quality(grid): Negative values indicate invalid cells while positive values indicate valid cells. Varies between -1 and 1. + Parameters + ---------- + grid : pyvista.UnstructuredGrid or pyvista.StructuredGrid + Structured or Unstructured Grid from ``pyvista``. + Examples -------- >>> from ansys.mapdl import reader as pymapdl_reader diff --git a/ansys/mapdl/reader/emat.py b/ansys/mapdl/reader/emat.py index 1440a68f..7fb3c2ab 100644 --- a/ansys/mapdl/reader/emat.py +++ b/ansys/mapdl/reader/emat.py @@ -335,7 +335,7 @@ class EmatFile(object): Parameters ---------- filename : str - File to open. Usually ends in .emat + File to open. Generally ends in ``*.emat``. Examples -------- diff --git a/docs/source/_static/css/ansys.css b/docs/source/_static/css/ansys.css index f5a056e3..9586a07b 100644 --- a/docs/source/_static/css/ansys.css +++ b/docs/source/_static/css/ansys.css @@ -14,6 +14,9 @@ h1, h2, h3, h4, h5, h6 { font-family: 'Source Sans Pro', sans-serif; } +.navbar-toggler-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E") !important; +} .sig-prename { color: var(--ansysBronze); diff --git a/docs/source/api/archive.rst b/docs/source/api/archive.rst new file mode 100644 index 00000000..0dabcd1a --- /dev/null +++ b/docs/source/api/archive.rst @@ -0,0 +1,14 @@ +.. _ref_archive_api: + +*************************** +Archive Class and Functions +*************************** +.. autoclass:: ansys.mapdl.reader.archive.Archive + :members: + :noindex: + +.. autofunction:: ansys.mapdl.reader.archive.save_as_archive + +.. autofunction:: ansys.mapdl.reader.archive.write_nblock + +.. autofunction:: ansys.mapdl.reader.archive.write_cmblock diff --git a/docs/source/api/cyclic_result.rst b/docs/source/api/cyclic_result.rst new file mode 100644 index 00000000..ea21e564 --- /dev/null +++ b/docs/source/api/cyclic_result.rst @@ -0,0 +1,8 @@ +.. _ref_cyc_rst_api: + +******************* +Cyclic Result Class +******************* +.. autoclass:: ansys.mapdl.reader.cyclic_reader.CyclicResult + :members: + :noindex: diff --git a/docs/source/api/emat.rst b/docs/source/api/emat.rst new file mode 100644 index 00000000..1de1fc88 --- /dev/null +++ b/docs/source/api/emat.rst @@ -0,0 +1,8 @@ +.. _ref_emat_api: + +******************** +Element Matrix Class +******************** +.. autoclass:: ansys.mapdl.reader.emat.EmatFile + :members: + :noindex: diff --git a/docs/source/api/full.rst b/docs/source/api/full.rst new file mode 100644 index 00000000..6f6b9906 --- /dev/null +++ b/docs/source/api/full.rst @@ -0,0 +1,8 @@ +.. _ref_full_api: + +*************** +Full File Class +*************** +.. autoclass:: ansys.mapdl.reader.full.FullFile + :members: + :noindex: diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst new file mode 100644 index 00000000..9dec8034 --- /dev/null +++ b/docs/source/api/index.rst @@ -0,0 +1,17 @@ +.. _ref_index_api: + +============= +API Reference +============= +This section gives an overview of the API of several public +PyMAPDL-Reader classes, functions, and attributes. + +.. toctree:: + :maxdepth: 1 + + archive + cyclic_result + emat + full + mesh_quality + rst diff --git a/docs/source/api/mesh_quality.rst b/docs/source/api/mesh_quality.rst new file mode 100644 index 00000000..03c53ed8 --- /dev/null +++ b/docs/source/api/mesh_quality.rst @@ -0,0 +1,6 @@ +.. _ref_mesh_quality_api: + +******************** +Compute Cell Quality +******************** +.. autofunction:: ansys.mapdl.reader.cell_quality.quality diff --git a/docs/source/api/rst.rst b/docs/source/api/rst.rst new file mode 100644 index 00000000..a080cebb --- /dev/null +++ b/docs/source/api/rst.rst @@ -0,0 +1,8 @@ +.. _ref_rst_api: + +************ +Result Class +************ +.. autoclass:: ansys.mapdl.reader.rst.Result + :members: + :noindex: diff --git a/docs/source/index.rst b/docs/source/index.rst index a422bc5e..79fd14a5 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -89,6 +89,7 @@ plots results directly from an ANSYS result file using getting_started user_guide/index + api/index examples/index contributing