From 2696095bb02627592c3b49d1706e643cdac58a44 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:12:09 +0100 Subject: [PATCH] docs: extracting information to another rst file (#3549) * docs: extracting information to another rst file * chore: adding changelog file 3549.documentation.md [dependabot-skip] --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/3549.documentation.md | 1 + doc/source/api/index.rst | 1 + doc/source/api/information.rst | 35 +++++++++++ doc/source/api/mapdl.rst | 90 ++++++++++++++++----------- src/ansys/mapdl/core/mapdl_core.py | 15 ++++- src/ansys/mapdl/core/mapdl_grpc.py | 41 ++++++------ 6 files changed, 126 insertions(+), 57 deletions(-) create mode 100644 doc/changelog.d/3549.documentation.md create mode 100644 doc/source/api/information.rst diff --git a/doc/changelog.d/3549.documentation.md b/doc/changelog.d/3549.documentation.md new file mode 100644 index 0000000000..a119c57cd2 --- /dev/null +++ b/doc/changelog.d/3549.documentation.md @@ -0,0 +1 @@ +docs: extracting information to another rst file \ No newline at end of file diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 459792ce43..599d31e141 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -23,6 +23,7 @@ PyMAPDL, see :ref:`ref_mapdl_commands`. database geometry helper + information inline krylov launcher diff --git a/doc/source/api/information.rst b/doc/source/api/information.rst new file mode 100644 index 0000000000..a72b55a4fd --- /dev/null +++ b/doc/source/api/information.rst @@ -0,0 +1,35 @@ +.. _ref_information_api: + +``Information`` module +====================== + +``Information`` class attributes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. currentmodule:: ansys.mapdl.core.information + +.. autosummary:: + :toctree: _autosummary + + Information.aux_capabilities + Information.boundary_condition_information + Information.config_values + Information.database_status + Information.global_status + Information.job_information + Information.load_step_options + Information.mapdl_version + Information.model_information + Information.post_capabilities + Information.preprocessing_capabilities + Information.product + Information.products + Information.pymapdl_version + Information.routine_information + Information.scratch_memory_status + Information.solution_options + Information.solution_options_configuration + Information.stitles + Information.title + Information.titles + Information.units diff --git a/doc/source/api/mapdl.rst b/doc/source/api/mapdl.rst index 5835b572d6..0755b4f35f 100644 --- a/doc/source/api/mapdl.rst +++ b/doc/source/api/mapdl.rst @@ -14,30 +14,68 @@ :toctree: _autosummary Mapdl.add_file_handler + Mapdl.allow_ignore + Mapdl.busy Mapdl.chain_commands + Mapdl.check_parameter_names + Mapdl.default_file_type_for_plots Mapdl.directory + Mapdl.exited + Mapdl.exiting + Mapdl.file_type_for_plots + Mapdl.finish_job_on_exit + Mapdl.force_output Mapdl.get Mapdl.get_array + Mapdl.get_esol + Mapdl.get_nodal_constrains + Mapdl.get_nodal_loads + Mapdl.get_nsol Mapdl.get_value + Mapdl.get_variable + Mapdl.hostname Mapdl.ignore_errors + Mapdl.info + Mapdl.input_strings + Mapdl.is_alive + Mapdl.is_console + Mapdl.is_corba + Mapdl.is_grpc + Mapdl.jobid Mapdl.jobname + Mapdl.kill_job Mapdl.last_response + Mapdl.launched + Mapdl.list_error_file + Mapdl.list_files + Mapdl.load_array Mapdl.load_table - Mapdl.mesh - Mapdl.modal_analysis + Mapdl.locked + Mapdl.logger + Mapdl.mapdl_on_hpc + Mapdl.mute + Mapdl.name Mapdl.non_interactive + Mapdl.on_docker Mapdl.open_apdl_log Mapdl.open_gui - Mapdl.parameters + Mapdl.platform + Mapdl.print_com + Mapdl.process_is_alive + Mapdl.remove_file_handler Mapdl.remove_temp_dir_on_exit Mapdl.result + Mapdl.result_file Mapdl.run + Mapdl.run_as_routine Mapdl.run_multiline - Mapdl.input_strings + Mapdl.save_selection + Mapdl.scalar_param + Mapdl.screenshot Mapdl.set_log_level - Mapdl.version + Mapdl.thermal_result Mapdl.use_vtk - Mapdl.file_type_for_plots + Mapdl.version Constants @@ -57,40 +95,18 @@ Constants .. autosummary:: :toctree: _autosummary + mapdl_grpc.MapdlGrpc.channel_state + mapdl_grpc.MapdlGrpc.check_status + mapdl_grpc.MapdlGrpc.connection mapdl_grpc.MapdlGrpc.download + mapdl_grpc.MapdlGrpc.download_project + mapdl_grpc.MapdlGrpc.download_result + mapdl_grpc.MapdlGrpc.file + mapdl_grpc.MapdlGrpc.ip + mapdl_grpc.MapdlGrpc.is_local mapdl_grpc.MapdlGrpc.list_error_file mapdl_grpc.MapdlGrpc.list_files mapdl_grpc.MapdlGrpc.mute + mapdl_grpc.MapdlGrpc.port mapdl_grpc.MapdlGrpc.upload - -``Information`` class attributes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. currentmodule:: ansys.mapdl.core.information - -.. autosummary:: - :toctree: _autosummary - - Information.product - Information.mapdl_version - Information.pymapdl_version - Information.products - Information.preprocessing_capabilities - Information.aux_capabilities - Information.solution_options - Information.post_capabilities - Information.title - Information.titles - Information.stitles - Information.units - Information.scratch_memory_status - Information.database_status - Information.config_values - Information.global_status - Information.job_information - Information.model_information - Information.boundary_condition_information - Information.routine_information - Information.solution_options_configuration - Information.load_step_options diff --git a/src/ansys/mapdl/core/mapdl_core.py b/src/ansys/mapdl/core/mapdl_core.py index 2a59332b9a..0e5d1cb8a7 100644 --- a/src/ansys/mapdl/core/mapdl_core.py +++ b/src/ansys/mapdl/core/mapdl_core.py @@ -295,7 +295,7 @@ def __init__( self._start_parm: Dict[str, Any] = start_parm self._jobname: str = start_parm.get("jobname", "file") self._path: Union[str, pathlib.Path] = start_parm.get("run_location", None) - self.check_parameter_names = start_parm.get("check_parameter_names", True) + self._check_parameter_names = start_parm.get("check_parameter_names", True) # Setting up loggers self._log: logger = logger.add_instance_logger( @@ -715,8 +715,19 @@ def launched(self): """Check if the MAPDL instance has been launched by PyMAPDL.""" return self._launched + @property + def check_parameter_names(self): + """Whether check if the name which is given to the parameter is allowed or not""" + return self._check_parameter_names + + @check_parameter_names.setter + def check_parameter_names(self, value: bool): + """Whether check if the name which is given to the parameter is allowed or not""" + self._check_parameter_names = value + @property def logger(self) -> logging.Logger: + """MAPDL Python-based logger""" return self._log @property @@ -870,6 +881,8 @@ def post_processing(self) -> "PostProcessing": @property def print_com(self): + """Whether to print or not to the console the + :meth:`mapdl.com ("/COM") ` calls.""" return self._print_com @print_com.setter diff --git a/src/ansys/mapdl/core/mapdl_grpc.py b/src/ansys/mapdl/core/mapdl_grpc.py index 3e80ea3e86..d32f67de61 100644 --- a/src/ansys/mapdl/core/mapdl_grpc.py +++ b/src/ansys/mapdl/core/mapdl_grpc.py @@ -629,6 +629,7 @@ def _is_alive_subprocess(self): @property def process_is_alive(self): + """Check if the MAPDL process is alive""" return self._is_alive_subprocess() def _post_mortem_checks(self): @@ -3403,24 +3404,20 @@ def get_esol( node : int Node number on this element for which data are to be stored. If blank, store the average element value (except - for FMAG values, which are summed instead of averaged). + for ``FMAG`` values, which are summed instead of averaged). item : str - Label identifying the item. General item labels are shown - in Table 134: ESOL - General Item and Component Labels - below. Some items also require a component label. + Label identifying the item. Some items also require a component label. comp : str - Component of the item (if required). General component - labels are shown in Table 134: ESOL - General Item and - Component Labels below. If Comp is a sequence number (n), - the NODE field will be ignored. + Component of the item (if required). If Comp is a sequence number (n), + the ``NODE`` field will be ignored. name : str, optional Thirty-two character name for identifying the item on the printout and displays. The default is a label formed by concatenating the first four characters of the ``item`` and - ``comp`` labels. + ``comp`` labels. tstrt : str, optional Time (or frequency) corresponding to start of IR data. If between @@ -3441,21 +3438,18 @@ def get_esol( Notes ----- By default, this command store temporally the variable on the - variable number set by ``VAR_IR`` in the class MapdlGrpc. + variable number set by ``VAR_IR`` in the class + :class:`Mapdl ` Therefore, any variable in that slot will be deleted when using this command. - See Table: 134:: ESOL - General Item and Component Labels for - a list of valid item and component labels for element (except - line element) results. - - The ESOL command defines element results data to be stored - from a results file (FILE). Not all items are valid for all + The ``ESOL`` command defines element results data to be stored + from a results file (``FILE``). Not all items are valid for all elements. To see the available items for a given element, refer to the input and output summary tables in the documentation for that element. - Two methods of data access are available via the ESOL + Two methods of data access are available via the ``ESOL`` command. You can access some simply by using a generic label (component name method), while others require a label and number (sequence number method). @@ -3476,10 +3470,10 @@ def get_esol( system. Element forces and moments are in the nodal coordinate system. Results are obtainable for an element at a specified node. Further location specifications can be made - for some elements via the SHELL, LAYERP26, and FORCE commands. + for some elements via the ``SHELL``, ``LAYERP26``, and ``FORCE`` commands. For more information on the meaning of contact status and its - possible values, see Reviewing Results in POST1 in the Contact + possible values, see Reviewing Results in ``POST1`` in the Contact Technology Guide. """ self.esol( @@ -3759,6 +3753,15 @@ def get_file_name(path): return os.path.basename(target_dir) def kill_job(self, jobid: int) -> None: + """Kill an HPC job + + Kill a job given its identifier. + + Parameters + ---------- + jobid : int + Job ID. + """ cmd = ["scancel", f"{jobid}"] # to ensure the job is stopped properly, let's issue the scancel twice. subprocess.Popen(cmd)