parse_hf_bucket_reference(bucket)
Normalizes Hugging Face bucket references to owner/name format.
- bucket: Bucket ID, prefixed path, or public bucket URL.
Returns: normalized bucket ID string.
RF
Inject
docs
API reference
Focus on practical entry points you will call in scripts and notebooks.
Normalizes Hugging Face bucket references to owner/name format.
Returns: normalized bucket ID string.
Fetches high-level bucket metadata such as size, visibility, and total file count.
Returns: Hugging Face bucket info object.
Lists top-level .zarr products available in a bucket without walking every file recursively.
Returns: list of bucket-relative Zarr paths.
Mirrors a single file or a recursive prefix from a bucket to the local filesystem.
Returns: list of local file paths downloaded for the request.
Downloads the required Zarr files from a bucket to a local mirror and opens the result with Zarr.
.zarr.zarr.json files for fast hierarchy inspection.Returns: opened zarr.Group backed by the local mirror.
Walks a Zarr hierarchy recursively and prints each subgroup and array with shape/type metadata.
zarr.Group to inspect. Must be an in-memory Zarr group object.Returns: None (side-effect is console output).
Reads one data array from a burst folder, with explicit burst and array key selection.
burst_0.burst_0). The function fails if this key is missing.echo, rfi, or echo_w_rfi.Returns: zarr.Array.
Extracts a NumPy slice from a Zarr array for a quick visual or numeric inspection.
slice(0, 10) for higher dimensionsReturns: np.ndarray containing the selected window.
Collects per-burst statistics (shape, dtype, chunking, and estimated memory footprint).
burst_* children.Returns: Dict[str, Dict[str, Any]] keyed by burst name.
Reads metadata attributes from a target object in the hierarchy, optionally navigating to a child path first.
zarr.Group (or array-like) from which navigation starts.burst_0/echo). If omitted, reads only the starting item.Returns: a plain dict of attributes; empty dictionary if none exist.
Traverses root, burst, and burst-array nodes and extracts all available attributes in a single pass.
Returns: nested dictionary keyed by element path (for example root, burst_0, burst_0/echo).
Creates a 3-panel figure: magnitude, phase, and real-part views for a complex-valued array.
np.ndarray or coercible array-like input.(width, height) in inches passed to Matplotlib.Returns: None (renders and displays the plot).
Draws one magnitude plot with normalization, optional dB conversion, color-range control, and optional file export.
20*log10() and changes colorbar label.dpi=300.Returns: None (renders, and optionally saves the figure).
End-to-end training entry point that builds default data module/callbacks and runs fit + test.
pl.LightningModule. If omitted, the trainer creates a default MyModel.pl.LightningDataModule. If omitted, a default one is created with ./data.pl.Trainer.cpu or gpu).ModelCheckpoint files are stored.Returns: the trained model instance.
Loads a trained checkpoint and runs prediction with a provided datamodule.
.ckpt checkpoint.Returns: predictions returned by trainer.predict().
Builds standard Lightning callbacks for checkpointing, early stopping, and learning-rate logging.
ModelCheckpoint.Returns: callback list used by train_model().
from rfinject import (
DEFAULT_HF_BUCKET_ID,
access_attributes,
get_burst_info,
list_hf_bucket_zarrs,
open_hf_bucket_zarr,
)
products = list_hf_bucket_zarrs(DEFAULT_HF_BUCKET_ID, limit=1)
zarr_data = open_hf_bucket_zarr(DEFAULT_HF_BUCKET_ID, products[0], metadata_only=True)
burst_info = get_burst_info(zarr_data)
metadata = access_attributes(zarr_data, "burst_0/echo")
print(products[0], len(burst_info), list(metadata.keys())[:5])