From f3a22c96a3f84db905bc78f6c91a81dec50cd839 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 22:49:20 -0400 Subject: [PATCH 01/14] MNT: make it easier to update a list of entry points in the future --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9ec4bbc9..32aaf740 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ entry_points={ "console_scripts": [ # 'command = some.module:some_function', - "json-yaml-converter = sirepo_bluesky.utils.json_yaml_converter:cli_converter" + "json-yaml-converter = sirepo_bluesky.utils.json_yaml_converter:cli_converter", ], }, include_package_data=True, From d61ee01c729975a2c55b17459baba6e8f4d933cb Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 23:02:06 -0400 Subject: [PATCH 02/14] ENH: move the RE env preparation code to the library Usage: In [1]: from sirepo_bluesky import prepare_re_env ...: %run -i $prepare_re_env.__file__ --help usage: prepare_re_env.py [-h] [-d DB_TYPE] [-r ROOT_DIR] [-e {stepper,flyer}] Prepare bluesky environment optional arguments: -h, --help show this help message and exit -d DB_TYPE, --db-type DB_TYPE Type of databroker ('local', 'temp', etc.) -r ROOT_DIR, --root-dir ROOT_DIR The root dir to create YYYY/MM/DD dir structure -e {stepper,flyer}, --env-type {stepper,flyer} Type of RE environment (['stepper', 'flyer']) --- examples/prepare_det_env.py | 36 ---------- examples/prepare_flyer_env.py | 32 --------- sirepo_bluesky/__init__.py | 1 + sirepo_bluesky/utils/prepare_re_env.py | 91 ++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 68 deletions(-) delete mode 100644 examples/prepare_det_env.py delete mode 100644 examples/prepare_flyer_env.py create mode 100644 sirepo_bluesky/utils/prepare_re_env.py diff --git a/examples/prepare_det_env.py b/examples/prepare_det_env.py deleted file mode 100644 index 46f25c09..00000000 --- a/examples/prepare_det_env.py +++ /dev/null @@ -1,36 +0,0 @@ -import datetime -import json # noqa F401 - -import bluesky.plan_stubs as bps # noqa F401 -import bluesky.plans as bp # noqa F401 -import databroker -import matplotlib.pyplot as plt -import numpy as np # noqa F401 -from bluesky.callbacks import best_effort -from bluesky.run_engine import RunEngine -from databroker import Broker -from ophyd.utils import make_dir_tree - -from sirepo_bluesky.shadow_handler import ShadowFileHandler -from sirepo_bluesky.srw_handler import SRWFileHandler - -RE = RunEngine({}) -bec = best_effort.BestEffortCallback() -RE.subscribe(bec) - -# MongoDB backend: -db = Broker.named("local") # mongodb backend -try: - databroker.assets.utils.install_sentinels(db.reg.config, version=1) -except Exception: - pass - -RE.subscribe(db.insert) -db.reg.register_handler("srw", SRWFileHandler, overwrite=True) -db.reg.register_handler("shadow", ShadowFileHandler, overwrite=True) -db.reg.register_handler("SIREPO_FLYER", SRWFileHandler, overwrite=True) - -plt.ion() - -root_dir = "/tmp/sirepo-bluesky-data" -_ = make_dir_tree(datetime.datetime.now().year, base_path=root_dir) diff --git a/examples/prepare_flyer_env.py b/examples/prepare_flyer_env.py deleted file mode 100644 index e64cf28f..00000000 --- a/examples/prepare_flyer_env.py +++ /dev/null @@ -1,32 +0,0 @@ -import datetime - -import bluesky.plan_stubs as bps # noqa F401 -import bluesky.plans as bp # noqa F401 -import databroker -from bluesky.callbacks import best_effort -from bluesky.run_engine import RunEngine -from databroker import Broker -from ophyd.utils import make_dir_tree - -from sirepo_bluesky.madx_handler import MADXFileHandler -from sirepo_bluesky.srw_handler import SRWFileHandler - -RE = RunEngine({}) -bec = best_effort.BestEffortCallback() -bec.disable_plots() -RE.subscribe(bec) - -# MongoDB backend: -db = Broker.named("local") # mongodb backend -try: - databroker.assets.utils.install_sentinels(db.reg.config, version=1) -except Exception: - pass - -RE.subscribe(db.insert) -db.reg.register_handler("srw", SRWFileHandler, overwrite=True) -db.reg.register_handler("SIREPO_FLYER", SRWFileHandler, overwrite=True) -db.reg.register_handler("madx", MADXFileHandler, overwrite=True) - -root_dir = "/tmp/sirepo-bluesky-data" -_ = make_dir_tree(datetime.datetime.now().year, base_path=root_dir) diff --git a/sirepo_bluesky/__init__.py b/sirepo_bluesky/__init__.py index 08ecbef5..8bac5028 100644 --- a/sirepo_bluesky/__init__.py +++ b/sirepo_bluesky/__init__.py @@ -1,6 +1,7 @@ from ophyd import Signal from ._version import get_versions +from .utils import prepare_re_env # noqa: F401 __version__ = get_versions()["version"] del get_versions diff --git a/sirepo_bluesky/utils/prepare_re_env.py b/sirepo_bluesky/utils/prepare_re_env.py new file mode 100644 index 00000000..f3ae4e15 --- /dev/null +++ b/sirepo_bluesky/utils/prepare_re_env.py @@ -0,0 +1,91 @@ +import argparse +import datetime +import json # noqa F401 + +import bluesky.plan_stubs as bps # noqa F401 +import bluesky.plans as bp # noqa F401 +import databroker +import matplotlib.pyplot as plt +import numpy as np # noqa F401 +from bluesky.callbacks import best_effort +from bluesky.run_engine import RunEngine +from databroker import Broker +from ophyd.utils import make_dir_tree + +DEFAULT_DB_TYPE = "local" +DEFAULT_ROOT_DIR = "/tmp/sirepo-bluesky-data" +DEFAULT_ENV_TYPE = "stepper" + + +def re_env(db_type=DEFAULT_DB_TYPE, root_dir=DEFAULT_ROOT_DIR): + RE = RunEngine({}) + bec = best_effort.BestEffortCallback() + RE.subscribe(bec) + + db = Broker.named(db_type) + try: + databroker.assets.utils.install_sentinels(db.reg.config, version=1) + except Exception: + pass + RE.subscribe(db.insert) + + _ = make_dir_tree(datetime.datetime.now().year, base_path=root_dir) + + return dict(RE=RE, db=db, bec=bec) + + +def register_handlers(db, handlers): + for handler_spec, handler_class in handlers.items(): + db.reg.register_handler(handler_spec, handler_class, overwrite=True) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Prepare bluesky environment") + parser.add_argument( + "-d", + "--db-type", + dest="db_type", + default=DEFAULT_DB_TYPE, + help="Type of databroker ('local', 'temp', etc.)", + ) + parser.add_argument( + "-r", + "--root-dir", + dest="root_dir", + default=DEFAULT_ROOT_DIR, + help="The root dir to create YYYY/MM/DD dir structure.", + ) + + env_choices = ["stepper", "flyer"] + parser.add_argument( + "-e", + "--env-type", + dest="env_type", + choices=env_choices, + default=DEFAULT_ENV_TYPE, + help="Type of RE environment.", + ) + + args = parser.parse_args() + kwargs_re = dict(db_type=args.db_type, root_dir=args.root_dir) + ret = re_env(**kwargs_re) + globals().update(**ret) + + from sirepo_bluesky.srw_handler import SRWFileHandler + + if args.env_type == "stepper": + from sirepo_bluesky.shadow_handler import ShadowFileHandler + + handlers = {"srw": SRWFileHandler, "SIREPO_FLYER": SRWFileHandler, "shadow": ShadowFileHandler} + plt.ion() + elif args.env_type == "flyer": + from sirepo_bluesky.madx_handler import MADXFileHandler + + handlers = {"srw": SRWFileHandler, "SIREPO_FLYER": SRWFileHandler, "madx": MADXFileHandler} + bec.disable_plots() # noqa: F821 + else: + raise RuntimeError( + f"Unknown environment type: {args.env_type}.\nAvailable environment types: {env_choices}" + ) + + register_handlers(db, handlers) # noqa: F821 From 50ff3cd18a99d2454415f97e1fe1cdc6e0657e0d Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 23:04:04 -0400 Subject: [PATCH 03/14] CLN: remove irrelevant test (entrypoints for db are not used) --- sirepo_bluesky/tests/test_entrypoint.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 sirepo_bluesky/tests/test_entrypoint.py diff --git a/sirepo_bluesky/tests/test_entrypoint.py b/sirepo_bluesky/tests/test_entrypoint.py deleted file mode 100644 index a6f28c1f..00000000 --- a/sirepo_bluesky/tests/test_entrypoint.py +++ /dev/null @@ -1,6 +0,0 @@ -from databroker import Broker - - -def test_broker(): - db = Broker.named("local") - return db From 9998b82c8f2d6716dad42752f0164249883d6512 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 23:18:21 -0400 Subject: [PATCH 04/14] DOC: use `prepare_re_env` in notebooks --- docs/source/notebooks/madx.ipynb | 4 +++- docs/source/notebooks/shadow.ipynb | 10 +++++++--- docs/source/notebooks/srw.ipynb | 12 +++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/source/notebooks/madx.ipynb b/docs/source/notebooks/madx.ipynb index 942a9c57..24ca93d5 100644 --- a/docs/source/notebooks/madx.ipynb +++ b/docs/source/notebooks/madx.ipynb @@ -24,7 +24,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_flyer_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__ -e flyer\n", "\n", "import matplotlib.pyplot as plt\n", "\n", diff --git a/docs/source/notebooks/shadow.ipynb b/docs/source/notebooks/shadow.ipynb index 9431dded..ec9ef62d 100644 --- a/docs/source/notebooks/shadow.ipynb +++ b/docs/source/notebooks/shadow.ipynb @@ -36,7 +36,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_det_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__\n", "\n", "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import BeamStatisticsReport, create_classes\n", @@ -104,7 +106,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_det_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__\n", "\n", "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import BeamStatisticsReport, create_classes\n", @@ -190,7 +194,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/docs/source/notebooks/srw.ipynb b/docs/source/notebooks/srw.ipynb index 4d306fa6..237e2257 100644 --- a/docs/source/notebooks/srw.ipynb +++ b/docs/source/notebooks/srw.ipynb @@ -36,7 +36,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_det_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__\n", "\n", "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", @@ -103,7 +105,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_det_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__\n", "\n", "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", @@ -184,7 +188,9 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../../examples/prepare_det_env.py\n", + "from sirepo_bluesky import prepare_re_env\n", + "\n", + "%run -i $prepare_re_env.__file__\n", "\n", "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", From 991250fd2251f7a914c7b938ead43f08630f5652 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 23:32:39 -0400 Subject: [PATCH 05/14] CI: speed up python setup step by using native python, not conda --- .github/workflows/docs.yml | 27 +++++++++++++++------------ .github/workflows/testing.yml | 30 ++++++++++++++---------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0a0440fe..6ca536f0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,32 +44,35 @@ jobs: with: docker-binary: ${{ env.DOCKER_BINARY }} - - name: Set up Python ${{ matrix.python-version }} with conda - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} - auto-update-conda: true - miniconda-version: "latest" python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge + + # - name: Set up Python ${{ matrix.python-version }} + # uses: conda-incubator/setup-miniconda@v2 + # with: + # activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} + # auto-update-conda: true + # miniconda-version: "latest" + # python-version: ${{ matrix.python-version }} + # mamba-version: "*" + # channels: conda-forge - name: Install documentation-building requirements run: | set -vxeo pipefail - conda env list - mamba install -c conda-forge pandoc - pip install --upgrade pip wheel + sudo apt-get update && sudo apt-get install pandoc + python -m pip install --upgrade pip wheel pip install -v . pip install -r requirements-dev.txt pip list - conda list - name: Copy databroker config file run: | set -vxeuo pipefail mkdir -v -p ~/.config/databroker/ - cp examples/local.yml ~/.config/databroker/ + cp -v examples/local.yml ~/.config/databroker/ - name: Build Docs run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3da1e52f..d09bb802 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -44,36 +44,34 @@ jobs: with: docker-binary: ${{ env.DOCKER_BINARY }} - - name: Set up Python ${{ matrix.python-version }} with conda - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} - auto-update-conda: true - miniconda-version: "latest" python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge + + # - name: Set up Python ${{ matrix.python-version }} with conda + # uses: conda-incubator/setup-miniconda@v2 + # with: + # activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} + # auto-update-conda: true + # miniconda-version: "latest" + # python-version: ${{ matrix.python-version }} + # mamba-version: "*" + # channels: conda-forge - name: Install the package and its dependencies run: | - # set -vxeuo pipefail - # Do not check for unbound variables (the '-u' flag) as it fails on - # conda deactivate command: - # /usr/share/miniconda3/envs/sirepo-bluesky-py3.9/etc/conda/deactivate.d/glib_deactivate.sh: - # line 1: GSETTINGS_SCHEMA_DIR_CONDA_BACKUP: unbound variable set -vxeo pipefail - conda env list - pip install --upgrade pip wheel + python -m pip install --upgrade pip wheel pip install -v . pip install -r requirements-dev.txt pip list - conda list - name: Copy databroker config file run: | set -vxeuo pipefail mkdir -v -p ~/.config/databroker/ - cp examples/local.yml ~/.config/databroker/ + cp -v examples/local.yml ~/.config/databroker/ - name: Test with pytest run: | From 81a83590f35d1287ae4867e402b90e83436aaa40 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Wed, 16 Aug 2023 23:51:56 -0400 Subject: [PATCH 06/14] TST: fix failing test for flyer --- sirepo_bluesky/tests/test_sirepo_flyer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sirepo_bluesky/tests/test_sirepo_flyer.py b/sirepo_bluesky/tests/test_sirepo_flyer.py index fd1a181d..90075693 100644 --- a/sirepo_bluesky/tests/test_sirepo_flyer.py +++ b/sirepo_bluesky/tests/test_sirepo_flyer.py @@ -68,7 +68,7 @@ def _test_sirepo_flyer(RE_no_plot, db, tmpdir, sim_id, server_name): hdr = db[-1] t = hdr.table(stream_name="sirepo_flyer") db_means = [] - actual_means = [ + expected_means = [ 36779651609602.38, 99449330615601.89, 149289119385413.34, @@ -78,7 +78,9 @@ def _test_sirepo_flyer(RE_no_plot, db, tmpdir, sim_id, server_name): for i in range(len(t)): db_means.append(t.iloc[i]["sirepo_flyer_mean"]) - assert set(actual_means) == set(db_means), "fly scan means do not match actual means" + assert np.allclose( + sorted(expected_means), sorted(db_means), rtol=1.0e-6 + ), "fly scan expected means do not match actual means" durations = [] for i in range(len(t)): From bcf1ee1b4c8461699ec93b1e895b6068326a267c Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 00:15:27 -0400 Subject: [PATCH 07/14] CI: install `pandoc` from GH releases (v3.1.6.1) --- .github/workflows/docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6ca536f0..63bda616 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -62,7 +62,8 @@ jobs: - name: Install documentation-building requirements run: | set -vxeo pipefail - sudo apt-get update && sudo apt-get install pandoc + wget https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb -O /tmp/pandoc.deb + sudo dpkg -i /tmp/pandoc.deb python -m pip install --upgrade pip wheel pip install -v . pip install -r requirements-dev.txt From 316120eccf8b8da30182622abac15765cc9f820f Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 00:30:00 -0400 Subject: [PATCH 08/14] CI: less progress info from `wget` --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 63bda616..dca928a3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -62,7 +62,7 @@ jobs: - name: Install documentation-building requirements run: | set -vxeo pipefail - wget https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb -O /tmp/pandoc.deb + wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb sudo dpkg -i /tmp/pandoc.deb python -m pip install --upgrade pip wheel pip install -v . From 055710c15047a13519ed07d259a7f2bea4d11b65 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 00:40:02 -0400 Subject: [PATCH 09/14] CI: try building docs with Python 3.10 --- .github/workflows/docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dca928a3..7f9cb78b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] fail-fast: false defaults: @@ -65,9 +65,9 @@ jobs: wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb sudo dpkg -i /tmp/pandoc.deb python -m pip install --upgrade pip wheel - pip install -v . - pip install -r requirements-dev.txt - pip list + python -m pip install -v . + python -m pip install -r requirements-dev.txt + python -m pip list - name: Copy databroker config file run: | From b5b7ba11e183c6707637966d5dda28d2776fee2d Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 01:03:09 -0400 Subject: [PATCH 10/14] CI: sync pip install steps in all workflows; docs build with 3.9; separate pandoc installation step. --- .github/workflows/docs.yml | 10 +++++++--- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/testing.yml | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7f9cb78b..a55c168c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.9"] fail-fast: false defaults: @@ -59,11 +59,15 @@ jobs: # mamba-version: "*" # channels: conda-forge - - name: Install documentation-building requirements + - name: Install system documentation-building requirements run: | - set -vxeo pipefail + set -vxeuo pipefail wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb sudo dpkg -i /tmp/pandoc.deb + + - name: Install python documentation-building requirements + run: | + set -vxeuo pipefail python -m pip install --upgrade pip wheel python -m pip install -v . python -m pip install -r requirements-dev.txt diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 3dad078f..007955e9 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -30,7 +30,7 @@ jobs: run: | set -vxeuo pipefail python -m pip install --upgrade pip - pip install wheel setuptools + python -m pip install wheel setuptools python setup.py sdist bdist_wheel - name: Publish wheels to PyPI diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d09bb802..bd0dab11 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -63,9 +63,9 @@ jobs: run: | set -vxeo pipefail python -m pip install --upgrade pip wheel - pip install -v . - pip install -r requirements-dev.txt - pip list + python -m pip install -v . + python -m pip install -r requirements-dev.txt + python -m pip list - name: Copy databroker config file run: | From c1f3f3305ba0763f9bf15f5445ebc54e62b1655b Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 01:16:50 -0400 Subject: [PATCH 11/14] CI: add diagnostics steps to check pandoc is available --- .github/workflows/docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a55c168c..c3142a51 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -64,6 +64,8 @@ jobs: set -vxeuo pipefail wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb sudo dpkg -i /tmp/pandoc.deb + which pandoc + pandoc --version - name: Install python documentation-building requirements run: | From ec014a41e2a72e7a3968be08371255e8e64a7e36 Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 01:56:11 -0400 Subject: [PATCH 12/14] CI: install `pandoc` via conda --- .github/workflows/docs.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c3142a51..7edd6e0f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,30 +44,31 @@ jobs: with: docker-binary: ${{ env.DOCKER_BINARY }} - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - # - name: Set up Python ${{ matrix.python-version }} - # uses: conda-incubator/setup-miniconda@v2 + # uses: actions/setup-python@v4 # with: - # activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} - # auto-update-conda: true - # miniconda-version: "latest" # python-version: ${{ matrix.python-version }} - # mamba-version: "*" - # channels: conda-forge - - name: Install system documentation-building requirements + - name: Set up Python ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} + auto-update-conda: true + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + + - name: Install documentation-building requirements with conda run: | set -vxeuo pipefail - wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb - sudo dpkg -i /tmp/pandoc.deb + # wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb + # sudo dpkg -i /tmp/pandoc.deb + conda install -c conda-forge -y pandoc which pandoc pandoc --version - - name: Install python documentation-building requirements + - name: Install documentation-building requirements with pip run: | set -vxeuo pipefail python -m pip install --upgrade pip wheel From cf3009401e2e6793205f36521d6ef13f4bdf649c Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 02:50:22 -0400 Subject: [PATCH 13/14] CI: downpin sphinx; revert dpkg installation of `pandoc` --- .github/workflows/docs.yml | 30 +++++++++++++++--------------- requirements-dev.txt | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7edd6e0f..6e296314 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,27 +44,27 @@ jobs: with: docker-binary: ${{ env.DOCKER_BINARY }} - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - - name: Set up Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 + uses: actions/setup-python@v4 with: - activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} - auto-update-conda: true - miniconda-version: "latest" python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge - - name: Install documentation-building requirements with conda + # - name: Set up Python ${{ matrix.python-version }} + # uses: conda-incubator/setup-miniconda@v2 + # with: + # activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }} + # auto-update-conda: true + # miniconda-version: "latest" + # python-version: ${{ matrix.python-version }} + # mamba-version: "*" + # channels: conda-forge + + - name: Install documentation-building requirements with apt/dpkg run: | set -vxeuo pipefail - # wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb - # sudo dpkg -i /tmp/pandoc.deb - conda install -c conda-forge -y pandoc + wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb + sudo dpkg -i /tmp/pandoc.deb + # conda install -c conda-forge -y pandoc which pandoc pandoc --version diff --git a/requirements-dev.txt b/requirements-dev.txt index b14da730..89130c89 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,6 +16,6 @@ matplotlib nbsphinx numpydoc pandoc -sphinx +sphinx==7.1.2 sphinx-copybutton tabulate>=0.9.0 From 82a2c74ecc8e4e73cf464cbcc66275da5013579b Mon Sep 17 00:00:00 2001 From: Max Rakitin Date: Thu, 17 Aug 2023 03:32:04 -0400 Subject: [PATCH 14/14] DOC: update release notes for v0.7.0 with a missing item about `create_classes` API change --- docs/source/release-history.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/release-history.rst b/docs/source/release-history.rst index 3bc9e159..92761f57 100644 --- a/docs/source/release-history.rst +++ b/docs/source/release-history.rst @@ -20,11 +20,13 @@ API is turned into a document for SRW and Shadow apps. The beam stats show up in Bluesky's ``BestEffortCallback``. - Removed old API support and relevant tests. +- ``create_classes`` does not need the ``data`` kwarg as it obtains it via + ``connection``. Documentation ............. - Suppress Shadow3 code's stdout in notebooks/code. -- Converted project's `README.rst` to `README.md` for better rendering on PyPI. +- Converted project's ``README.rst`` to ``README.md`` for better rendering on PyPI. Examples ........