Skip to content

Commit

Permalink
Fixed ruff arguments in CI, and cleaned up formatting to please ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko committed Dec 22, 2023
1 parent 7c031d3 commit 6d1763a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py37 .
# default set of ruff rules with GitHub Annotations
ruff --format=github --target-version=py37 --exit-zero .
ruff --output-format=github --target-version=py37 --exit-zero .
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ophyd-registry"
version = "0.7"
version = "0.8"
authors = [
{ name="Mark Wolfman", email="[email protected]" },
]
Expand Down
4 changes: 2 additions & 2 deletions src/ophydregistry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .registry import Registry
from .exceptions import ComponentNotFound, MultipleComponentsFound
from .registry import Registry # noqa: F401
from .exceptions import ComponentNotFound, MultipleComponentsFound # noqa: F401
5 changes: 3 additions & 2 deletions src/ophydregistry/registry.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import Optional, Mapping, Set, List
from typing import Optional, Mapping, List
import logging
from itertools import chain
from collections import OrderedDict

from ophyd import ophydobj

try:
import typhos
except ImportError:
Expand Down Expand Up @@ -56,7 +57,7 @@ def register_typhos_signal(signal):
# .dotted_name does not include the root device's name
names = (
signal.name,
'.'.join((signal.root.name, signal.dotted_name)),
".".join((signal.root.name, signal.dotted_name)),
)
# Warn the user if they are adding twice
signal_registry = typhos.plugins.core.signal_registry
Expand Down
7 changes: 4 additions & 3 deletions src/ophydregistry/tests/test_instrument_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_auto_register():
"""
registry = Registry()
cptA = sim.SynGauss(
sim.SynGauss(
"I0",
sim.motor,
"motor",
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_clear():
def test_component_properties():
"""Check that we can get lists of component and devices."""
registry = Registry()
cpt = sim.SynGauss(
sim.SynGauss(
"I0",
sim.motor,
"motor",
Expand All @@ -338,6 +338,7 @@ def test_component_properties():
"I0_val",
}


def test_root_devices():
registry = Registry()
registry.register(sim.motor1)
Expand All @@ -353,5 +354,5 @@ def test_getitem():
registry = Registry()
registry.register(sim.motor1)
# Check that the dictionary access works
result = registry['motor1']
result = registry["motor1"]
assert result is sim.motor1

0 comments on commit 6d1763a

Please sign in to comment.