.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples/01-model_recomputation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__examples_01-model_recomputation.py: .. _ref_model_recomputation: Model recomputation =================== This example demonstrates how to relaunch a model build using the latest model configuration in a same project. .. GENERATED FROM PYTHON SOURCE LINES 13-15 Import necessary libraries -------------------------- .. GENERATED FROM PYTHON SOURCE LINES 15-20 .. code-block:: Python import ansys.simai.core as asc simai = asc.from_config() .. GENERATED FROM PYTHON SOURCE LINES 21-23 Get the project from the server ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 23-26 .. code-block:: Python my_project = simai.projects.get(name="old-ps") .. GENERATED FROM PYTHON SOURCE LINES 27-30 Get the model configuration --------------------------- Get the latest model configuration of the project. .. GENERATED FROM PYTHON SOURCE LINES 30-33 .. code-block:: Python last_build_config = my_project.last_model_configuration .. GENERATED FROM PYTHON SOURCE LINES 34-37 Verify the project requirements ------------------------------- Verify that the project meets the requirements for training (model building). .. GENERATED FROM PYTHON SOURCE LINES 37-40 .. code-block:: Python is_trainable_check = my_project.is_trainable() .. GENERATED FROM PYTHON SOURCE LINES 41-43 If the project met the requirements, launch a model build. Otherwise, print the reasons the project does not meet the requirements. .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: Python if is_trainable_check: new_model = simai.models.build(last_build_config) else: print(is_trainable_check.reason) .. _sphx_glr_download__examples_01-model_recomputation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01-model_recomputation.ipynb <01-model_recomputation.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01-model_recomputation.py <01-model_recomputation.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 01-model_recomputation.zip <01-model_recomputation.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_