Skip to content

Commit

Permalink
fixes lint, adds dependency on xchembku
Browse files Browse the repository at this point in the history
  • Loading branch information
David Erb committed Apr 24, 2023
1 parent b7d31b0 commit e6b95e6
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .dae-devops/Makefile
Original file line number Diff line number Diff line change
@@ -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

# ---------------------------------------------------------------------
Expand Down Expand Up @@ -69,4 +69,4 @@ publish_docs:
cp -r build/html/* $(DOCS_PUBLISH_ROOT)


# dae_devops_fingerprint fa91d06926a32d8ff4980e6c5026842a
# dae_devops_fingerprint e508c365997a16fba9003f0e2c7345fc
4 changes: 2 additions & 2 deletions .dae-devops/docs/conventions.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,4 +31,4 @@ repository
lowercase, hyphens


.. # dae_devops_fingerprint 7830c296da87a975c0ebe83db00c21a9
.. # dae_devops_fingerprint f1b13dc77352fa3d7806ebc008156e6f
4 changes: 2 additions & 2 deletions .dae-devops/docs/developing.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -36,4 +36,4 @@ If you plan to modify the docs, you will need to::


.. # dae_devops_fingerprint c3acd7bd04d4c567174c7ba12f90efb0
.. # dae_devops_fingerprint 8802592ab610cd9de3e657aeacb9c8c1
4 changes: 2 additions & 2 deletions .dae-devops/docs/devops.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,4 +43,4 @@ Publishing::


.. # dae_devops_fingerprint 28cb19a7e59bd4e67a85edec626a491e
.. # dae_devops_fingerprint 67a3e9939abb47f483bfd1180117473f
4 changes: 2 additions & 2 deletions .dae-devops/docs/docs_structure.rst
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,4 +21,4 @@ improve most documentation - often immensely.

`More information on this topic. <https://documentation.divio.com>`_

.. # dae_devops_fingerprint 8ded9698d9d71eda17e2c49cd737a2e2
.. # dae_devops_fingerprint 58611b915d52f7b59bbed09020e30356
4 changes: 2 additions & 2 deletions .dae-devops/docs/installing.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions .dae-devops/docs/testing.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions .dae-devops/prepare_git_dependencies.sh
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -13,4 +13,4 @@ function __install {
}


# dae_devops_fingerprint 6a2693fd8a702bdea55e95346b54e455
# dae_devops_fingerprint 5a8604ffa3b9c1409a994d31bcb9e1d4
1 change: 1 addition & 0 deletions .dae-devops/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ primary:
dependencies:
- type: pypi
list:
- xchembku
- dls_servbase
- dls_mainiac
- dls_utilpack
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -40,4 +40,4 @@ ENV PATH=/venv/bin:$PATH
ENTRYPOINT ["echolocator"]
CMD ["--version"]

# dae_devops_fingerprint b2386a8edacc7cf00dbcde0bcfe434a4
# dae_devops_fingerprint 9302e007f97570a60d29bb25449a92bb
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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/
Expand Down Expand Up @@ -57,4 +57,4 @@
"postCreateCommand": "pip install -e .[dev]"
}

// dae_devops_fingerprint 2507140a2722f4fa02e13592d5038e0e
// dae_devops_fingerprint 529b4c792a9fdad91835e1a4b32e0138
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/actions/install_requirements/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -61,4 +61,4 @@ runs:
shell: bash


# dae_devops_fingerprint 6290682d4770755c7566572965cef561
# dae_devops_fingerprint 1fae1b6e8b391bfca7aad4310624e6c4
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,4 +19,4 @@ updates:
schedule:
interval: "weekly"

# dae_devops_fingerprint 27e905899401fd7a982d82c6788a2760
# dae_devops_fingerprint 6309098eb3479d1a200e487b05664e86
4 changes: 2 additions & 2 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -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 -->

<!DOCTYPE html>
Expand All @@ -14,4 +14,4 @@

</html>

<!-- dae_devops_fingerprint 3314813c65a9a431d1ca8363599c626a -->
<!-- dae_devops_fingerprint ce6fecf5a9e91b53ee1d2d669fe82989 -->
4 changes: 2 additions & 2 deletions .github/pages/make_switcher.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -102,4 +102,4 @@ def main(args=None):
if __name__ == "__main__":
main()

# dae_devops_fingerprint 5eddb1e43a2e9f5696fb135b3351e1e0
# dae_devops_fingerprint e707603d7cbd385a51462ce91214bed6
4 changes: 2 additions & 2 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -212,4 +212,4 @@ jobs:
with:
password: ${{ secrets.PYPI_TOKEN }}

# dae_devops_fingerprint 3cd3d1b7aa3767bc7752d04d0cff1b98
# dae_devops_fingerprint febe27315441a7232f0895dff16de450
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
publish_dir: .github/pages
keep_files: true

# dae_devops_fingerprint 516501c026fa1f7af1e7a6d88d046406
# dae_devops_fingerprint 248b6927066389c57cb985f999015228
4 changes: 2 additions & 2 deletions .github/workflows/docs_clean.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:
git commit -am "Removing redundant docs version $DOCS_VERSION"
git push
# dae_devops_fingerprint 923700bb09fb043a8cdcb2b78e384f09
# dae_devops_fingerprint 13b4db6f5b6317157d8d36b632434d2d
4 changes: 2 additions & 2 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Check links
run: tox -e docs build -- -b linkcheck

# dae_devops_fingerprint d1ce8eee255cbe72206419b8b28d43df
# dae_devops_fingerprint 75b08200910c30409c75d4d16a6e4d9a
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -15,4 +15,4 @@
max-width: 100%;
}

/* dae_devops_fingerprint 35feb33b9a913af2c9c4c41aaeba16f5 */
/* dae_devops_fingerprint cfed7308662c39c7cab945fa6b416c7e */
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -197,4 +197,4 @@ def setup(app):
app.connect("source-read", ultimateReplace)


# dae_devops_fingerprint 20b12f1e3c3fe99e0b1b302ef56d79fc
# dae_devops_fingerprint 522695c29baed7676543987e99fc61dd
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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"
Expand All @@ -34,6 +34,7 @@ dev = [
"pydocstyle[toml]",
"tox-direct",
"types-mock",
"types-PyYAML",
]
docs = [
"pydata-sphinx-theme>=0.12",
Expand Down Expand Up @@ -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
Expand All @@ -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
10 changes: 4 additions & 6 deletions src/echolocator_lib/composers/html.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/echolocator_lib/guis/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ 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(
"refusing to execute command %s because server is shutting down"
% (command)
)

command = require("request json", request_dict, Keywords.COMMAND)

if command == Commands.LOAD_TABS:
return await self._load_tabs(opaque, request_dict)

Expand Down

0 comments on commit e6b95e6

Please sign in to comment.