.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "fitting_examples/plot_constraints.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_fitting_examples_plot_constraints.py: Constraints example =================== This example shows the usages of the different constraints. .. GENERATED FROM PYTHON SOURCE LINES 6-18 .. code-block:: Python from easyCore.Fitting import Constraints from easyCore.Objects.ObjectClasses import Parameter p1 = Parameter('p1', 1) constraint = Constraints.NumericConstraint(p1, '<', 5) p1.user_constraints['c1'] = constraint for value in range(4, 7): p1.value = value print(f'Set Value: {value}, Parameter Value: {p1}') .. rst-class:: sphx-glr-script-out .. code-block:: none Set Value: 4, Parameter Value: Set Value: 5, Parameter Value: Set Value: 6, Parameter Value: .. GENERATED FROM PYTHON SOURCE LINES 19-23 To include embedded rST, use a line of >= 20 ``#``'s or ``#%%`` between your rST and your code. This separates your example into distinct text and code blocks. You can continue writing code below the embedded rST text block: .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.007 seconds) .. _sphx_glr_download_fitting_examples_plot_constraints.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_constraints.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_constraints.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_