From e6b95e612573cb5be90393b085ed7bc8d92c7dae Mon Sep 17 00:00:00 2001 From: David Erb Date: Mon, 24 Apr 2023 09:46:17 +0000 Subject: [PATCH] fixes lint, adds dependency on xchembku --- .dae-devops/Makefile | 4 ++-- .dae-devops/docs/conventions.rst | 4 ++-- .dae-devops/docs/developing.rst | 4 ++-- .dae-devops/docs/devops.rst | 4 ++-- .dae-devops/docs/docs_structure.rst | 4 ++-- .dae-devops/docs/installing.rst | 4 ++-- .dae-devops/docs/testing.rst | 4 ++-- .dae-devops/prepare_git_dependencies.sh | 4 ++-- .dae-devops/project.yaml | 1 + .devcontainer/Dockerfile | 4 ++-- .devcontainer/devcontainer.json | 4 ++-- .github/CONTRIBUTING.rst | 4 ++-- .github/actions/install_requirements/action.yml | 4 ++-- .github/dependabot.yml | 4 ++-- .github/pages/index.html | 4 ++-- .github/pages/make_switcher.py | 4 ++-- .github/workflows/code.yml | 4 ++-- .github/workflows/docs.yml | 4 ++-- .github/workflows/docs_clean.yml | 4 ++-- .github/workflows/linkcheck.yml | 4 ++-- .gitlab-ci.yml | 4 ++-- docs/_static/css/custom.css | 4 ++-- docs/conf.py | 4 ++-- pyproject.toml | 9 +++++---- src/echolocator_lib/composers/html.py | 10 ++++------ src/echolocator_lib/guis/aiohttp.py | 4 ++-- 26 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.dae-devops/Makefile b/.dae-devops/Makefile index 8380e24..3ba5530 100644 --- a/.dae-devops/Makefile +++ b/.dae-devops/Makefile @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator # --------------------------------------------------------------------- @@ -69,4 +69,4 @@ publish_docs: cp -r build/html/* $(DOCS_PUBLISH_ROOT) -# dae_devops_fingerprint fa91d06926a32d8ff4980e6c5026842a +# dae_devops_fingerprint e508c365997a16fba9003f0e2c7345fc diff --git a/.dae-devops/docs/conventions.rst b/.dae-devops/docs/conventions.rst index a6f5b09..d4018f2 100644 --- a/.dae-devops/docs/conventions.rst +++ b/.dae-devops/docs/conventions.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Naming conventions @@ -31,4 +31,4 @@ repository lowercase, hyphens -.. # dae_devops_fingerprint 7830c296da87a975c0ebe83db00c21a9 +.. # dae_devops_fingerprint f1b13dc77352fa3d7806ebc008156e6f diff --git a/.dae-devops/docs/developing.rst b/.dae-devops/docs/developing.rst index b7b773e..15e6158 100644 --- a/.dae-devops/docs/developing.rst +++ b/.dae-devops/docs/developing.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Developing @@ -36,4 +36,4 @@ If you plan to modify the docs, you will need to:: -.. # dae_devops_fingerprint c3acd7bd04d4c567174c7ba12f90efb0 +.. # dae_devops_fingerprint 8802592ab610cd9de3e657aeacb9c8c1 diff --git a/.dae-devops/docs/devops.rst b/.dae-devops/docs/devops.rst index 4be28bb..160c2dd 100644 --- a/.dae-devops/docs/devops.rst +++ b/.dae-devops/docs/devops.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Devops @@ -43,4 +43,4 @@ Publishing:: -.. # dae_devops_fingerprint 28cb19a7e59bd4e67a85edec626a491e +.. # dae_devops_fingerprint 67a3e9939abb47f483bfd1180117473f diff --git a/.dae-devops/docs/docs_structure.rst b/.dae-devops/docs/docs_structure.rst index 318a3ea..5f77889 100644 --- a/.dae-devops/docs/docs_structure.rst +++ b/.dae-devops/docs/docs_structure.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator About the documentation @@ -21,4 +21,4 @@ improve most documentation - often immensely. `More information on this topic. `_ -.. # dae_devops_fingerprint 8ded9698d9d71eda17e2c49cd737a2e2 +.. # dae_devops_fingerprint 58611b915d52f7b59bbed09020e30356 diff --git a/.dae-devops/docs/installing.rst b/.dae-devops/docs/installing.rst index 0d8690d..345a91e 100644 --- a/.dae-devops/docs/installing.rst +++ b/.dae-devops/docs/installing.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Installing @@ -40,4 +40,4 @@ You can check the version that has been installed by typing:: $ echolocator --version $ echolocator --version-json -.. # dae_devops_fingerprint 3b5d52d009337767488822fafe22e1e7 +.. # dae_devops_fingerprint c6472f1053e4ee44f3e70cc67c9fbddd diff --git a/.dae-devops/docs/testing.rst b/.dae-devops/docs/testing.rst index 5b299cc..27f2162 100644 --- a/.dae-devops/docs/testing.rst +++ b/.dae-devops/docs/testing.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Testing @@ -35,4 +35,4 @@ This allows peeking in there to see what's been written by the test. -.. # dae_devops_fingerprint a5fefb92ded789eda5a2e4423a4e58e6 +.. # dae_devops_fingerprint 7daed3c9e65a523a0fbf7d347dfa6ebe diff --git a/.dae-devops/prepare_git_dependencies.sh b/.dae-devops/prepare_git_dependencies.sh index 0837678..7ad11b1 100644 --- a/.dae-devops/prepare_git_dependencies.sh +++ b/.dae-devops/prepare_git_dependencies.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator me=${BASH_SOURCE} @@ -13,4 +13,4 @@ function __install { } -# dae_devops_fingerprint 6a2693fd8a702bdea55e95346b54e455 \ No newline at end of file +# dae_devops_fingerprint 5a8604ffa3b9c1409a994d31bcb9e1d4 \ No newline at end of file diff --git a/.dae-devops/project.yaml b/.dae-devops/project.yaml index 2a770a0..9fab19d 100644 --- a/.dae-devops/project.yaml +++ b/.dae-devops/project.yaml @@ -14,6 +14,7 @@ primary: dependencies: - type: pypi list: + - xchembku - dls_servbase - dls_mainiac - dls_utilpack diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 60abb7b..7a9fd52 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator # This file is for use as a devcontainer and a runtime container @@ -40,4 +40,4 @@ ENV PATH=/venv/bin:$PATH ENTRYPOINT ["echolocator"] CMD ["--version"] -# dae_devops_fingerprint b2386a8edacc7cf00dbcde0bcfe434a4 +# dae_devops_fingerprint 9302e007f97570a60d29bb25449a92bb diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4ffc841..f6d11c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ // ********** Please don't edit this file! -// ********** It has been generated automatically by dae_devops version 0.5.1. +// ********** It has been generated automatically by dae_devops version 0.5.2. // ********** For repository_name echolocator // For format details, see https://containers.dev/implementors/json_reference/ @@ -57,4 +57,4 @@ "postCreateCommand": "pip install -e .[dev]" } -// dae_devops_fingerprint 2507140a2722f4fa02e13592d5038e0e +// dae_devops_fingerprint 529b4c792a9fdad91835e1a4b32e0138 diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index 491ed51..febd96d 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -1,5 +1,5 @@ .. # ********** Please don't edit this file! -.. # ********** It has been generated automatically by dae_devops version 0.5.1. +.. # ********** It has been generated automatically by dae_devops version 0.5.2. .. # ********** For repository_name echolocator Contributing to the project @@ -38,4 +38,4 @@ should follow. .. _Developer Guide: https://diamondlightsource.github.io/echolocator/main/developer/how-to/contribute.html -.. # dae_devops_fingerprint aed6364e5eff2f9face6b54b84a417f7 +.. # dae_devops_fingerprint d17faed109d26c120150d4cad9b012bd diff --git a/.github/actions/install_requirements/action.yml b/.github/actions/install_requirements/action.yml index e4fa60f..f23e871 100644 --- a/.github/actions/install_requirements/action.yml +++ b/.github/actions/install_requirements/action.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator name: Install requirements @@ -61,4 +61,4 @@ runs: shell: bash -# dae_devops_fingerprint 6290682d4770755c7566572965cef561 +# dae_devops_fingerprint 1fae1b6e8b391bfca7aad4310624e6c4 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 25b96f5..4874928 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator # To get started with Dependabot version updates, you'll need to specify which @@ -19,4 +19,4 @@ updates: schedule: interval: "weekly" -# dae_devops_fingerprint 27e905899401fd7a982d82c6788a2760 +# dae_devops_fingerprint 6309098eb3479d1a200e487b05664e86 diff --git a/.github/pages/index.html b/.github/pages/index.html index 4c02dfb..ecdc702 100644 --- a/.github/pages/index.html +++ b/.github/pages/index.html @@ -1,5 +1,5 @@ - + @@ -14,4 +14,4 @@ - + diff --git a/.github/pages/make_switcher.py b/.github/pages/make_switcher.py index b38e1c2..f257ac4 100644 --- a/.github/pages/make_switcher.py +++ b/.github/pages/make_switcher.py @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator import json @@ -102,4 +102,4 @@ def main(args=None): if __name__ == "__main__": main() -# dae_devops_fingerprint 5eddb1e43a2e9f5696fb135b3351e1e0 +# dae_devops_fingerprint e707603d7cbd385a51462ce91214bed6 diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index b7d84fa..fc4a2b3 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator name: Code CI @@ -212,4 +212,4 @@ jobs: with: password: ${{ secrets.PYPI_TOKEN }} -# dae_devops_fingerprint 3cd3d1b7aa3767bc7752d04d0cff1b98 +# dae_devops_fingerprint febe27315441a7232f0895dff16de450 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6a6a8cb..60cc044 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator name: Docs CI @@ -56,4 +56,4 @@ jobs: publish_dir: .github/pages keep_files: true -# dae_devops_fingerprint 516501c026fa1f7af1e7a6d88d046406 +# dae_devops_fingerprint 248b6927066389c57cb985f999015228 diff --git a/.github/workflows/docs_clean.yml b/.github/workflows/docs_clean.yml index 16e157c..fa36fec 100644 --- a/.github/workflows/docs_clean.yml +++ b/.github/workflows/docs_clean.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator name: Docs Cleanup CI @@ -46,4 +46,4 @@ jobs: git commit -am "Removing redundant docs version $DOCS_VERSION" git push -# dae_devops_fingerprint 923700bb09fb043a8cdcb2b78e384f09 +# dae_devops_fingerprint 13b4db6f5b6317157d8d36b632434d2d diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 4c86010..23bb776 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator name: Link Check @@ -27,4 +27,4 @@ jobs: - name: Check links run: tox -e docs build -- -b linkcheck -# dae_devops_fingerprint d1ce8eee255cbe72206419b8b28d43df +# dae_devops_fingerprint 75b08200910c30409c75d4d16a6e4d9a diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ccbdc2..0592439 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator variables: @@ -87,4 +87,4 @@ package_pip: # # The validate_docs artifacts are in the build/html folder. # - make -f .dae-devops/Makefile publish_docs -# dae_devops_fingerprint 32c6a111d128370b1daac92e1f2aecbe +# dae_devops_fingerprint 14d3e80d54ae3da9497b0ce79d6fa611 diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css index c82089b..17f89d5 100644 --- a/docs/_static/css/custom.css +++ b/docs/_static/css/custom.css @@ -1,5 +1,5 @@ /* ********** Please don't edit this file! */ -/* ********** It has been generated automatically by dae_devops version 0.5.1. */ +/* ********** It has been generated automatically by dae_devops version 0.5.2. */ /* ********** For repository_name echolocator */ /* The theme normally has this, but I think it's ok to use the full width of the window in all @media sizes. @@ -15,4 +15,4 @@ max-width: 100%; } -/* dae_devops_fingerprint 35feb33b9a913af2c9c4c41aaeba16f5 */ +/* dae_devops_fingerprint cfed7308662c39c7cab945fa6b416c7e */ diff --git a/docs/conf.py b/docs/conf.py index 8103745..e80e8fb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator from pathlib import Path @@ -197,4 +197,4 @@ def setup(app): app.connect("source-read", ultimateReplace) -# dae_devops_fingerprint 20b12f1e3c3fe99e0b1b302ef56d79fc +# dae_devops_fingerprint 522695c29baed7676543987e99fc61dd diff --git a/pyproject.toml b/pyproject.toml index 0ef48ec..83340bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ # ********** Please don't edit this file! -# ********** It has been generated automatically by dae_devops version 0.5.1. +# ********** It has been generated automatically by dae_devops version 0.5.2. # ********** For repository_name echolocator [build-system] @@ -16,7 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] description = "XChem GUI for manually targeting drop points for the Echo dispenser." -dependencies = ["dls_servbase", "dls_mainiac", "dls_utilpack"] +dependencies = ["xchembku", "dls_servbase", "dls_mainiac", "dls_utilpack", "beautifulsoup4"] dynamic = ["version"] license.file = "LICENSE" readme = "README.rst" @@ -34,6 +34,7 @@ dev = [ "pydocstyle[toml]", "tox-direct", "types-mock", + "types-PyYAML", ] docs = [ "pydata-sphinx-theme>=0.12", @@ -84,7 +85,7 @@ exclude = [".tox", "venv"] [tool.pytest.ini_options] # Run pytest with all our checkers, and don't spam us with massive tracebacks on error -addopts = " --tb=native -vv --doctest-modules --doctest-glob=\"*.rst\"\n " +addopts = " --tb=native -vv --doctest-modules --doctest-glob=\"*.rst\"\n --cov=echolocator_lib --cov-report term --cov-report xml:cov.xml\n " # https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings filterwarnings = "error" # Doctest python code in docs, python code in src docstrings, test functions in tests @@ -102,4 +103,4 @@ source = ["src", "**/site-packages/"] [tool.tox] legacy_tox_ini = "[tox]\nskipsdist=True\n\n[testenv:{pre-commit,mypy,pytest,docs}]\n# Don't create a virtualenv for the command, requires tox-direct plugin\ndirect = True\npassenv = *\nallowlist_externals = \n pytest \n pre-commit\n mypy\n sphinx-build\n sphinx-autobuild\ncommands =\n pytest: pytest {posargs}\n mypy: mypy src tests {posargs}\n pre-commit: pre-commit run --all-files {posargs}\n docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html\n" -# dae_devops_fingerprint 69fbb150408506fd907682cb5b2f8e24 +# dae_devops_fingerprint 8d6ec2f437b47d4156e639a67957fdc1 diff --git a/src/echolocator_lib/composers/html.py b/src/echolocator_lib/composers/html.py index 0bf5c99..e93c9f6 100644 --- a/src/echolocator_lib/composers/html.py +++ b/src/echolocator_lib/composers/html.py @@ -1,20 +1,18 @@ import html import logging -import re from pathlib import Path -from typing import Optional, Sequence, Union +from typing import List, Optional, Sequence, Union import numpy as np # Base class for generic things. from dls_utilpack.thing import Thing + +# Models which we can compose. from xchembku_api.models.crystal_well_needing_droplocation_model import ( CrystalWellNeedingDroplocationModel, ) -# Database record field names coming from database fields. -from echolocator_api.databases.constants import ImageFieldnames - # Class to do the work using prettytable. from echolocator_lib.composers.prettyhelper import PrettyHelper @@ -41,7 +39,7 @@ def __init__(self, specification=None): self.__indent = 0 # ---------------------------------------------------------------------------------------- - def compose_image_list(self, models: [CrystalWellNeedingDroplocationModel]): + def compose_image_list(self, models: List[CrystalWellNeedingDroplocationModel]): """ Compose the image list as an html table. """ diff --git a/src/echolocator_lib/guis/aiohttp.py b/src/echolocator_lib/guis/aiohttp.py index 8e80249..3a07226 100644 --- a/src/echolocator_lib/guis/aiohttp.py +++ b/src/echolocator_lib/guis/aiohttp.py @@ -179,6 +179,8 @@ async def direct_shutdown(self): async def dispatch(self, request_dict, opaque): """""" + command = require("request json", request_dict, Keywords.COMMAND) + # Having no xchembku client reference means we must be shutting down. if self.__xchembku is None: raise RuntimeError( @@ -186,8 +188,6 @@ async def dispatch(self, request_dict, opaque): % (command) ) - command = require("request json", request_dict, Keywords.COMMAND) - if command == Commands.LOAD_TABS: return await self._load_tabs(opaque, request_dict)