Skip to content

Commit 8ae0a0a

Browse files
DOC: Add readme instructions to pysindy
1 parent bdca07a commit 8ae0a0a

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

.github/workflows/notify-experiments.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ on:
22
push:
33
branches:
44
- master
5-
- example-directory
65

76
jobs:
87
notify-notebook:

README.rst

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -173,25 +173,24 @@ Community guidelines
173173

174174
Contributing examples
175175
^^^^^^^^^^^^^^^^^^^^^
176-
We love seeing examples of PySINDy being used to solve interesting problems! If you would like to contribute an example, reach out to us by creating an issue.
177-
178-
At a minimum, we need to be able to run the example notebooks in the normal mode as well as in a test mode that uses smaller data in order to run faster and simply verify that cells execute without error. In order to do that, your example should obey the following directory tree
179-
180-
.. code-block::
181-
182-
./<name_of_example>/
183-
\
184-
|-example.py # save your notebook as a python script
185-
|-example_data.py # has functions to create/load data
186-
|-mock_data.py # has functions with same name as in example_data.py which create/load smaller datasets
187-
|-example.ipynb # run python examples/publish_notebook/<name_of_example> to generate this. Needs packages in requirements-dev.txt
188-
|-utils.py (Any other names example.py needs to import. Any additional local modules imported by example.py need to be submodules of utils.py, e.g. utils.plotting)
189-
190-
You can optimize your notebook for testing by checking ``__name__``. When our tests run ``example.py`` they set the ``__name__`` global to ``"testing"``. For instance, your notebook should determine whether to import from ``mock_data`` or ``example_data`` using this method (another example: you could also use this method to set ``max_iter``). It's a bit arbitrary, but try to make your examples run in under ten seconds using the mock data. You can use our test to verify your example in testing mode:
191-
192-
.. code-block::
193-
194-
pytest -k test_external --external-notebook="path/to/<name_of_example>"
176+
We love seeing examples of PySINDy being used to solve interesting problems! If you would like to contribute an example to the documentation, reach out to us by creating an issue.
177+
178+
Examples are external repositories that
179+
`follow a structure <https://github.com/dynamicslab/pysindy-example>`_ that pysindy
180+
knows how to incorporate into its documentation build. They tend to be pinned to
181+
a set of dependencies and may not be kept up to date with breaking API changes.
182+
183+
The linked repository has information on how to set up your example. To PR the example
184+
into this repository, (a) edit examples/external.yml and examples/README.rst with your
185+
repository information and (b) verify your own build passes in your repository,
186+
including publishing on github pages. If you want to keep your example up to date with
187+
the pysindy main branch, (c) add your repository information to the ``notify-experiments``
188+
workflow so that pysindy will trigger your notebooks to be run in CI in your own repo.
189+
This will require adding a
190+
`fine-grained PAT <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens>`_
191+
with the permissions ``contents: read & write`` and ``metadata: read only`` to the
192+
pysindy GH secrets. Alternatively, you can just trigger your builds based on cron timing.
193+
See the pysindy experiments repo for more information.
195194

196195

197196
Contributing code

0 commit comments

Comments
 (0)