Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# sphinx-quickstart on Wed Nov 9 16:42:53 2016.
import os
import sys

sys.path.insert(0, os.path.abspath("../lewis"))


Expand All @@ -22,11 +23,11 @@
]
templates_path = ["_templates"]
# General information about the project.
project = u"lewis"
language = 'en'
project = "lewis"
language = "en"
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- Options for HTML output ---------------------------------------------
suppress_warnings =["docutils"]
suppress_warnings = ["docutils"]
html_theme = "sphinx_rtd_theme"
html_logo = "resources/logo/lewis-logo.png"
html_context = {
Expand Down
4 changes: 2 additions & 2 deletions lewis/adapters/epics.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,14 @@ def write(self, pv, value) -> bool:
return True
except LimitViolationException as e:
self.log.warning(
"Rejected writing value %s to PV %s due to limit " "violation. %s",
"Rejected writing value %s to PV %s due to limit violation. %s",
value,
pv,
e,
)
except AccessViolationException:
self.log.warning(
"Rejected writing value %s to PV %s due to access " "violation, PV is read-only.",
"Rejected writing value %s to PV %s due to access violation, PV is read-only.",
value,
pv,
)
Expand Down
2 changes: 1 addition & 1 deletion lewis/adapters/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def _bind_device(self) -> None:
pattern = bound_cmd.matcher.pattern
if pattern in patterns:
raise RuntimeError(
"The regular expression {} is " "associated with multiple commands.".format(
"The regular expression {} is associated with multiple commands.".format(
pattern
)
)
Expand Down
3 changes: 1 addition & 2 deletions lewis/core/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class NoLock:

def __enter__(self) -> None:
raise RuntimeError(
"The attempted action requires a proper threading.Lock-object, "
"but none was available."
"The attempted action requires a proper threading.Lock-object, but none was available."
)

def __exit__(
Expand Down
3 changes: 1 addition & 2 deletions lewis/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ def create_device(self, setup=None):

if setup_name not in self.setups:
raise LewisException(
"Failed to find setup '{}' for device '{}'. "
"Available setups are:\n {}".format(
"Failed to find setup '{}' for device '{}'. Available setups are:\n {}".format(
setup, self.name, "\n ".join(self.setups.keys())
)
)
Expand Down
2 changes: 1 addition & 1 deletion lewis/core/statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(self, cfg, context=None) -> None:
# Specifying an initial state is not optional
if "initial" not in cfg:
raise StateMachineException(
"StateMachine configuration must include " "'initial' to specify starting state."
"StateMachine configuration must include 'initial' to specify starting state."
)
self._initial = cfg["initial"]
self._set_handlers(self._initial)
Expand Down
2 changes: 1 addition & 1 deletion lewis/scripts/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def call_method(remote, object_name, method, arguments):
positional_args.add_argument(
"arguments",
nargs="*",
help="Arguments to method call. For setting a property, " "supply the property value. ",
help="Arguments to method call. For setting a property, supply the property value. ",
)

optional_args = parser.add_argument_group("Optional arguments")
Expand Down
3 changes: 1 addition & 2 deletions lewis/scripts/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@
"-I",
"--ignore-versions",
action="store_true",
help="Ignore version mismatches between device and framework. A warning will still "
"be logged.",
help="Ignore version mismatches between device and framework. A warning will still be logged.",
)
other_args.add_argument(
"-v", "--version", action="store_true", help="Prints the version and exits."
Expand Down
33 changes: 33 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Set the maximum line length to 100.
line-length = 100
indent-width = 4
2 changes: 1 addition & 1 deletion tests/test_StateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_first_cycle_transitions_to_initial(self):
self.assertEqual(
sm.state,
"foobar",
"StateMachine failed to transition into " "initial state on first cycle",
"StateMachine failed to transition into initial state on first cycle",
)

def test_can_transition_with_lambda(self):
Expand Down