spacr.screen_data¶
The published TSG101 screen, as separately downloadable pieces.
The screen is four plates of about 8 GB of crops each plus a half-gigabyte database each – 33 GB in total. The regression, measurement and cell functions read only the databases; the crops are needed only to display images. A single archive would require a 33 GB download to try one function.
So each plate’s database and each plate’s crop folder is its own archive, and
ScreenAsset says how big each one is BEFORE it is fetched. The picker
in the Regression screen lists them with their sizes and downloads only what is
selected.
The merged/ folders are deliberately absent. They are about 300 GB per plate
– 1.2 TB for the screen – which is past what a public dataset host will take
without arrangement, and nothing in Regression reads them.
Classes¶
One separately downloadable piece of the screen. |
Functions¶
|
The pieces matching |
|
Format a byte count with decimal units, e.g. |
|
The archive names actually present in |
|
Return how many bytes a selection will cost. |
Module Contents¶
- class spacr.screen_data.ScreenAsset[source]¶
One separately downloadable piece of the screen.
- Parameters:
archive – the
.tarinSCREEN_REPO.plate – which plate it belongs to.
kind –
"measurements"or"crops".bytes – the archive’s size in bytes, shown by the picker before the archive is downloaded.
unpacks_to – the path inside the plate folder the archive fills, used to tell an already-downloaded piece from one that is missing.
- is_present(folder) bool[source]¶
Whether this piece is already unpacked under
folder.Checks the files the archive writes, not the folder it writes into: every piece shares one plate directory, so the directory’s existence does not show which pieces are in it.
- Parameters:
folder – plate directory under which this asset would unpack.
- Returns:
whether the database file exists, or the crop directory contains at least one PNG, according to this asset’s
kind.
- spacr.screen_data.assets_for(kind: str | None = None, plate: int | None = None) List[ScreenAsset][source]¶
The pieces matching
kindandplate.- Parameters:
kind –
"measurements","crops", orNonefor both.plate – a plate number, or
Nonefor all of them.
- Returns:
assets matching both supplied filters, in picker order.
- spacr.screen_data.human_size(count: int) str[source]¶
Format a byte count with decimal units, e.g.
1234567as1.2 MB.Decimal units (1 KB = 1000 B) match what download managers and disk vendors report.
- Parameters:
count – byte count to format.
- Returns:
decimal-unit size from bytes through terabytes, with one decimal above the byte unit.
- spacr.screen_data.published_archives(repo: str = SCREEN_REPO, *, timeout: float = 8.0)[source]¶
The archive names actually present in
repo, orNone.Nonemeans the lookup failed – offline, or the hub did not answer – and is distinct from an empty set, which means the repository has no archives. A caller that treated a failed lookup as an empty set would disable every row of the picker without explanation.- Parameters:
repo – Hugging Face dataset repository to inspect.
timeout – give up rather than hold a dialog open on a slow network.
- Returns:
names of published
.tararchives, orNonewhen the repository could not be inspected.
- spacr.screen_data.total_size(assets) int[source]¶
Return how many bytes a selection will cost.
- Parameters:
assets – iterable of
ScreenAssetobjects.- Returns:
sum of the assets’ published archive sizes in bytes.