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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- name: Install dependencies
run: uv sync -p 3.12
run: uv sync -p 3.13
- name: format
run: uv run ruff format --check
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12
3.13
82 changes: 68 additions & 14 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
description = "flake for mr-t using uv2nix";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "nixpkgs/nixos-25.11";

desy-flake = {
url = "git+https://gitlab.desy.de/philipp.middendorf/desy-flake";
inputs.nixpkgs.follows = "nixpkgs";
};

pyproject-nix = {
url = "github:pyproject-nix/pyproject.nix";
Expand All @@ -28,6 +33,7 @@
, uv2nix
, pyproject-nix
, pyproject-build-systems
, desy-flake
, ...
}:
let
Expand Down Expand Up @@ -60,10 +66,15 @@
};

# This example is only using x86_64-linux
pkgs = nixpkgs.legacyPackages.x86_64-linux;
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
desy-flake.overlays.default
];
};

# Use Python 3.12 from nixpkgs
python = pkgs.python312;
python = pkgs.python313;

# Construct package set
pythonSet =
Expand Down Expand Up @@ -154,6 +165,8 @@

# Prevent uv from downloading managed Python's
UV_PYTHON_DOWNLOADS = "never";

HDF5_PLUGIN_PATH = "${pkgs.hdf5-external-filter-plugins}/lib/plugins";
};

shellHook = ''
Expand Down
25 changes: 14 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ name = "mr-t"
version = "1.0.0"
description = "connect to Eiger, stream to file and UDP"
readme = "README.md"
requires-python = ">=3.12"
requires-python = ">=3.13"
license = "GPL-3.0-or-later"
dependencies = [
"asyncudp==0.11.0",
"culsans==0.7.1",
"h5py==3.14.0",
"pyzmq==26.2.0",
"structlog==24.4.0",
"typed-argument-parser==1.10.1",
"culsans==0.10.0",
"h5py==3.15.1",
"pyzmq==27.1.0",
"structlog==25.5.0",
"typed-argument-parser==1.11.0",
]
authors = [
{name = "Philipp Middendorf", email = "philipp.middendorf@desy.de"}
]

[project.scripts]
mr_t_server = "mr_t.server:main"
dummy_client = "mr_t.dummy_client:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"

[tool.isort]
profile = "black"
Expand Down Expand Up @@ -87,17 +91,16 @@ reportImplicitStringConcatenation = true
reportMissingSuperCall = false

reportPropertyTypeMismatch = true
reportShadowedImports = true
# Works also, but doesn't play along with Tap
reportUninitializedInstanceVariable = false
# This works, but there's no way to ignore something in mypy, but not in pyright
reportUnnecessaryTypeIgnoreComment = false
# Sensible, but false positive waaaaaay to often
reportUnusedCallResult = false
pythonVersion = "3.12"
pythonVersion = "3.13"

[dependency-groups]
dev = [
"ruff>=0.8.6",
"ruff>=0.14.8",
]

2 changes: 1 addition & 1 deletion src/mr_t/h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ async def receive_h5_messages(
if cache_full():
await asyncio.sleep(0.5)
continue
yield ZmqImage(dataset[frame_number][:].tobytes())
yield ZmqImage(dataset[frame_number][:].tobytes()) # type: ignore
yield ZmqSeriesEnd()
21 changes: 0 additions & 21 deletions src/mr_t/rx.py

This file was deleted.

14 changes: 8 additions & 6 deletions src/mr_t/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Any,
AsyncIterable,
AsyncIterator,
Callable,
Optional,
TypeAlias,
TypeVar,
Expand Down Expand Up @@ -218,11 +217,14 @@ async def main_async() -> None:
sys.exit(2)

current_series: CurrentSeries | None = None
cache_full: Callable[[], bool] = (
lambda: len(current_series.saved_frames) > args.frame_cache_limit
if current_series is not None and args.frame_cache_limit is not None
else False
)

def cache_full() -> bool:
return (
len(current_series.saved_frames) > args.frame_cache_limit
if current_series is not None and args.frame_cache_limit is not None
else False
)

sender = (
receive_zmq_messages(
zmq_target=args.eiger_zmq_host_and_port,
Expand Down
Loading