Data adapters¶
The tiled-photonic
meta-package bundles all Tiled data adapters
developed for the PHOTONIC project into a distributable conda package.
Included adapters¶
| Package | Module | Class | Purpose |
|---|---|---|---|
tiled-fabio |
tiled_fabio |
FabioAdapter |
2D detector images (EDF, CBF) via fabio |
tiled-xdi |
tiled_xdi |
XDIAdapter |
XAS Data Interchange (XDI) spectra as arrays |
tiled-fio |
tiled_fio |
FioAdapter |
DESY FIO scan files (%C/%P/%D sections) |
tiled-spec |
tiled_spec |
SpecAdapter |
SPEC scan files (Certified Scientific Software) |
tiled-photonic-csv |
tiled_photonic_csv |
PhotonicTextAdapter |
Generic text/csv dispatcher; routes .xy/.dat/.npt/.tsv/.csv by extension |
tiled-photonic-csv |
tiled_photonic_csv |
XYFileAdapter / DatFileAdapter |
.xy/.dat two-column data |
tiled-photonic-csv |
tiled_photonic_csv |
NPTAdapter |
pyFAI .npt control points |
tiled-photonic-csv |
tiled_photonic_csv |
TSVAdapter |
Tab-separated tables |
tiled-blissdata |
tiled_blissdata |
DataStoreAdapter |
Redis-backed Blissdata scans (ESRF) |
Class names
The public class name exposed by each upstream adapter repo does not always
match its package name (for example, tiled-blissdata exposes
DataStoreAdapter). The XY/NPT/TSV adapters live in tiled-photonic-csv and are
re-exported from tiled_photonic.adapters.
Install from conda¶
conda config --add channels https://s3-common.desy.de/fs-ec-pixi-channel-data
conda activate my_env
conda install tiled-photonic
Requirements¶
tiled-photonic does not bundle or install tiled itself. The conda package
declares tiled as a run_constraints entry (>=0.2.9,<0.3) rather than a hard
runtime dependency, keeping the adapter package thin and letting it be installed
alongside whatever tiled version a deployment already manages.
You must install tiled yourself in any environment where you actually want to use
the adapters:
If dir(tiled_photonic.adapters) shows only dunders and no adapter classes, check
that tiled is installed and importable first.
Quick start¶
config/config.yml serves from ./new_sample_data with writable storage in
./written_data. Anonymous access is disabled, so a single-user API key is
required: set TILED_SINGLE_USER_API_KEY and pass it as --api-key when talking to
the server.
Registering data¶
Or register per format:
pixi run register-fio
pixi run register-spec
pixi run register-edf
pixi run register-xdi
pixi run register-text
pixi run register-png
pixi run register-jpeg
Each task reads $TILED_SINGLE_USER_API_KEY and $READABLE_STORAGE from the
environment.
Environments¶
| Environment | Description |
|---|---|
default |
Editable install of the adapters plus tiled[server]; used for local development and the start / register-* tasks |
dev |
default plus dev tools (pytest, ruff, ipython, rattler-build, rattler-index) and the build, index, auth, publish tasks |
conda-s3 |
Installs tiled-photonic from the S3 fs-ec-pixi-channel-data channel; mirrors the deployment environment |
Building the conda package¶
The build assembles all adapters into a single noarch conda package via
rattler-build, writing the artifact to output/, and re-indexes the local
channel. If you build with rattler-build directly, run pixi run -e dev index
afterwards — a stale repodata.json is the most common cause of hash mismatch
errors.
Testing¶
The testing/ workspace installs the freshly built package from the local output/
channel and runs the test suite against a real Tiled server:
pixi run -e dev build # build and index the package
cd testing && pixi run generate_sample_data
pixi run start # serves testing/config.yml on :8000
pixi run register # registers ./sample_data
pixi run test # pytest tests/
Repository¶
Source, issues and CI configuration: https://gitlab.desy.de/photonic/wp2/adapters/tiled-photonic
License¶
BSD 3-Clause.