As a developer I would like the import namespaces to be a little leaner so that I need fewer lines of imports
As a scientist I would like imports such as fitting_utils to have more concise names
For the test on CRISP our imports ended up looking like this, for relatively simple scans:
from ibex_bluesky_core.callbacks.file_logger import HumanReadableFileCallback
from ibex_bluesky_core.callbacks.fitting import LiveFit
from ibex_bluesky_core.callbacks.fitting.livefit_logger import LiveFitLogger
from ibex_bluesky_core.callbacks.fitting.fitting_utils import Fit, Linear
from ibex_bluesky_core.callbacks.plotting import LivePlot
from ibex_bluesky_core.devices import get_pv_prefix
from ibex_bluesky_core.devices.block import BlockRw, BlockWriteConfig, block_rw
from ibex_bluesky_core.devices.simpledae import SimpleDae
from ibex_bluesky_core.devices.simpledae.controllers import (
PeriodPerPointController,
RunPerPointController,
)
from ibex_bluesky_core.devices.simpledae.reducers import MonitorNormalizer
from ibex_bluesky_core.devices.simpledae.waiters import GoodFramesWaiter, PeriodGoodFramesWaiter
from ibex_bluesky_core.run_engine import get_run_engine
from ibex_bluesky_core.callbacks.fitting import fitting_utils as fit
This is a bit verbose, mostly due to having to import things from multiple levels in a hierarchy
Acceptance criteria
Go through and add relevant public imports to __init__.pys and __all__ so that they are accessible from "higher level" modules - e.g. all simpledae functionality should probably be accessible from ibex_bluesky_core.devices.simpledae.
We may consider making more of our modules _private, so that it's clear what are the user-facing import paths and what is implementation details of the library
Notes
We do not need to change our internal structure to do this - just expose things via imports and __all__ at the right levels.
Could also look at flattening out some of our classes a bit / replacing with free functions - e.g. could Gaussian().fit() be just gaussian as a free function?
fitting_utils
to have more concise namesFor the test on CRISP our imports ended up looking like this, for relatively simple scans:
This is a bit verbose, mostly due to having to import things from multiple levels in a hierarchy
Acceptance criteria
__init__.py
s and__all__
so that they are accessible from "higher level" modules - e.g. allsimpledae
functionality should probably be accessible fromibex_bluesky_core.devices.simpledae
._private
, so that it's clear what are the user-facing import paths and what is implementation details of the libraryNotes
__all__
at the right levels.