Skip to content

Commit

Permalink
Linting and updated pyproject dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko committed Nov 22, 2024
1 parent 41c52af commit 91663af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies:
- pytest-mongodb
- StrEnum
- ophyd-registry >= 1.3.3
- guarneri >= 0.2.0
- xraydb >=4.5.0
- pytest-timeout # Get rid of this if tests are not hanging
- git+https://github.com/pcdshub/pcdsdevices
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ keywords = ["synchrotron", "xray", "bluesky"]
dependencies = ["aioca", "aiokafka", "bluesky", "ophyd", "ophyd-async>=0.8.0a5", "databroker", "apsbss", "xraydb",
"mergedeep", "xrayutilities", "bluesky-queueserver-api", "tomlkit",
"apstools", "databroker", "ophyd-registry", "caproto", "pcdsdevices",
"strenum", "bluesky-adaptive", "tiled[client]"]
"strenum", "bluesky-adaptive", "tiled[client]", "guarneri"]

[project.optional-dependencies]

Expand Down
23 changes: 8 additions & 15 deletions src/haven/instrument.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
"""Loader for creating instances of the devices from a config file."""

import asyncio
import inspect
import logging
import os
import time
from pathlib import Path
from typing import Mapping, Sequence
from typing import Mapping

import tomlkit
from guarneri import Instrument
from ophyd import Device as ThreadedDevice
from ophyd.sim import make_fake_device
from ophyd_async.core import DEFAULT_TIMEOUT, NotConnected
from ophydregistry import Registry

from .devices.aerotech import AerotechStage
from .devices.aps import ApsMachine
Expand All @@ -36,7 +27,6 @@
from .devices.table import Table
from .devices.xia_pfcu import PFCUFilterBank
from .devices.xspress import make_xspress_device
from .exceptions import InvalidConfiguration

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -71,17 +61,20 @@ def load(
self.devices.clear()
# Check if config files are available
if "HAVEN_CONFIG_FILES" in os.environ:
config_files = os.environ.get('HAVEN_CONFIG_FILES', "").split(":")
config_files = os.environ.get("HAVEN_CONFIG_FILES", "").split(":")
else:
config_files = []
# Load devices ("motors" is done later)
for cfg_file in config_files:
super().load(cfg_file, return_exceptions=True,
ignored_classes=["motors"])
super().load(cfg_file, return_exceptions=True, ignored_classes=["motors"])
# VME-style Motors happen later so duplicate motors can be
# removed
for cfg_file in config_files:
super().load(cfg_file, device_classes={"motors": load_motors}, ignored_classes=self.device_classes.keys())
super().load(
cfg_file,
device_classes={"motors": load_motors},
ignored_classes=self.device_classes.keys(),
)
# Return the final list
if return_devices:
return self.devices
Expand Down

0 comments on commit 91663af

Please sign in to comment.