Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1efb55b
SO101. Support MESP branch for additional DENSF calculation for hydro…
WLChen1118 Feb 13, 2026
bfc8f86
SO--. Apply black format for adfcosmorsconformers.py.
WLChen1118 Feb 13, 2026
345fb16
SO--. Add version info to adfcosmorscompound and adfcosmorsconformers.
WLChen1118 Feb 13, 2026
fa04267
SO--. Remove unnecessary version flag.
WLChen1118 Feb 20, 2026
12a6005
Rosa Bulo (REB) SCMSUITE-- SO107: Fixed bug mdanalysis recipes
rebadam Feb 20, 2026
885553e
Rosa Bulo (REB) SCMSUITE-- SO107: Removed accidental change from test
rebadam Feb 20, 2026
594a0b7
Merge pull request #362 from SCM-NV/RosaBulo/mdanalysis_recipes2026
rebadam Feb 20, 2026
c39e668
Rosa Bulo (REB) SCMSUITE-- SO107: Reduced sensitivity of new test
rebadam Feb 20, 2026
75da99c
Update assertions in mdanalysis tests SO--
dormrod Feb 21, 2026
7911766
Merge pull request #363 from SCM-NV/DavidOrmrodMorley/test-precision-…
dormrod Feb 21, 2026
27bcc54
remove intersphinx extension from PLAMS docs build (now handled globa…
robertrueger Feb 23, 2026
592e156
replace explicit references into Python docs with regular links SO--
robertrueger Feb 23, 2026
8189e10
Merge pull request #364 from SCM-NV/RobertRueger/disable_intersphinx
dormrod Feb 23, 2026
3243136
Merge pull request #361 from SCM-NV/WeiLinChen/adfcosmorsconformers
WLChen1118 Feb 23, 2026
93c83ea
Update ConformersGeneration.rst
CuadradoBenavent Feb 23, 2026
f8f421f
Add what's new section to PLAMS for 2026 SO--
dormrod Feb 24, 2026
69599eb
Merge pull request #366 from SCM-NV/DavidOrmrodMorley/doc-tweaks
dormrod Feb 24, 2026
6b0e22b
Update HydrogenBondsFromMD documentation
CuadradoBenavent Feb 25, 2026
71ec009
Revise BAND_NiO_HubbardU documentation
CuadradoBenavent Feb 26, 2026
3b9024f
Changed amspython to $AMSBIN/amspython
CuadradoBenavent Feb 26, 2026
f116851
Merge pull request #365 from CuadradoBenavent/patch-1
dormrod Feb 26, 2026
925b986
Merge pull request #368 from CuadradoBenavent/patch-3
dormrod Feb 26, 2026
90d2197
Merge pull request #367 from CuadradoBenavent/patch-2
dormrod Feb 26, 2026
de61190
Add benzene dimer xyz to downloads SO--
dormrod Feb 26, 2026
b5e021e
docs: fix some literalincludes of Python code that was missing the la…
robertrueger Mar 3, 2026
f2d111b
Merge pull request #369 from SCM-NV/RobertRueger/fix_syntax_highlighting
robertrueger Mar 3, 2026
8659c79
Fixed bug for hbc_from_MESP=False. SO--.
WLChen1118 Mar 5, 2026
1a31d9c
enforce SCM_DISABLE_MPI for AMSJob with engine VASP SO--
mhellstr Mar 10, 2026
0a4533f
Merge pull request #371 from SCM-NV/mhellstr/vasp-scm-disable-mpi
mhellstr Mar 10, 2026
4c4c76d
allow ChemicalSystem with plams plot_grid_molecules SO--
mhellstr Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ uv pip install $AMSHOME/scripting/scm/amspipe
```
or:
```bash
uv pip install $AMSHOME/scripting/wheels/amspipe-0.1-py3-none-any.whl
uv pip install --index-url "https://<scm-username>:<pwd>@downloads.scm.com/Downloads/packages/uv/channels/2026.1/simple/" \
scm-amspipe scm-external-engines plams
```
To run tests use:
```bash
Expand Down
1 change: 1 addition & 0 deletions doc/source/components/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This chapter gathers information about public functions that can be used in PLAM

.. autofunction:: init
.. autofunction:: finish
.. autofunction:: jobs_in_directory
.. autofunction:: load
.. autofunction:: load_all
.. autofunction:: read_molecules
Expand Down
13 changes: 11 additions & 2 deletions doc/source/components/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Any derived settings class is interchangeable with the base |Settings| class of
Tree-like structure
~~~~~~~~~~~~~~~~~~~~~~~~~

The |Settings| class is based on the regular Python dictionary (built-in class :class:`dict`, tutorial can be found :ref:`here<tut-dictionaries>`) and in many aspects works just like it::
The |Settings| class is based on the regular Python dictionary (built-in class :class:`dict`, tutorial can be found `here <https://docs.python.org/3/tutorial/datastructures.html#tut-dictionaries>`__) and in many aspects works just like it::

>>> s = Settings()
>>> s['abc'] = 283
Expand Down Expand Up @@ -190,7 +190,16 @@ For example:
config.job.pickle = False
config.default_jobrunner = JobRunner(parallel=True, maxjobs=8)

The structure for the defined options on the nested settings objects is defined below.
A context manager ``config_context`` is provided to override the global ``config`` within a specific scope:

.. autofunction:: scm.plams.core.functions.config_context

This can be useful for temporarily disabling or changing global settings.
If you use this context manager, obtain ``config`` with the ``get_config`` function:

.. autofunction:: scm.plams.core.functions.get_config

The structure for all the defined options on the nested settings objects is defined below.

.. autoclass:: ConfigSettings

Expand Down
2 changes: 2 additions & 0 deletions doc/source/components/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ the :ref:`BalanceReactionEquationsExample` example.

.. autofunction:: scm.plams.tools.reaction.balance

.. autoclass:: scm.plams.tools.reaction.ReactionEquation


Older functions:

Expand Down
4 changes: 0 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def setup(app):

extensions += [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_copybutton",
Expand All @@ -206,9 +205,6 @@ def setup(app):
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"python3": ("http://docs.python.org/3.8", None)}

autodoc_default_options = {"members": True, "private-members": True, "special-members": True}
autodoc_member_order = "bysource"
autodoc_typehints = "description"
Expand Down
1 change: 1 addition & 0 deletions doc/source/examples/ADFFrag/ADFFrag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ It simply redirects the usual |AMSResults| methods to the results of the full sy


.. literalinclude:: ../../../../src/scm/plams/recipes/adffragment.py
:language: python

.. include:: ADFFrag.common_header.rst
.. include:: adffrag.ipynb.rst
Expand Down
3 changes: 2 additions & 1 deletion doc/source/examples/ADFNBO/ADFNBO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ No specialized |Results| subclass is defined for ``ADFNBOJob``.
The source code of the whole module:

.. literalinclude:: ../../../../src/scm/plams/recipes/adfnbo.py
:language: python

.. include:: ADFNBO.common_header.rst
.. include:: ADFNBO.ipynb.rst
.. include:: ADFNBO.common_footer.rst
.. include:: ADFNBO.common_footer.rst
8 changes: 7 additions & 1 deletion doc/source/examples/BAND_NiO_HubbardU.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ BAND: NiO with DFT+U

The hubbard method is a way to calculate band gaps for metal oxides for which a normal GGA fails to predict a band gap.

**Example usage:** (:download:`Download BAND_NiO_HubbardU.py <../../../examples/BAND_NiO_HubbardU.py>`)
**Example usage:**

* Download :download:`BAND_NiO_HubbardU.py <../../../examples/BAND_NiO_HubbardU.py>` (run as ``$AMSBIN/amspython BAND_NiO_HubbardU.py``).

.. literalinclude:: ../../../examples/BAND_NiO_HubbardU.py
:language: python

Results
-------

The following results appear upon execution.

.. parsed-literal::

Top of valence band: -6.67 eV
Bottom of conduction band: -5.41 eV
Band gap: 1.25 eV

A folder called ``NiO`` is also created containing other files.
1 change: 1 addition & 0 deletions doc/source/examples/BandFrag/BandFrag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ It simply redirects the usual |AMSResults| methods to the results of the full sy
A derived subclass |NOCVBandFragmentJob| is also provided. It can be usefull for generating NOCV plots after the PEDA-NOCV calculation.

.. literalinclude:: ../../../../src/scm/plams/recipes/bandfragment.py
:language: python

.. include:: BandFrag.common_header.rst
.. include:: bandfrag.ipynb.rst
Expand Down
3 changes: 2 additions & 1 deletion doc/source/examples/COSMORSCompound/COSMORSCompound.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Source code for ``ADFCOSMORSCompound``
.. dropdown::

.. literalinclude:: ../../../../src/scm/plams/recipes/adfcosmorscompound.py
:language: python

Brief API Documentation
-----------------------

.. automodule:: scm.plams.recipes.adfcosmorscompound
:no-special-members:
:exclude-members: _result_type, __init__, new_children, postrun, _get_radii, adf_settings
:exclude-members: _result_type, __init__, new_children, postrun, _get_radii, adf_settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
To follow along, either
To follow along

* Download :download:`ChargeTransferIntegralsADF.py <../../../../examples/ChargeTransferIntegralsADF/ChargeTransferIntegralsADF.py>` (run as ``$AMSBIN/amspython ChargeTransferIntegralsADF.py``).
* Download :download:`BenzeneDimer.xyz <../../../../examples/ChargeTransferIntegralsADF/BenzeneDimer.xyz>`

then, either

* Download :download:`ChargeTransferIntegralsADF.py <../../../../examples/ChargeTransferIntegralsADF/ChargeTransferIntegralsADF.py>` (run as ``$AMSBIN/amspython ChargeTransferIntegralsADF.py``)
* Download :download:`ChargeTransferIntegralsADF.ipynb <../../../../examples/ChargeTransferIntegralsADF/ChargeTransferIntegralsADF.ipynb>` (see also: how to install `Jupyterlab <../../../Scripting/Python_Stack/Python_Stack.html#install-and-run-jupyter-lab-jupyter-notebooks>`__ in AMS)
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Conformers Generation

Example illustrating how to generate conformers with AMS.

**This example is only compatible with AMS2023**.

.. include:: ConformersGeneration.common_header.rst
.. include:: conformers.ipynb.rst
.. include:: ConformersGeneration.common_footer.rst
.. include:: ConformersGeneration.common_footer.rst
13 changes: 11 additions & 2 deletions doc/source/examples/HydrogenBondsFromMD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The script ``get_hbonds.py`` accepts the name of an MD trajectory RKF file, and

.. code-block:: bash

amspython get_hbonds.py path/to/ams.rkf path/to/indices.txt
$AMSBIN/amspython get_hbonds.py path/to/ams.rkf path/to/indices.txt

In its simplest form, the input file indices.txt will contain only one or more element names.

Expand All @@ -29,10 +29,19 @@ The script ``get_hbonds.py``.
.. literalinclude:: ../../../examples/get_hbonds.py
:language: python

**Example usage:**
(:download:`Download get_water_indices.py <../../../examples/get_water_indices.py>`)

The script ``get_water_indices`` can create the file ``indices.txt`` that is required by the ``get_hbonds.py`` script, for the specific case where the indices of all water oxygen atoms are required. The script accepts the name of the MD trajectory RKF file.
The script ``get_water_indices`` can create the file ``indices.txt`` that is required by the ``get_hbonds.py`` script, for the specific case where the indices of all water oxygen atoms are required. The script accepts the name of the MD trajectory RKF file and can be called from the command line as follows.

.. code-block:: bash

$AMSBIN/amspython get_water_indices.py path/to/ams.rkf

The script ``get_water_indices.py``.

.. literalinclude:: ../../../examples/get_water_indices.py
:language: python



32 changes: 27 additions & 5 deletions doc/source/examples/IonicConductivityFromMD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,38 @@ Ionic conductivity from ams.rkf trajectory

First, an ams.rkf trajectory with ions in the system needs to be calculated, as is done, for example, in the
`Ionic Conductivity Tutorial <../../Tutorials/MolecularDynamicsAndMonteCarlo/IonicConductivity.html>`__.
Next, the ionic conductivity for the ions in the solution can be computed. The below script first identifies the ions in the molecular system, and guesses their charges (in the case of metals it uses a simple charge equilibration scheme). It then runs the AMS trajectory analysis tool to compute the ionic conductivity for these ions.
Next, the ionic conductivity for the ions in the solution can be computed. The script below first identifies the ions in the molecular system and guesses their charges (for metals, it uses a simple charge equilibration scheme). It then runs the AMS trajectory analysis tool to compute the ionic conductivity for these ions.

**Example usage:** (:download:`Download get_ionic_conductivity.py <../../../examples/IonicConductivity/get_ionic_conductivity.py>`)

.. code-block:: none
.. code-block:: bash

$AMSBIN/amspython get_ionic_conductivity.py /path/to/ams.rkf

To create an example ams.rkf file, a PLAMS script can be found here (:download:`Download NaClwater.py <../../../examples/IonicConductivity/NaClwater.py>`). This script is designed for efficiency. For a more reliable setup, follow the `Ionic Conductivity Tutorial <../../Tutorials/MolecularDynamicsAndMonteCarlo/IonicConductivity.html>`__.
To create an example ``ams.rkf`` file, you can use this PLAMS script (:download:`Download NaClwater.py <../../../examples/IonicConductivity/NaClwater.py>`). This script is designed for efficiency. For a more reliable setup, follow the `Ionic Conductivity Tutorial <../../Tutorials/MolecularDynamicsAndMonteCarlo/IonicConductivity.html>`__.

.. literalinclude:: ../../../examples/IonicConductivity/get_ionic_conductivity.py
:language: python

:language: python

**Results**

If you have used the ``ams.rkf`` generated from running ``$AMSBIN/amspython NaClwater.py``,
the output from ``get_ionic_conductivity.py`` should look something like:

.. parsed-literal::
Average temperature 298.166533 K
Ion N Charge
Na 5 1.00000
Cl 5 -1.00000
[20.02|15:06:43] JOB plamsjob STARTED
[20.02|15:06:43] JOB plamsjob RUNNING
[20.02|15:06:43] JOB plamsjob FINISHED
[20.02|15:06:43] JOB plamsjob SUCCESSFUL
Na 2.4739268145933062e-09 m2/s
[20.02|15:06:43] JOB plamsjob STARTED
[20.02|15:06:43] Renaming job plamsjob to plamsjob.002
[20.02|15:06:43] JOB plamsjob.002 RUNNING
[20.02|15:06:43] JOB plamsjob.002 FINISHED
[20.02|15:06:43] JOB plamsjob.002 SUCCESSFUL
Cl 3.2624546292849828e-09 m2/s
Ionic conductivity: 2.6075090545e+01 Siemens/m
3 changes: 2 additions & 1 deletion doc/source/examples/NumGrad/NumGrad.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Any function that takes results of a single point job and returns a single numbe
The source code of the whole module with both abovementioned classes:

.. literalinclude:: ../../../../src/scm/plams/recipes/numgrad.py
:language: python

.. include:: NumGrad.common_header.rst
.. include:: NumGrad.ipynb.rst
.. include:: NumGrad.common_footer.rst
.. include:: NumGrad.common_footer.rst
3 changes: 2 additions & 1 deletion doc/source/examples/NumHess/NumHess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The returned Hessian can optionally be mass weighted.
The source code of the whole module with both aforementioned classes:

.. literalinclude:: ../../../../src/scm/plams/recipes/numhess.py
:language: python

.. include:: NumHess.common_header.rst
.. include:: NumHess.ipynb.rst
.. include:: NumHess.common_footer.rst
.. include:: NumHess.common_footer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ In this recipe we build a job class ``ReorganizationEnergyJob`` by extending |Mu
In ``ReorganizationEnergyResults``, the reorganization energy is computed by fetching and combining the results from the children jobs.

.. literalinclude:: ../../../../src/scm/plams/recipes/reorganization_energy.py
:language: python


.. include:: ReorganizationEnergy.common_header.rst
Expand Down
1 change: 1 addition & 0 deletions doc/source/examples/pyAHFCDOS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ The ``FCFDOS`` class allows one to easily calculate the density of states for an
For an example, see :ref:`Vibronic Density of States with ADF<fcf_dos>`.

.. literalinclude:: ../../../src/scm/plams/recipes/fcf_dos.py
:language: python


41 changes: 41 additions & 0 deletions doc/source/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,47 @@ The latest (unreleased) development version can be downloaded from the `trunk br
Once the downloaded zip file has been extracted, navigate to its location and run ``pip install .`` to install into your Python environment.


What's new in PLAMS for AMS2026?
--------------------------------------

Added
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Improved molecular visualization. The :func:`~scm.plams.tools.view.view` function allows visualization of molecules and chemical systems using AMSView, which can be easily rendered in a Jupyter notebook or saved as images.
* Improvements to the |JobAnalysis| tool for collecting and analyzing job results, with additional methods:
* :meth:`~scm.plams.tools.job_analysis.JobAnalysis.add_rkf_field` to simplify adding values from an RKF file to the analysis
* :meth:`~scm.plams.tools.job_analysis.JobAnalysis.get_settings_field_key` and :meth:`~scm.plams.tools.job_analysis.JobAnalysis.get_rkf_field_key` methods to simplify getting the keys for analysis fields
* Additional functionality to assist with workflows:
* :func:`~scm.plams.core.functions.jobs_in_directory` context manager to allow jobs to run in a subdirectory of the PLAMS working directory
* :meth:`~scm.plams.core.basejob.Job.delete` and :meth:`~scm.plams.core.basejob.Job.rename` methods for deleting/renaming job files and directories
* :meth:`~scm.plams.core.settings.JobSettings.on_status_change` callback, available on global ``config``, which fires any time a job status is updated and allows notifications when jobs finish or error
* :func:`~scm.plams.core.functions.config_context` context manager and :func:`~scm.plams.core.functions.get_config` function allow context-based override of global ``config`` settings
* Additional methods to get results from AMS calculations:
* :meth:`~scm.plams.interfaces.adfsuite.ams.AMSResults.get_pvdos` method to get partial vibrational spectra
* :meth:`~scm.plams.interfaces.adfsuite.ams.AMSResults.get_main_engine_name`
* :meth:`~scm.plams.interfaces.adfsuite.ams.AMSResults.get_reduced_masses`
* Dedicated job for Energy Decomposition Analysis in BAND |BANDFragmentJob|
* Method :meth:`~scm.plams.tools.reaction.balance` to find a balanced :class:`~scm.plams.tools.reaction.ReactionEquation`
* Many type hints added across the code to aid scripting through an IDE

Changed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* :class:`~scm.plams.interfaces.adfsuite.amsanalysis.AMSAnalysisJob` has PISA support, accepts multiple |AMSJob| instances as input, and no longer overwrites user-supplied input settings
* :meth:`~scm.plams.interfaces.adfsuite.ams.AMSResults.get_normal_modes` explicitly gives the option to return mass-weighted Hessian eigenvectors
* |JobAnalysis| returns an updated copy on modification instead of performing operations in-place
* :func:`~scm.plams.interfaces.molecule.packmol.packmol` function made more flexible, now accepting a single ``None`` value for ``n_molecules`` if two of ``n_atoms``, ``density`` and ``box_bounds`` are specified (the missing value is then auto-calculated)

Fixed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Method to guess density in :func:`~scm.plams.interfaces.molecule.packmol.packmol_around` changed to resolve large underestimations in molecular volumes

Deprecated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* :func:`~scm.plams.core.functions.add_to_class` decorator is deprecated in favor of using standalone functions or subclasses

What's new in PLAMS for AMS2025?
--------------------------------------

Expand Down
30 changes: 17 additions & 13 deletions src/scm/plams/core/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,27 @@
@contextmanager
def config_context() -> Generator[ConfigSettings, None, None]:
"""
Enter a context with a |config| specific only to the current context.
Enter a context with a ``config`` specific only to the current context.

The global |config| will be copied into a new |ConfigSettings|, which can then be modified independently of the global instance.
The global ``config`` will be copied into a new |ConfigSettings|, which can then be modified independently of the global instance.

The |config| for this context can be retrieved using the function :func:`get_config`.
The ``config`` for this context can be retrieved using the function :func:`get_config`.

.. note::

.. note::
Starting a new thread creates a new context, so the context configuration will not automatically be used in the new thread.
To copy over the parent thread context to the new thread, instead use :class:`~scm.plams.core.threading_utils.ContextAwareThread`

.. code:: python
>>> with config_context() as cfg:
>>> cfg.log.stdout = 0
>>> print(f"Stdout logging inside context disabled: {get_config().log.stdout == 0}")
>>> print(f"Stdout logging outside context disabled: {get_config().log.stdout == 0}")
Stdout logging inside context disabled: True
Stdout logging outside context disabled: False
.. code:: python

>>> with config_context() as cfg:
>>> cfg.log.stdout = 0
>>> print(f"Stdout logging inside context disabled: {get_config().log.stdout == 0}")
>>> print(f"Stdout logging outside context disabled: {get_config().log.stdout == 0}")
Stdout logging inside context disabled: True
Stdout logging outside context disabled: False

:return: copy of the global |config| instance in a new |ConfigSettings|
:return: copy of the global ``config`` instance in a new |ConfigSettings|
"""
cfg: ConfigSettings = get_config().copy()
token = _config.set(cfg)
Expand All @@ -72,7 +74,7 @@ def get_config() -> ConfigSettings:
"""
Get the |ConfigSettings| for the current code context.

This will be the configuration used within a :func:`config_context` context, or otherwise the global |config|.
This will be the configuration used within a :func:`config_context` context, or otherwise the global ``config``.

:return: |ConfigSettings| that should be used in the current code context
"""
Expand Down Expand Up @@ -658,6 +660,7 @@ def jobs_in_directory(path: Union[str, os.PathLike]) -> Generator[Path, None, No
* The absolute path of the directory is returned on entering the context, which assumes the default |JobManager| is used. If another job manager is used within the context, the actual directory will be relative to its ``workdir``.

.. code:: python

>>> with jobs_in_directory("GeometryOptimization") as go_dir:
>>> with jobs_in_directory("DFTB"):
>>> job1.run()
Expand All @@ -671,6 +674,7 @@ def jobs_in_directory(path: Union[str, os.PathLike]) -> Generator[Path, None, No
path/plams_workdir/GeometryOptimization/ML/M3GNet/job2

.. note::

Starting a new thread creates a new context, so the context configuration will not automatically be used in the new thread.
To copy over the parent thread context to the new thread, instead use :class:`~scm.plams.core.threading_utils.ContextAwareThread`

Expand Down
2 changes: 1 addition & 1 deletion src/scm/plams/core/jobrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def wrapper(self: SelfT, /, *args: P.args, **kwargs: P.kwargs) -> None:


def _limit(func: Callable[Concatenate[SelfT, P], None]) -> Callable[Concatenate[SelfT, P], None]:
"""Decorator for an instance method. If ``_job_limit`` attribute of given instance is not ``None``, use this attribute to wrap decorated method via :ref:`with<with-locks>` statement."""
"""Decorator for an instance method. If ``_job_limit`` attribute of given instance is not ``None``, use this attribute to wrap decorated method via `with <https://docs.python.org/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement>`__ statement."""

@functools.wraps(func)
def wrapper(self: SelfT, /, *args: P.args, **kwargs: P.kwargs) -> None:
Expand Down
Loading
Loading