luminarycloud.data¶
Data lake: Object upload/download and Case/Dataset operations.
Entities (Object, Case, Dataset, and their nested types) are returned as
typed wrappers over the underlying protos. Enums (ObjectStatus, FormatKind,
MeshElementAssoc) are scoped under this namespace.
Attributes¶
Classes¶
The unit of stored bytes backing a file. |
|
A Case bundles derived provisions/formats/params (unions) with explicit tags. |
|
A member object of a Case, with an optional role label and key/label remappings. |
|
A member object of a Case: an object id with an optional role label and key/label remappings. |
|
Lifecycle status of a Case (terminal once it leaves |
|
Per-component statistics within a (possibly vector) field. |
|
A set of Cases. Frozen Datasets are immutable and the only kind eligible for training. |
|
Lifecycle status of a Dataset, derived from its member cases. |
|
A derived field provision. Field identity is |
|
A physical-semantics annotation for one derived field, matched by (label, element_assoc). |
|
Summary statistics for a scalar series (a single component, or a field's magnitude). |
|
A named file backed by a blob. |
|
A reference from a VTM to a child Object (verbatim relative path -> object id). |
|
An Object's file format (a oneof over the per-format messages). |
|
The file format of an Object. |
|
A geometry provision: an opaque geometry file (STL/STEP) with declared units. |
|
Content hashes of a blob. Both optional; populated post-upload from the storage backend. |
|
Whether a field is associated with mesh cells or points. |
|
An Object the data lake tracks: a file (or multi-file manifest) plus derived metadata. |
|
An Object's physical contents: its backing |
|
Lifecycle status of a data lake Object. |
|
A unit-bearing parameter value: a JSON |
|
Optional augmentation applied to a parameter at |
|
One column of a Dataset's parameter schema. |
|
A machine-readable advertisement of what an Object provides (a field or a geometry). |
|
STEP geometry. |
|
STL geometry. |
|
A recognized-but-unprocessed format. |
|
VTK MultiBlock: a manifest aggregating independent, reusable child Objects. |
|
VTK PolyData. |
|
VTK UnstructuredGrid. |
Functions¶
|
Append cases to an unfrozen Dataset. Frozen Datasets reject this call. |
|
Create a Case from member objects (each with an optional label + key/label remappings). |
|
Create a Dataset, optionally seeded with cases and tags. |
|
Delete a Case. Underlying Objects are unaffected. |
|
Delete a Dataset. Underlying Cases are unaffected. |
|
Download an Object's bytes (its own blob; for a VTM this is the manifest file). |
|
Freeze a Dataset (permanently immutable; eligible for training). |
|
Fetch a Case by id. |
|
Fetch a Dataset by id. |
|
Fetch an Object by id. |
|
Iterate over Cases visible to the caller, optionally filtered by member-object provisions. |
|
Iterate over all Cases in a Dataset. |
|
Iterate over Datasets, optionally filtered by member-object provisions. |
|
Iterate over Objects visible to the caller. |
Remove cases from an unfrozen Dataset. Frozen Datasets reject this call. |
|
|
Update a Case's mutable metadata (name, tags) and return the updated Case. |
|
Update a Dataset's name, description, and/or tags. Only provided fields change. |
|
Update an Object's mutable metadata and return the updated Object. |
|
Upload a file as an Object and return the completed Object. |
Package Contents¶
- class Blob(proto_type: google.protobuf.message.Message | None = None)¶
The unit of stored bytes backing a file.
- id: str¶
- size: int¶
- uri: str¶
- class Case(proto_type: google.protobuf.message.Message | None = None)¶
A Case bundles derived provisions/formats/params (unions) with explicit tags.
- account_id: str¶
- property created_at: datetime.datetime¶
- created_by: str¶
- failure_reason: str¶
- id: str¶
- name: str¶
- objects: List[CaseObject]¶
- property params: Dict[str, Param]¶
Derived union of member objects’ params after param_mapping (each a
Param).
- status: luminarycloud.data._enums.CaseStatus¶
- property tags: dict¶
Explicit user-provided tags (not derived from objects).
- class CaseObject(proto_type: google.protobuf.message.Message | None = None)¶
A member object of a Case, with an optional role label and key/label remappings.
- property field_mapping: dict¶
Remap of the object’s Field provision labels into the case’s provision union.
- label: str¶
- object_id: str¶
- property param_mapping: dict¶
Remap of the object’s param keys into the case’s param union.
- class CaseObjectSpec¶
A member object of a Case: an object id with an optional role label and key/label remappings.
param_mappingremaps the object’s param keys into the case’s param union andfield_mappingremaps its Field provision labels into the case’s provision union: an absent key passes through under its own name, a value ofNone(or"") drops it, and any other value renames it.- field_mapping: Mapping[str, str | None]¶
- label: str | None = None¶
- object_id: str¶
- param_mapping: Mapping[str, str | None]¶
- class CaseStatus¶
Lifecycle status of a Case (terminal once it leaves
UNSETTLED).- Attributes:
- UNSPECIFIED
A well-formed Case will never have this value.
- UNSETTLED
At least one member object is not yet in a terminal state.
- READY
All members are READY and their provisions were unioned;
provisions/formatsare populated.- INVALID
Unusable and unrepairable: a member object FAILED, or the members’ provisions could not be unioned. See
Case.failure_reason.
- INVALID¶
- READY¶
- UNSETTLED¶
- UNSPECIFIED¶
- class ComponentStats(proto_type: google.protobuf.message.Message | None = None)¶
Per-component statistics within a (possibly vector) field.
- name: str¶
- stats: FieldStats¶
- class Dataset(proto_type: google.protobuf.message.Message | None = None)¶
A set of Cases. Frozen Datasets are immutable and the only kind eligible for training.
- account_id: str¶
- property created_at: datetime.datetime¶
- created_by: str¶
- description: str¶
- failure_reason: str¶
- property frozen_at: datetime.datetime | None¶
- id: str¶
- property is_frozen: bool¶
Whether this Dataset has been frozen (and is therefore permanently immutable).
- name: str¶
- property params_schema: dict¶
parameter_name ->
ParameterDef, the type-intersection across the cases.
- status: luminarycloud.data._enums.DatasetStatus¶
- property tags: dict¶
Explicit user-provided tags (not derived from cases).
- class DatasetStatus¶
Lifecycle status of a Dataset, derived from its member cases.
- Attributes:
- UNSPECIFIED
A well-formed Dataset will never have this value.
- UNSETTLED
No member case is INVALID, but at least one is UNSETTLED.
- READY
Every member case is READY (an empty Dataset is READY). Only READY Datasets can be frozen;
provisions/formatsare populated.- INVALID
At least one member case is INVALID; remove those cases to recover. See
Dataset.failure_reason.
- INVALID¶
- READY¶
- UNSETTLED¶
- UNSPECIFIED¶
- class Field(proto_type: google.protobuf.message.Message | None = None)¶
A derived field provision. Field identity is
(label, element_assoc).- component_stats: List[ComponentStats]¶
- element_assoc: luminarycloud.data._enums.MeshElementAssoc¶
- label: str¶
- magnitude_stats: FieldStats¶
- num_components: int¶
- quantity_type: luminarycloud.enum.QuantityType¶
- units: str¶
- class FieldAnnotation¶
A physical-semantics annotation for one derived field, matched by (label, element_assoc).
- element_assoc: luminarycloud.data._enums.MeshElementAssoc¶
- label: str¶
- quantity_type: luminarycloud.enum.QuantityType¶
- units: str = ''¶
- class FieldStats(proto_type: google.protobuf.message.Message | None = None)¶
Summary statistics for a scalar series (a single component, or a field’s magnitude).
- hist128: List[float]¶
- max: float¶
- mean: float¶
- min: float¶
- stdev: float¶
- class File(proto_type: google.protobuf.message.Message | None = None)¶
A named file backed by a blob.
- name: str¶
- class FileRef(proto_type: google.protobuf.message.Message | None = None)¶
A reference from a VTM to a child Object (verbatim relative path -> object id).
- object_id: str¶
- path: str¶
- class Format(proto_type: google.protobuf.message.Message | None = None)¶
An Object’s file format (a oneof over the per-format messages).
- property kind: luminarycloud.data._enums.FormatKind¶
The
FormatKindof the set format (UNSPECIFIEDif none is set).
- class FormatKind¶
The file format of an Object.
- Attributes:
- UNSPECIFIED
Format not yet determined.
- VTP
VTK PolyData (surface).
- VTU
VTK UnstructuredGrid (volume).
- VTM
VTK MultiBlock manifest referencing child Objects.
- STL
STL geometry.
- STEP
STEP geometry.
- UNKNOWN
A recognized-but-unprocessed format.
- STEP¶
- STL¶
- UNKNOWN¶
- UNSPECIFIED¶
- VTM¶
- VTP¶
- VTU¶
- class Geometry(proto_type: google.protobuf.message.Message | None = None)¶
A geometry provision: an opaque geometry file (STL/STEP) with declared units.
- units: str¶
- class Hash(proto_type: google.protobuf.message.Message | None = None)¶
Content hashes of a blob. Both optional; populated post-upload from the storage backend.
- etag: str¶
- md5: str¶
- class MeshElementAssoc¶
Whether a field is associated with mesh cells or points.
Together with
labelthis forms a field’s identity.- Attributes:
- UNSPECIFIED
Association not known.
- CELL
Cell-associated (one value per mesh cell).
- POINT
Point-associated (one value per mesh point).
- CELL¶
- POINT¶
- UNSPECIFIED¶
- class Object(proto_type: google.protobuf.message.Message | None = None)¶
An Object the data lake tracks: a file (or multi-file manifest) plus derived metadata.
- account_id: str¶
- content: ObjectContent¶
- property created_at: datetime.datetime¶
- created_by: str¶
- description: str¶
- failure_reason: str¶
- id: str¶
- name: str¶
- property params: Dict[str, Param]¶
Immutable user-supplied parameters describing the object (each a
Param).
- property processed_at: datetime.datetime | None¶
- status: luminarycloud.data._enums.ObjectStatus¶
- property tags: dict¶
Mutable free-form metadata.
- property uploaded_at: datetime.datetime | None¶
- class ObjectContent(proto_type: google.protobuf.message.Message | None = None)¶
An Object’s physical contents: its backing
Fileplus (VTM only) child references.
- class ObjectStatus¶
Lifecycle status of a data lake Object.
- Attributes:
- UNSPECIFIED
A well-formed Object will never have this value.
- PENDING_UPLOAD
The Object has been created but its bytes have not finished uploading.
- UPLOADED
Upload is complete; a VTK Object is queued for / undergoing field derivation.
- PROCESSING
Field statistics are being derived from the uploaded bytes.
- READY
Fully processed; usable in Cases and Datasets. Field annotations (quantity_type/units) are optional and declared up-front at object creation.
- FAILED
Processing failed; see
Object.failure_reason.
- FAILED¶
- PENDING_UPLOAD¶
- PROCESSING¶
- READY¶
- UNSPECIFIED¶
- UPLOADED¶
- class Param¶
A unit-bearing parameter value: a JSON
value(scalar/vector) plus optionalunits.Note: numbers round-trip through
google.protobuf.Valueas doubles, so an integral input like1800reads back as1800.0.- units: str | None = None¶
- value: Any¶
- class ParameterAugmentation¶
Optional augmentation applied to a parameter at
freeze_dataset()time.- default_reference: List[float] = []¶
- description: str = ''¶
- class ParameterDef(proto_type: google.protobuf.message.Message | None = None)¶
One column of a Dataset’s parameter schema.
- default_reference: List[float]¶
- description: str¶
- type: str¶
- class Provision(proto_type: google.protobuf.message.Message | None = None)¶
A machine-readable advertisement of what an Object provides (a field or a geometry).
- property which: str | None¶
"field"or"geometry"depending on the kind of provision (Noneif unset).
- class Step(proto_type: google.protobuf.message.Message | None = None)¶
STEP geometry.
- class Stl(proto_type: google.protobuf.message.Message | None = None)¶
STL geometry.
- class Unknown(proto_type: google.protobuf.message.Message | None = None)¶
A recognized-but-unprocessed format.
- class Vtm(proto_type: google.protobuf.message.Message | None = None)¶
VTK MultiBlock: a manifest aggregating independent, reusable child Objects.
- class Vtp(proto_type: google.protobuf.message.Message | None = None)¶
VTK PolyData.
- class Vtu(proto_type: google.protobuf.message.Message | None = None)¶
VTK UnstructuredGrid.
- add_cases_to_dataset(dataset_id: str, case_ids: list[str]) luminarycloud.data._wrappers.Dataset¶
Append cases to an unfrozen Dataset. Frozen Datasets reject this call.
- create_case(*, objects: Sequence[CaseObjectSpec], params: Mapping[str, luminarycloud.data._wrappers.Param] | None = None, tags: Mapping[str, Any] | None = None, name: str = '') luminarycloud.data._wrappers.Case¶
Create a Case from member objects (each with an optional label + key/label remappings).
The Case’s parameter union is derived server-side from the members’ params after applying each member’s param_mapping (identity by default;
None/""drops a key; a non-empty value renames it), then merged with the case-levelparams. Conflicting values for the same key are rejected.tagsare explicit user metadata (not derived from objects).
- create_dataset(*, name: str, description: str = '', case_ids: Sequence[str] | None = None, tags: Mapping[str, Any] | None = None) luminarycloud.data._wrappers.Dataset¶
Create a Dataset, optionally seeded with cases and tags.
More cases can be added later via
add_cases_to_dataset()(until frozen).tagsare explicit user metadata (not derived from the cases).
- delete_case(case_id: str) None¶
Delete a Case. Underlying Objects are unaffected.
- delete_dataset(dataset_id: str) None¶
Delete a Dataset. Underlying Cases are unaffected.
- download_object(object_id: str) Iterator[IO[bytes]]¶
Download an Object’s bytes (its own blob; for a VTM this is the manifest file).
- freeze_dataset(dataset_id: str, *, augmentations: Mapping[str, ParameterAugmentation] | None = None) luminarycloud.data._wrappers.Dataset¶
Freeze a Dataset (permanently immutable; eligible for training).
augmentations optionally adds default_reference/description to parameters already present in the type-intersection across the dataset’s cases.
- get_case(case_id: str) luminarycloud.data._wrappers.Case¶
Fetch a Case by id.
- get_dataset(dataset_id: str) luminarycloud.data._wrappers.Dataset¶
Fetch a Dataset by id.
- get_object(object_id: str) luminarycloud.data._wrappers.Object¶
Fetch an Object by id.
- iterate_cases(page_size: int = 100, *, object_filter: luminarycloud._proto.datalake.datalake_pb2.ObjectFilter | None = None) CaseIterator¶
Iterate over Cases visible to the caller, optionally filtered by member-object provisions.
- iterate_dataset_cases(dataset_id: str, page_size: int = 100) DatasetCasesIterator¶
Iterate over all Cases in a Dataset.
- iterate_datasets(page_size: int = 100, *, object_filter: luminarycloud._proto.datalake.datalake_pb2.ObjectFilter | None = None) DatasetIterator¶
Iterate over Datasets, optionally filtered by member-object provisions.
- iterate_objects(*, object_filter: luminarycloud._proto.datalake.datalake_pb2.ObjectFilter | None = None, page_size: int = 100) ObjectIterator¶
Iterate over Objects visible to the caller.
Pass an ObjectFilter to filter by provision (quantity_type, element_assoc, magnitude ranges), by params, by tags containment, by format, or by status.
- remove_cases_from_dataset(dataset_id: str, case_ids: list[str]) luminarycloud.data._wrappers.Dataset¶
Remove cases from an unfrozen Dataset. Frozen Datasets reject this call.
- update_case(case_id: str, *, name: str | None = None, tags: Mapping[str, Any] | None = None) luminarycloud.data._wrappers.Case¶
Update a Case’s mutable metadata (name, tags) and return the updated Case.
Only provided fields change.
tagsis replaced wholesale (full replacement, not merged): pass a mapping to set the tags, an empty mapping to clear them, orNoneto leave them untouched.
- update_dataset(dataset_id: str, *, name: str | None = None, description: str | None = None, tags: Mapping[str, Any] | None = None) luminarycloud.data._wrappers.Dataset¶
Update a Dataset’s name, description, and/or tags. Only provided fields change.
tagsis replaced wholesale (full replacement, not merged): pass a mapping to set the tags, an empty mapping to clear them, orNoneto leave them untouched. A frozen Dataset rejects this call.
- update_object(object_id: str, *, name: str | None = None, description: str | None = None, tags: Mapping[str, Any] | None = None) luminarycloud.data._wrappers.Object¶
Update an Object’s mutable metadata and return the updated Object.
Only provided fields change.
tagsis replaced wholesale (full replacement, not merged): pass a mapping to set the tags, an empty mapping to clear them, orNoneto leave them untouched. Immutable fields (params, format, content) cannot be changed.
- upload_object(file_path: os.PathLike | str, *, name: str = '', description: str = '', params: Mapping[str, luminarycloud.data._wrappers.Param] | None = None, tags: Mapping[str, Any] | None = None, geometry_units: str = '', provision_annotations: Sequence[FieldAnnotation] | None = None, chunk_size: int = _DEFAULT_CHUNK_SIZE) luminarycloud.data._wrappers.Object¶
Upload a file as an Object and return the completed Object.
The format is inferred from the file extension. For a
.vtmthe referenced files are discovered by parsing the manifest, uploaded as independent child Objects, and the VTM is created referencing them.- Parameters:
- file_pathPathLike | str
Path to the file to upload. The basename becomes the Object’s file name.
- name, descriptionstr, optional
Display name / description.
- paramsMapping[str, Param], optional
Immutable unit-bearing parameters describing the object.
- tagsMapping[str, Any], optional
Mutable free-form metadata.
- geometry_unitsstr, optional
Units for STL/STEP geometry provisions; sends the object straight to READY.
- provision_annotationssequence of FieldAnnotation, optional
Up-front provision annotations, reconciled with derived fields after processing.
- chunk_sizeint, optional
Upload chunk size. Defaults to 4 MiB.
- MetadataFilter¶
- ObjectFilter¶
- ParamFilter¶
- ProvisionFilter¶
- RangeFilter¶