From e47b1d666c17d64bc95180c3cc2d3d3fa1f26672 Mon Sep 17 00:00:00 2001 From: Alexius Wadell Date: Fri, 18 Nov 2022 12:16:19 -0500 Subject: [PATCH] docs: fix typo in parameter set docs Fix typo identified in https://github.com/pybamm-team/PyBaMM/discussions/2452 Added emphasis on the need to install / reinstall the package --- docs/source/parameters/parameter_sets.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/source/parameters/parameter_sets.rst b/docs/source/parameters/parameter_sets.rst index f3de4eac3a..14ce740662 100644 --- a/docs/source/parameters/parameter_sets.rst +++ b/docs/source/parameters/parameter_sets.rst @@ -17,7 +17,7 @@ Adding Parameter Sets ********************* Parameter sets can be added to PyBaMM by creating a python package, and -registering a `entry point`_ to ``pybamm_parameter_sets``. At a minimum, the +registering a `entry point`_ to ``pybamm_parameter_set``. At a minimum, the package (``cell_parameters``) should consist of the following:: cell_parameters @@ -46,11 +46,11 @@ For an example, see the `Marquis2019`_ parameter sets. ... } -Then register ``get_parameter_values`` to ``pybamm_parameter_sets`` in ``pyproject.toml``: +Then register ``get_parameter_values`` to ``pybamm_parameter_set`` in ``pyproject.toml``: .. code-block:: toml - [project.entry-points.pybamm_parameter_sets] + [project.entry-points.pybamm_parameter_set] cell_alpha = "cell_parameters.cell_alpha:get_parameter_values" If you are using ``setup.py`` or ``setup.cfg`` to setup your package, please @@ -58,6 +58,21 @@ see SetupTools' documentation for registering `entry points`_. .. _entry points: https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins +Finally install you package (``python -m pip install .``), to complete the process. +You will need to reinstall your package every time you add a new parameter set. +If you're actively editing the parameter set it may be helpful to install in +editing mode (``python -m pip install -e .``) instead. + +Once successfully registered, your parameter set will appear within the contents +of ``pybamm.parameter_sets``, along with any other bundled or installed +third-party parameter sets. + +.. doctest:: + + >>> import pybamm + >>> list(pybamm.parameter_sets) + ['Ai2020', 'Chen2020', ...] + If you're willing to open-source your parameter set, `let us know`_, and we can add an entry to :ref:`third-party-parameter-sets`. @@ -70,7 +85,7 @@ If you're willing to open-source your parameter set, Third-Party Parameter Sets ************************** -Registered a new parameter set to ``pybamm_parameter_sets``? +Registered a new parameter set to ``pybamm_parameter_set``? `Let us know`_, and we'll update our list. .. _bundled-parameter-sets: