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
127 changes: 63 additions & 64 deletions pixi.lock

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bluesky-tiled-plugins = ">=2.0.9,<3"
hextools = { path = ".", editable = true }
nslsii = { git = "https://github.com/NSLS2/nslsii", rev = "main" }
bluesky = { git = "https://github.com/bluesky/bluesky", rev = "main" }
ophyd-async = { git = "https://github.com/jwlodek/ophyd-async", rev = "add-codec-and-process-plugin-allow-for-filtering" }
ophyd-async = { git = "https://github.com/bluesky/ophyd-async", rev = "main" }

[feature.profile.dependencies]
redis-json-dict = ">=0.2.2,<0.3"
Expand Down Expand Up @@ -115,6 +115,7 @@ auto-exporter = "python -m hextools.exporters.auto_exporter"

[feature.exporter.dependencies]
h5py = ">=3.16.0,<4"

[feature.docs.dependencies]
sphinx = "*"
sphinx-autobuild = "*"
Expand Down Expand Up @@ -156,5 +157,12 @@ solve-group = "profile"

[feature.py313.tasks]
tests = "pytest --cov=src/hextools --cov-report=term"
# Run the tests, then serve the html coverage report whether or not they passed.
# VS Code's terminal opens file:// links in the editor, but http:// in the browser.
coverage = """
pytest --cov=src/hextools --cov-report=term --cov-report=html; \
echo "Coverage report: http://localhost:8765/index.html (Ctrl-C to stop)" \
&& python -m http.server 8765 --bind 127.0.0.1 --directory $PIXI_PROJECT_ROOT/htmlcov
"""
lint = "pre-commit run --all-files"
type-check = "ty check src tests"
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ dependencies = [
"algotom",
"ipython",
"numpy",
"bluesky",
"nslsii",
"ophyd-async[ca, pva]",
"bluesky @ git+https://github.com/bluesky/bluesky@main",
"nslsii @ git+https://github.com/NSLS2/nslsii@main",
"ophyd-async[ca, pva] @ git+https://github.com/bluesky/ophyd-async@main",
"rich>=15.0.0",
"scikit-image>=0.26.0",
"scipy>=1.17.1",
Expand Down Expand Up @@ -111,7 +111,7 @@ allow-direct-references = true
artifacts = ["src/hextools/_version.py"]

[tool.hatch.build.targets.wheel]
sources = ["src"]
projects = ["src/hextools"]

[tool.hatch.build.hooks.vcs]
version-file = "src/hextools/_version.py"
Expand Down
6 changes: 6 additions & 0 deletions src/hextools/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ def validate_tomo_dark_flat(run: RunLike, version: str | None = "1") -> None:
# sample_name: str optional
# last_dark_flat_uid: str optional, see the tomography dark/flat convention
# last_dark_flat_scan_id: int optional, see the tomography dark/flat convention
# grid_index: int optional, from the step scans: 0-based point index
# num_grid_points: int optional, from the step scans: points in the scan
# grid_positions: dict[str, float] optional, from the step scans: step motor name to
# setpoint; empty when the scan has no step axes
# previous_grid_point_uid: str optional, from the step scans: start uid of the
# previous point's successful run; absent on first
# Streams:
# primary: collected while flying
# <det> (num_points, height, width) image stack, external
Expand Down
9 changes: 6 additions & 3 deletions src/hextools/tomography/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,14 +725,15 @@ def tomo_alignment_scan(
fe_shutter = ensure_available(Shutter, fe_shutter=fe_shutter)
photon_shutter = ensure_available(Shutter, photon_shutter=photon_shutter)
rot_motor = ensure_available(RotationMotor, rot_motor=rot_motor)
# Restored in the cleanup, so the stage returns at full speed before slowing.
initial_position = yield from bps.rd(rot_motor.user_readback)
initial_velocity = yield from bps.rd(rot_motor.velocity)

@bpp.reset_positions_decorator(
[
det.driver.num_images,
det.driver.acquire_period,
det.driver.acquire_time,
rot_motor,
rot_motor.velocity,
]
)
def _body():
Expand Down Expand Up @@ -769,5 +770,7 @@ def _cleanup():
yield from ensure_shutter_closed(photon_shutter)
if isinstance(det, KinetixDetector):
yield from enable_preview_mode(det)
yield from bps.mv(rot_motor, initial_position)
yield from bps.mv(rot_motor.velocity, initial_velocity)
Comment thread
jwlodek marked this conversation as resolved.

return bpp.finalize_wrapper(_body(), _cleanup())
return (yield from bpp.finalize_wrapper(_body(), _cleanup()))
Loading
Loading