Publish RDDAC teaser
Browse files- .gitattributes +1 -0
- README.md +188 -0
- data/h5/sample.zip +3 -0
- data/metadata.json +610 -0
- data/process_parameters.csv +0 -0
- notebooks/01_getting_started.ipynb +0 -0
- notebooks/02_views.ipynb +470 -0
- notebooks/03_pytorch.ipynb +569 -0
- notebooks/04_visualization.ipynb +0 -0
- notebooks/05_loose_h5.ipynb +371 -0
- notebooks/06_streaming.ipynb +0 -0
- notebooks/README.md +42 -0
- rddac_documentation.pdf +3 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
rddac_documentation.pdf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pretty_name: "RDDAC — Real Deep Drawing and Cutting Dataset (Teaser)"
|
| 6 |
+
size_categories:
|
| 7 |
+
- n<1K
|
| 8 |
+
tags:
|
| 9 |
+
- croissant
|
| 10 |
+
- experimental-data
|
| 11 |
+
- measurement
|
| 12 |
+
- sim-to-real
|
| 13 |
+
- sim2real
|
| 14 |
+
- scientific-machine-learning
|
| 15 |
+
- sciml
|
| 16 |
+
- sheet-metal-forming
|
| 17 |
+
- metal-forming
|
| 18 |
+
- deep-drawing
|
| 19 |
+
- stamping
|
| 20 |
+
- cutting
|
| 21 |
+
- manufacturing
|
| 22 |
+
- materials-science
|
| 23 |
+
- process-monitoring
|
| 24 |
+
- laser-scan
|
| 25 |
+
- point-cloud
|
| 26 |
+
- time-series
|
| 27 |
+
- sensor-data
|
| 28 |
+
- digital-twin
|
| 29 |
+
- regression
|
| 30 |
+
- benchmark
|
| 31 |
+
- engineering
|
| 32 |
+
- automotive
|
| 33 |
+
- hdf5
|
| 34 |
+
task_categories:
|
| 35 |
+
- tabular-regression
|
| 36 |
+
- time-series-forecasting
|
| 37 |
+
- other
|
| 38 |
+
---
|
| 39 |
+
# RDDAC — Real Deep Drawing and Cutting Dataset
|
| 40 |
+
|
| 41 |
+
[](https://opensource.org/licenses/MIT) [](https://creativecommons.org/licenses/by/4.0/) [](https://www.python.org/downloads/) [](https://rddac.readthedocs.io) [](https://darus.uni-stuttgart.de/dataset.xhtml?persistentId=doi:10.18419/DARUS-5589) [](https://doi.org/10.18419/DARUS-5589)
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
|
| 45 |
+
*Measured point clouds of one experiment after deep drawing (OP10, left) and cutting (OP20, right), colored by the deviation from the matching DDACS simulation.*
|
| 46 |
+
|
| 47 |
+
**A large-scale experimental dataset of 9,000 physical deep-drawing and cutting experiments — the real-world counterpart to the [DDACS](https://ddacs.readthedocs.io) FEM simulations.** Each experiment forms a modified quadratic cup from DP600 dual-phase steel (deep drawing in OP10, cutting in OP20) and records press force signals, sheet-thickness and oil-film traverses, and high-resolution 3D laser scans of the part after each operation. Use it to quantify the simulation-to-reality gap, train models on real process data, or validate DDACS-trained surrogates against physical measurements.
|
| 48 |
+
|
| 49 |
+
| | |
|
| 50 |
+
|---|---|
|
| 51 |
+
| **Experiments** | 9,000 |
|
| 52 |
+
| **Total size** | ~87 GB (HDF5, lossless) |
|
| 53 |
+
| **Process steps per experiment** | 2 (OP10 deep drawing, OP20 cutting) |
|
| 54 |
+
| **Parameter space** | 2 geometries x 3 blankholder forces x 3 oil types (18 categories) |
|
| 55 |
+
| **Repetitions** | up to 500 per category |
|
| 56 |
+
| **Train / val / test** | 7,200 / 900 / 900 (predefined, seed 42) |
|
| 57 |
+
| **Matching simulations** | DDACS `rddac.zip` (~9 GB), fetched by `rddac download` |
|
| 58 |
+
|
| 59 |
+
**[Documentation](https://rddac.readthedocs.io)** · **[Dataset DOI](https://doi.org/10.18419/DARUS-5589)** · **[Paper](https://doi.org/10.1007/s12666-026-03870-5)**
|
| 60 |
+
|
| 61 |
+
## About this sample
|
| 62 |
+
|
| 63 |
+
This is a **~174 MB teaser** of RDDAC — 18 experiments (one per category) plus the
|
| 64 |
+
Croissant 1.1 manifest, the complete process-parameter table, and the six tutorial
|
| 65 |
+
notebooks — so you can explore the schema and run every tutorial in seconds before
|
| 66 |
+
committing to the full download.
|
| 67 |
+
|
| 68 |
+
```
|
| 69 |
+
data/
|
| 70 |
+
metadata.json Croissant 1.1 manifest (the dataset schema)
|
| 71 |
+
process_parameters.csv parameters + splits for all 9,000 experiments
|
| 72 |
+
h5/sample.zip 18 experiments, one per category (all modalities)
|
| 73 |
+
rddac_documentation.pdf dataset documentation
|
| 74 |
+
notebooks/ six end-to-end tutorials (see notebooks/README.md)
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
**Croissant manifest.** `data/metadata.json` is the
|
| 78 |
+
[Croissant 1.1](https://mlcommons.org/croissant/) manifest — the machine-readable
|
| 79 |
+
schema (every HDF5 field and CSV column) that `rddac.load()` and any
|
| 80 |
+
Croissant-aware tool consume. It is the same manifest published with the full
|
| 81 |
+
dataset on DaRUS ([doi:10.18419/DARUS-5589](https://doi.org/10.18419/DARUS-5589)).
|
| 82 |
+
|
| 83 |
+
## Installation
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
pip install rddac # add the PyTorch adapter with: pip install 'rddac[torch]'
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Basic usage
|
| 90 |
+
|
| 91 |
+
`rddac.open_h5` opens a single experiment in memory and returns an `h5py.File`;
|
| 92 |
+
the visualization helpers plot the raw modalities directly.
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
import rddac
|
| 96 |
+
|
| 97 |
+
# Open one bundled experiment. Four raw modalities per file.
|
| 98 |
+
with rddac.open_h5(0, data_dir="data") as f:
|
| 99 |
+
force = f["force/data"][:] # (n, 8): time, load cells, temp, position, total force
|
| 100 |
+
z = f["pointcloud/op10/z"][:] # (6400000,) flat laser-scan buffer
|
| 101 |
+
lumi = f["pointcloud/op10/luminescence"][:]
|
| 102 |
+
|
| 103 |
+
# The OP10 scan as a 3D point cloud.
|
| 104 |
+
points = rddac.scan_to_pointcloud(z, lumi, stride=4)
|
| 105 |
+
rddac.plot_point_cloud(points, point_size=0.4)
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
## PyTorch integration
|
| 109 |
+
|
| 110 |
+
`RDDACDataset` is a `torch.utils.data.IterableDataset` over a Croissant view. It
|
| 111 |
+
auto-shards across DataLoader workers and DDP ranks, and silently skips
|
| 112 |
+
experiments whose zip is missing — so partial downloads (like this teaser) stream
|
| 113 |
+
cleanly.
|
| 114 |
+
|
| 115 |
+
```python
|
| 116 |
+
from rddac.pytorch import RDDACDataset
|
| 117 |
+
from torch.utils.data import DataLoader
|
| 118 |
+
|
| 119 |
+
ds = RDDACDataset(view="force-curve", data_dir="data")
|
| 120 |
+
for batch in DataLoader(ds, batch_size=1, num_workers=0):
|
| 121 |
+
force = batch["force_data"]
|
| 122 |
+
break
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
## Tutorials
|
| 126 |
+
|
| 127 |
+
Six end-to-end notebooks ship in `notebooks/` and are published on
|
| 128 |
+
[Read the Docs](https://rddac.readthedocs.io/en/latest/tutorials/):
|
| 129 |
+
|
| 130 |
+
1. **Getting started** — install, inspect one experiment, 3D point cloud plot.
|
| 131 |
+
2. **Build your own view** — `rddac.add_view`, manifest inspection, custom RecordSets.
|
| 132 |
+
3. **PyTorch training** — `RDDACDataset`, filters, train/val/test splits.
|
| 133 |
+
4. **Visualization** — scans, point clouds, force curves, traverses.
|
| 134 |
+
5. **Loose HDF5 recipe** — pandas + `h5py` after `--extract --remove-zip`.
|
| 135 |
+
6. **Streaming & numpy export** — `iter_view`, `export_to_numpy`.
|
| 136 |
+
|
| 137 |
+
## Relationship to DDACS
|
| 138 |
+
|
| 139 |
+
RDDAC is the experimental counterpart to the [DDACS](https://ddacs.readthedocs.io)
|
| 140 |
+
simulation dataset: same cup geometry, same DP600 steel, same two-stage OP10/OP20
|
| 141 |
+
process. The matching FEM simulations are published in the DDACS dataset as
|
| 142 |
+
`rddac.zip` (~9 GB); `rddac download` fetches them alongside the measurements. The
|
| 143 |
+
`rddac` package API mirrors `ddacs` one to one, so analysis code moves between
|
| 144 |
+
simulation and experiment by swapping the import.
|
| 145 |
+
|
| 146 |
+
## ⬇️ Get the full dataset
|
| 147 |
+
|
| 148 |
+
**This sample contains 18 of 9,000 experiments.** The complete RDDAC dataset —
|
| 149 |
+
**9,000 experiments, ~87 GB of lossless HDF5**, with the predefined
|
| 150 |
+
7,200 / 900 / 900 train/val/test split — is hosted on DaRUS with a citable DOI:
|
| 151 |
+
|
| 152 |
+
### ➡️ https://doi.org/10.18419/DARUS-5589
|
| 153 |
+
|
| 154 |
+
Everything you ran here scales to the full release unchanged — just point the same
|
| 155 |
+
code at the full download, or let the package fetch it:
|
| 156 |
+
|
| 157 |
+
```bash
|
| 158 |
+
pip install rddac
|
| 159 |
+
rddac download # full release (rddac download --small for this sample)
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
## Citation
|
| 163 |
+
|
| 164 |
+
If you use this dataset or code in your research, please cite both the dataset and the paper:
|
| 165 |
+
|
| 166 |
+
```bibtex
|
| 167 |
+
@dataset{baum2026rddac,
|
| 168 |
+
title={Real Deep Drawing and Cutting Dataset},
|
| 169 |
+
author={Baum, Sebastian and Heinzelmann, Pascal},
|
| 170 |
+
year={2026},
|
| 171 |
+
publisher={DaRUS},
|
| 172 |
+
doi={10.18419/DARUS-5589}
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
@article{baum2026deviation,
|
| 176 |
+
title={Statistical Analysis of Simulation to Reality Deviation in Deep Drawing with a Benchmark Dataset},
|
| 177 |
+
author={Baum, Sebastian and Heinzelmann, Pascal and Clau{\ss}, P. and others},
|
| 178 |
+
journal={Transactions of the Indian Institute of Metals},
|
| 179 |
+
volume={79},
|
| 180 |
+
pages={176},
|
| 181 |
+
year={2026},
|
| 182 |
+
doi={10.1007/s12666-026-03870-5}
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
## License
|
| 187 |
+
|
| 188 |
+
Data: **CC BY 4.0**. Package code: MIT.
|
data/h5/sample.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c3871b08b60ddb4830b74badb367aa1d530ec9b8ae6c1fa870a3333c6b89e17e
|
| 3 |
+
size 173778285
|
data/metadata.json
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"@context": {
|
| 3 |
+
"@language": "en",
|
| 4 |
+
"@vocab": "https://schema.org/",
|
| 5 |
+
"citeAs": "cr:citeAs",
|
| 6 |
+
"column": "cr:column",
|
| 7 |
+
"conformsTo": "dct:conformsTo",
|
| 8 |
+
"containedIn": "cr:containedIn",
|
| 9 |
+
"cr": "http://mlcommons.org/croissant/",
|
| 10 |
+
"rai": "http://mlcommons.org/croissant/RAI/",
|
| 11 |
+
"data": {
|
| 12 |
+
"@id": "cr:data",
|
| 13 |
+
"@type": "@json"
|
| 14 |
+
},
|
| 15 |
+
"dataType": {
|
| 16 |
+
"@id": "cr:dataType",
|
| 17 |
+
"@type": "@vocab"
|
| 18 |
+
},
|
| 19 |
+
"dct": "http://purl.org/dc/terms/",
|
| 20 |
+
"equivalentProperty": "cr:equivalentProperty",
|
| 21 |
+
"examples": {
|
| 22 |
+
"@id": "cr:examples",
|
| 23 |
+
"@type": "@json"
|
| 24 |
+
},
|
| 25 |
+
"extract": "cr:extract",
|
| 26 |
+
"field": "cr:field",
|
| 27 |
+
"fileProperty": "cr:fileProperty",
|
| 28 |
+
"fileObject": "cr:fileObject",
|
| 29 |
+
"fileSet": "cr:fileSet",
|
| 30 |
+
"format": "cr:format",
|
| 31 |
+
"includes": "cr:includes",
|
| 32 |
+
"isLiveDataset": "cr:isLiveDataset",
|
| 33 |
+
"jsonPath": "cr:jsonPath",
|
| 34 |
+
"key": "cr:key",
|
| 35 |
+
"md5": "cr:md5",
|
| 36 |
+
"parentField": "cr:parentField",
|
| 37 |
+
"path": "cr:path",
|
| 38 |
+
"recordSet": "cr:recordSet",
|
| 39 |
+
"references": "cr:references",
|
| 40 |
+
"regex": "cr:regex",
|
| 41 |
+
"repeated": "cr:repeated",
|
| 42 |
+
"replace": "cr:replace",
|
| 43 |
+
"samplingRate": "cr:samplingRate",
|
| 44 |
+
"sc": "https://schema.org/",
|
| 45 |
+
"separator": "cr:separator",
|
| 46 |
+
"source": "cr:source",
|
| 47 |
+
"subField": "cr:subField",
|
| 48 |
+
"transform": "cr:transform",
|
| 49 |
+
"wd": "https://www.wikidata.org/wiki/"
|
| 50 |
+
},
|
| 51 |
+
"@type": "sc:Dataset",
|
| 52 |
+
"name": "Real Deep Drawing and Cutting (RDDAC) Dataset",
|
| 53 |
+
"description": "The Real Deep Drawing and Cutting (RDDAC) Dataset is the experimental counterpart to the DDACS simulation dataset. It contains physical measurements from a deep drawing and cutting process for DP600 sheet metal, captured on modified quadratic cups, and is intended for studying the deviation between finite element simulation and physical reality.\n\nThe dataset comprises approximately 9000 experiments spanning two base geometries (concave, convex) crossed with three blankholder forces (100, 300, 500 kN) and three lubrication patterns (coarse, medium, fine), giving 18 categories with up to 500 repetitions each. Each experiment is stored as a HDF5 file and captures, where available: press force and process signals (load cells and temperature); a sheet thickness traverse; an oil film traverse; and 3D laser scans (height and luminescence) of the part after deep drawing (OP10) and after cutting (OP20).\n\nEach HDF5 file carries named scalar root attributes matching the columns of process_parameters.csv (process_parameters.tab on the DaRUS UI), the central index that maps every experiment to its parameters, data availability flags, and a recommended ML train, validation, and test split. A sample.zip (one experiment per category, 18 files in total) is provided for fast preview without downloading the full dataset. A Croissant 1.1 manifest (metadata.json) describes every field for direct use with mlcroissant. The accompanying Python package includes an optional preprocessing step that reconstructs cleaned 3D point clouds and aligns them to the matching DDACS simulations.",
|
| 54 |
+
"url": "https://doi.org/10.18419/DARUS-5589",
|
| 55 |
+
"version": "1.0",
|
| 56 |
+
"license": "http://creativecommons.org/licenses/by/4.0",
|
| 57 |
+
"citeAs": "Baum, S., Heinzelmann, P., Clauß, P. et al. Statistical Analysis of Simulation-to-Reality Deviation in Deep Drawing with a Benchmark Dataset. Trans Indian Inst Met 79, 176 (2026). https://doi.org/10.1007/s12666-026-03870-5",
|
| 58 |
+
"datePublished": "2026-06-01",
|
| 59 |
+
"creator": [
|
| 60 |
+
{
|
| 61 |
+
"@type": "Person",
|
| 62 |
+
"name": "Baum, Sebastian",
|
| 63 |
+
"affiliation": "University of Stuttgart",
|
| 64 |
+
"identifier": ""
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"@type": "Person",
|
| 68 |
+
"name": "Heinzelmann, Pascal",
|
| 69 |
+
"affiliation": "University of Stuttgart",
|
| 70 |
+
"identifier": ""
|
| 71 |
+
}
|
| 72 |
+
],
|
| 73 |
+
"keywords": [
|
| 74 |
+
"Deep Drawing",
|
| 75 |
+
"Sheet Metal Forming",
|
| 76 |
+
"Machine Learning",
|
| 77 |
+
"Point Cloud",
|
| 78 |
+
"Experimental Measurement",
|
| 79 |
+
"DP600",
|
| 80 |
+
"Springback",
|
| 81 |
+
"Sim-to-Real"
|
| 82 |
+
],
|
| 83 |
+
"measurementTechnique": "Physical deep drawing and cutting experiments with force, lubricant, sheet-thickness, and 3D laser-scan measurements.",
|
| 84 |
+
"conformsTo": "http://mlcommons.org/croissant/1.1",
|
| 85 |
+
"isLiveDataset": false,
|
| 86 |
+
"distribution": [
|
| 87 |
+
{
|
| 88 |
+
"@type": "cr:FileObject",
|
| 89 |
+
"@id": "process_parameters_csv",
|
| 90 |
+
"name": "process_parameters.csv",
|
| 91 |
+
"description": "Per-experiment parameter table; join to HDF5 files via `index`.",
|
| 92 |
+
"encodingFormat": "text/csv",
|
| 93 |
+
"contentUrl": "https://darus.uni-stuttgart.de/api/access/datafile/598301?format=original",
|
| 94 |
+
"md5": "b78905067334bcd6860360b5869a85ac"
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"@type": "cr:FileObject",
|
| 98 |
+
"@id": "concave_zip",
|
| 99 |
+
"name": "concave.zip",
|
| 100 |
+
"encodingFormat": "application/zip",
|
| 101 |
+
"contentUrl": "https://darus.uni-stuttgart.de/api/access/datafile/594673",
|
| 102 |
+
"md5": "853540085b144d6e7ece154a9e204a19"
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"@type": "cr:FileObject",
|
| 106 |
+
"@id": "convex_zip",
|
| 107 |
+
"name": "convex.zip",
|
| 108 |
+
"encodingFormat": "application/zip",
|
| 109 |
+
"contentUrl": "https://darus.uni-stuttgart.de/api/access/datafile/594674",
|
| 110 |
+
"md5": "30cb9044460449f5f93b4ce5eb60f552"
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"@type": "cr:FileObject",
|
| 114 |
+
"@id": "sample_zip",
|
| 115 |
+
"name": "sample.zip",
|
| 116 |
+
"encodingFormat": "application/zip",
|
| 117 |
+
"contentUrl": "https://darus.uni-stuttgart.de/api/access/datafile/594669",
|
| 118 |
+
"md5": "4b61770b34f0517641df613e00a15e56",
|
| 119 |
+
"description": "One experiment per category (18 files) for quick tryout/testing. These ids are excluded from concave.zip/convex.zip, so the three zips partition the dataset with no overlap."
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"@type": "cr:FileSet",
|
| 123 |
+
"@id": "h5-files",
|
| 124 |
+
"name": "h5-files",
|
| 125 |
+
"description": "Every per-experiment HDF5 file across the geometry zips and the sample zip (a non-overlapping partition of all experiments).",
|
| 126 |
+
"containedIn": [
|
| 127 |
+
{
|
| 128 |
+
"@id": "concave_zip"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"@id": "convex_zip"
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
"@id": "sample_zip"
|
| 135 |
+
}
|
| 136 |
+
],
|
| 137 |
+
"encodingFormat": "application/x-hdf5",
|
| 138 |
+
"includes": [
|
| 139 |
+
"**/*.h5"
|
| 140 |
+
]
|
| 141 |
+
}
|
| 142 |
+
],
|
| 143 |
+
"recordSet": [
|
| 144 |
+
{
|
| 145 |
+
"@type": "cr:RecordSet",
|
| 146 |
+
"@id": "process-parameters",
|
| 147 |
+
"name": "process_parameters",
|
| 148 |
+
"description": "Per-experiment parameter row from process_parameters.csv. Use `index` to look up the matching HDF5 file.",
|
| 149 |
+
"key": {
|
| 150 |
+
"@id": "process-parameters/index"
|
| 151 |
+
},
|
| 152 |
+
"field": [
|
| 153 |
+
{
|
| 154 |
+
"@type": "cr:Field",
|
| 155 |
+
"@id": "process-parameters/index",
|
| 156 |
+
"name": "index",
|
| 157 |
+
"dataType": "sc:Integer",
|
| 158 |
+
"source": {
|
| 159 |
+
"fileObject": {
|
| 160 |
+
"@id": "process_parameters_csv"
|
| 161 |
+
},
|
| 162 |
+
"extract": {
|
| 163 |
+
"column": "index"
|
| 164 |
+
}
|
| 165 |
+
},
|
| 166 |
+
"description": "Unique experiment identifier; matches the HDF5 filename (e.g. index=42 -> 0042.h5)."
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"@type": "cr:Field",
|
| 170 |
+
"@id": "process-parameters/experiment_id",
|
| 171 |
+
"name": "experiment_id",
|
| 172 |
+
"dataType": "sc:Integer",
|
| 173 |
+
"source": {
|
| 174 |
+
"fileObject": {
|
| 175 |
+
"@id": "process_parameters_csv"
|
| 176 |
+
},
|
| 177 |
+
"extract": {
|
| 178 |
+
"column": "experiment_id"
|
| 179 |
+
}
|
| 180 |
+
},
|
| 181 |
+
"description": "Repetition index (1..500) within one geometry×blankholder_force×oil_type category."
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"@type": "cr:Field",
|
| 185 |
+
"@id": "process-parameters/category",
|
| 186 |
+
"name": "category",
|
| 187 |
+
"dataType": "sc:Integer",
|
| 188 |
+
"source": {
|
| 189 |
+
"fileObject": {
|
| 190 |
+
"@id": "process_parameters_csv"
|
| 191 |
+
},
|
| 192 |
+
"extract": {
|
| 193 |
+
"column": "category"
|
| 194 |
+
}
|
| 195 |
+
},
|
| 196 |
+
"description": "Categorical index 0..17 encoding the geometry×blankholder_force×oil_type combination."
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"@type": "cr:Field",
|
| 200 |
+
"@id": "process-parameters/geometry",
|
| 201 |
+
"name": "geometry",
|
| 202 |
+
"dataType": "sc:Text",
|
| 203 |
+
"source": {
|
| 204 |
+
"fileObject": {
|
| 205 |
+
"@id": "process_parameters_csv"
|
| 206 |
+
},
|
| 207 |
+
"extract": {
|
| 208 |
+
"column": "geometry"
|
| 209 |
+
}
|
| 210 |
+
},
|
| 211 |
+
"description": "Base part geometry. One of 'concave', 'convex'."
|
| 212 |
+
},
|
| 213 |
+
{
|
| 214 |
+
"@type": "cr:Field",
|
| 215 |
+
"@id": "process-parameters/blankholder_force",
|
| 216 |
+
"name": "blankholder_force",
|
| 217 |
+
"dataType": "sc:Integer",
|
| 218 |
+
"source": {
|
| 219 |
+
"fileObject": {
|
| 220 |
+
"@id": "process_parameters_csv"
|
| 221 |
+
},
|
| 222 |
+
"extract": {
|
| 223 |
+
"column": "blankholder_force"
|
| 224 |
+
}
|
| 225 |
+
},
|
| 226 |
+
"description": "Blank holder force applied during deep drawing, in kN. One of 100, 300, 500."
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"@type": "cr:Field",
|
| 230 |
+
"@id": "process-parameters/mean_punch_temp",
|
| 231 |
+
"name": "mean_punch_temp",
|
| 232 |
+
"dataType": "sc:Float",
|
| 233 |
+
"source": {
|
| 234 |
+
"fileObject": {
|
| 235 |
+
"@id": "process_parameters_csv"
|
| 236 |
+
},
|
| 237 |
+
"extract": {
|
| 238 |
+
"column": "mean_punch_temp"
|
| 239 |
+
}
|
| 240 |
+
},
|
| 241 |
+
"description": "Mean punch temperature recorded during the experiment, in degC."
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"@type": "cr:Field",
|
| 245 |
+
"@id": "process-parameters/oil_type",
|
| 246 |
+
"name": "oil_type",
|
| 247 |
+
"dataType": "sc:Text",
|
| 248 |
+
"source": {
|
| 249 |
+
"fileObject": {
|
| 250 |
+
"@id": "process_parameters_csv"
|
| 251 |
+
},
|
| 252 |
+
"extract": {
|
| 253 |
+
"column": "oil_type"
|
| 254 |
+
}
|
| 255 |
+
},
|
| 256 |
+
"description": "Lubrication pattern applied to the blank. One of 'coarse', 'medium', 'fine'."
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"@type": "cr:Field",
|
| 260 |
+
"@id": "process-parameters/has_pointcloud",
|
| 261 |
+
"name": "has_pointcloud",
|
| 262 |
+
"dataType": "sc:Boolean",
|
| 263 |
+
"source": {
|
| 264 |
+
"fileObject": {
|
| 265 |
+
"@id": "process_parameters_csv"
|
| 266 |
+
},
|
| 267 |
+
"extract": {
|
| 268 |
+
"column": "has_pointcloud"
|
| 269 |
+
}
|
| 270 |
+
},
|
| 271 |
+
"description": "True if OP10/OP20 3D point-cloud scans are available for this experiment."
|
| 272 |
+
},
|
| 273 |
+
{
|
| 274 |
+
"@type": "cr:Field",
|
| 275 |
+
"@id": "process-parameters/has_oil",
|
| 276 |
+
"name": "has_oil",
|
| 277 |
+
"dataType": "sc:Boolean",
|
| 278 |
+
"source": {
|
| 279 |
+
"fileObject": {
|
| 280 |
+
"@id": "process_parameters_csv"
|
| 281 |
+
},
|
| 282 |
+
"extract": {
|
| 283 |
+
"column": "has_oil"
|
| 284 |
+
}
|
| 285 |
+
},
|
| 286 |
+
"description": "True if the blank was lubricated (oil applied) for this experiment."
|
| 287 |
+
},
|
| 288 |
+
{
|
| 289 |
+
"@type": "cr:Field",
|
| 290 |
+
"@id": "process-parameters/split",
|
| 291 |
+
"name": "split",
|
| 292 |
+
"dataType": "sc:Text",
|
| 293 |
+
"source": {
|
| 294 |
+
"fileObject": {
|
| 295 |
+
"@id": "process_parameters_csv"
|
| 296 |
+
},
|
| 297 |
+
"extract": {
|
| 298 |
+
"column": "split"
|
| 299 |
+
}
|
| 300 |
+
},
|
| 301 |
+
"description": "Recommended ML data split: 'train' (~80%), 'val' (~10%), 'test' (~10%); deterministic, seed=42."
|
| 302 |
+
}
|
| 303 |
+
]
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"@type": "cr:RecordSet",
|
| 307 |
+
"@id": "field-map",
|
| 308 |
+
"name": "field-map",
|
| 309 |
+
"description": "Every raw HDF5 dataset declared once, with its on-disk path and per-file shape. Use-case RecordSets reference entries here.",
|
| 310 |
+
"field": [
|
| 311 |
+
{
|
| 312 |
+
"@type": "cr:Field",
|
| 313 |
+
"@id": "field-map/force_data",
|
| 314 |
+
"name": "force_data",
|
| 315 |
+
"description": "Press force and process signals, time series. Columns: [time (s), load_cell_1..4 (kN), punch_temp (degC), punch_pos (mm), total_force (kN)]. HDF5 path: force/data. Shape (per file): (1140, 8).",
|
| 316 |
+
"dataType": "sc:Float",
|
| 317 |
+
"source": {
|
| 318 |
+
"fileSet": {
|
| 319 |
+
"@id": "h5-files"
|
| 320 |
+
},
|
| 321 |
+
"extract": {
|
| 322 |
+
"fileProperty": "content"
|
| 323 |
+
},
|
| 324 |
+
"transform": [
|
| 325 |
+
{
|
| 326 |
+
"regex": "force/data"
|
| 327 |
+
}
|
| 328 |
+
]
|
| 329 |
+
}
|
| 330 |
+
},
|
| 331 |
+
{
|
| 332 |
+
"@type": "cr:Field",
|
| 333 |
+
"@id": "field-map/oil_thickness_data",
|
| 334 |
+
"name": "oil_thickness_data",
|
| 335 |
+
"description": "Lubricant film measurement along a sensor traverse. Columns: [sensor_position (mm), oil_value (g/m^2)]. HDF5 path: oil_thickness/data. Shape (per file): (421, 2).",
|
| 336 |
+
"dataType": "sc:Float",
|
| 337 |
+
"source": {
|
| 338 |
+
"fileSet": {
|
| 339 |
+
"@id": "h5-files"
|
| 340 |
+
},
|
| 341 |
+
"extract": {
|
| 342 |
+
"fileProperty": "content"
|
| 343 |
+
},
|
| 344 |
+
"transform": [
|
| 345 |
+
{
|
| 346 |
+
"regex": "oil_thickness/data"
|
| 347 |
+
}
|
| 348 |
+
]
|
| 349 |
+
}
|
| 350 |
+
},
|
| 351 |
+
{
|
| 352 |
+
"@type": "cr:Field",
|
| 353 |
+
"@id": "field-map/pointcloud_op10_luminescence",
|
| 354 |
+
"name": "pointcloud_op10_luminescence",
|
| 355 |
+
"description": "Flattened luminescence/intensity buffer of the OP10 scan, pixel-aligned with op10/z. HDF5 path: pointcloud/op10/luminescence. Shape (per file): (6400000).",
|
| 356 |
+
"dataType": "sc:Float",
|
| 357 |
+
"source": {
|
| 358 |
+
"fileSet": {
|
| 359 |
+
"@id": "h5-files"
|
| 360 |
+
},
|
| 361 |
+
"extract": {
|
| 362 |
+
"fileProperty": "content"
|
| 363 |
+
},
|
| 364 |
+
"transform": [
|
| 365 |
+
{
|
| 366 |
+
"regex": "pointcloud/op10/luminescence"
|
| 367 |
+
}
|
| 368 |
+
]
|
| 369 |
+
}
|
| 370 |
+
},
|
| 371 |
+
{
|
| 372 |
+
"@type": "cr:Field",
|
| 373 |
+
"@id": "field-map/pointcloud_op10_z",
|
| 374 |
+
"name": "pointcloud_op10_z",
|
| 375 |
+
"description": "Flattened height (Z) buffer of the OP10 laser scan (after deep drawing), row-major over a y_shape x x_shape grid (see group attributes). Reshape and apply per-pixel calibration to recover a 3D surface (see the rddacs preprocessing step). HDF5 path: pointcloud/op10/z. Shape (per file): (6400000).",
|
| 376 |
+
"dataType": "sc:Float",
|
| 377 |
+
"source": {
|
| 378 |
+
"fileSet": {
|
| 379 |
+
"@id": "h5-files"
|
| 380 |
+
},
|
| 381 |
+
"extract": {
|
| 382 |
+
"fileProperty": "content"
|
| 383 |
+
},
|
| 384 |
+
"transform": [
|
| 385 |
+
{
|
| 386 |
+
"regex": "pointcloud/op10/z"
|
| 387 |
+
}
|
| 388 |
+
]
|
| 389 |
+
}
|
| 390 |
+
},
|
| 391 |
+
{
|
| 392 |
+
"@type": "cr:Field",
|
| 393 |
+
"@id": "field-map/pointcloud_op20_luminescence",
|
| 394 |
+
"name": "pointcloud_op20_luminescence",
|
| 395 |
+
"description": "Flattened luminescence/intensity buffer of the OP20 scan, pixel-aligned with op20/z. HDF5 path: pointcloud/op20/luminescence. Shape (per file): (6400000).",
|
| 396 |
+
"dataType": "sc:Float",
|
| 397 |
+
"source": {
|
| 398 |
+
"fileSet": {
|
| 399 |
+
"@id": "h5-files"
|
| 400 |
+
},
|
| 401 |
+
"extract": {
|
| 402 |
+
"fileProperty": "content"
|
| 403 |
+
},
|
| 404 |
+
"transform": [
|
| 405 |
+
{
|
| 406 |
+
"regex": "pointcloud/op20/luminescence"
|
| 407 |
+
}
|
| 408 |
+
]
|
| 409 |
+
}
|
| 410 |
+
},
|
| 411 |
+
{
|
| 412 |
+
"@type": "cr:Field",
|
| 413 |
+
"@id": "field-map/pointcloud_op20_z",
|
| 414 |
+
"name": "pointcloud_op20_z",
|
| 415 |
+
"description": "Flattened height (Z) buffer of the OP20 laser scan (after cutting), row-major over a y_shape x x_shape grid (see group attributes). HDF5 path: pointcloud/op20/z. Shape (per file): (6400000).",
|
| 416 |
+
"dataType": "sc:Float",
|
| 417 |
+
"source": {
|
| 418 |
+
"fileSet": {
|
| 419 |
+
"@id": "h5-files"
|
| 420 |
+
},
|
| 421 |
+
"extract": {
|
| 422 |
+
"fileProperty": "content"
|
| 423 |
+
},
|
| 424 |
+
"transform": [
|
| 425 |
+
{
|
| 426 |
+
"regex": "pointcloud/op20/z"
|
| 427 |
+
}
|
| 428 |
+
]
|
| 429 |
+
}
|
| 430 |
+
},
|
| 431 |
+
{
|
| 432 |
+
"@type": "cr:Field",
|
| 433 |
+
"@id": "field-map/sheet_thickness_data",
|
| 434 |
+
"name": "sheet_thickness_data",
|
| 435 |
+
"description": "Blank sheet thickness measurement along a sensor traverse. Columns: [sensor_position (mm), sheet_thickness (um)]. HDF5 path: sheet_thickness/data. Shape (per file): (208, 2).",
|
| 436 |
+
"dataType": "sc:Float",
|
| 437 |
+
"source": {
|
| 438 |
+
"fileSet": {
|
| 439 |
+
"@id": "h5-files"
|
| 440 |
+
},
|
| 441 |
+
"extract": {
|
| 442 |
+
"fileProperty": "content"
|
| 443 |
+
},
|
| 444 |
+
"transform": [
|
| 445 |
+
{
|
| 446 |
+
"regex": "sheet_thickness/data"
|
| 447 |
+
}
|
| 448 |
+
]
|
| 449 |
+
}
|
| 450 |
+
}
|
| 451 |
+
]
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"@type": "cr:RecordSet",
|
| 455 |
+
"@id": "pointcloud-op10",
|
| 456 |
+
"name": "pointcloud-op10",
|
| 457 |
+
"description": "OP10 (after deep drawing) raw laser scan: flattened height (z) and luminescence buffers. Reshape with the group's x_shape/y_shape attrs.",
|
| 458 |
+
"field": [
|
| 459 |
+
{
|
| 460 |
+
"@type": "cr:Field",
|
| 461 |
+
"@id": "pointcloud-op10/pointcloud_op10_z",
|
| 462 |
+
"name": "pointcloud_op10_z",
|
| 463 |
+
"dataType": "sc:Float",
|
| 464 |
+
"source": {
|
| 465 |
+
"field": {
|
| 466 |
+
"@id": "field-map/pointcloud_op10_z"
|
| 467 |
+
}
|
| 468 |
+
},
|
| 469 |
+
"description": "Flattened OP10 height buffer."
|
| 470 |
+
},
|
| 471 |
+
{
|
| 472 |
+
"@type": "cr:Field",
|
| 473 |
+
"@id": "pointcloud-op10/pointcloud_op10_luminescence",
|
| 474 |
+
"name": "pointcloud_op10_luminescence",
|
| 475 |
+
"dataType": "sc:Float",
|
| 476 |
+
"source": {
|
| 477 |
+
"field": {
|
| 478 |
+
"@id": "field-map/pointcloud_op10_luminescence"
|
| 479 |
+
}
|
| 480 |
+
},
|
| 481 |
+
"description": "Flattened OP10 luminescence buffer."
|
| 482 |
+
}
|
| 483 |
+
]
|
| 484 |
+
},
|
| 485 |
+
{
|
| 486 |
+
"@type": "cr:RecordSet",
|
| 487 |
+
"@id": "pointcloud-op20",
|
| 488 |
+
"name": "pointcloud-op20",
|
| 489 |
+
"description": "OP20 (after cutting) raw laser scan: flattened height (z) and luminescence buffers.",
|
| 490 |
+
"field": [
|
| 491 |
+
{
|
| 492 |
+
"@type": "cr:Field",
|
| 493 |
+
"@id": "pointcloud-op20/pointcloud_op20_z",
|
| 494 |
+
"name": "pointcloud_op20_z",
|
| 495 |
+
"dataType": "sc:Float",
|
| 496 |
+
"source": {
|
| 497 |
+
"field": {
|
| 498 |
+
"@id": "field-map/pointcloud_op20_z"
|
| 499 |
+
}
|
| 500 |
+
},
|
| 501 |
+
"description": "Flattened OP20 height buffer."
|
| 502 |
+
},
|
| 503 |
+
{
|
| 504 |
+
"@type": "cr:Field",
|
| 505 |
+
"@id": "pointcloud-op20/pointcloud_op20_luminescence",
|
| 506 |
+
"name": "pointcloud_op20_luminescence",
|
| 507 |
+
"dataType": "sc:Float",
|
| 508 |
+
"source": {
|
| 509 |
+
"field": {
|
| 510 |
+
"@id": "field-map/pointcloud_op20_luminescence"
|
| 511 |
+
}
|
| 512 |
+
},
|
| 513 |
+
"description": "Flattened OP20 luminescence buffer."
|
| 514 |
+
}
|
| 515 |
+
]
|
| 516 |
+
},
|
| 517 |
+
{
|
| 518 |
+
"@type": "cr:RecordSet",
|
| 519 |
+
"@id": "force-curve",
|
| 520 |
+
"name": "force-curve",
|
| 521 |
+
"description": "Press force and process signal time series for one experiment.",
|
| 522 |
+
"field": [
|
| 523 |
+
{
|
| 524 |
+
"@type": "cr:Field",
|
| 525 |
+
"@id": "force-curve/force_data",
|
| 526 |
+
"name": "force_data",
|
| 527 |
+
"dataType": "sc:Float",
|
| 528 |
+
"source": {
|
| 529 |
+
"field": {
|
| 530 |
+
"@id": "field-map/force_data"
|
| 531 |
+
}
|
| 532 |
+
},
|
| 533 |
+
"description": "Force/process signal table; see field-map for column layout."
|
| 534 |
+
}
|
| 535 |
+
]
|
| 536 |
+
},
|
| 537 |
+
{
|
| 538 |
+
"@type": "cr:RecordSet",
|
| 539 |
+
"@id": "sheet-thickness",
|
| 540 |
+
"name": "sheet-thickness",
|
| 541 |
+
"description": "Sheet thickness traverse for one experiment (single modality). Measured on the bare blank before lubrication; sensor positions carry a 50 mm offset (raw 50-257 mm).",
|
| 542 |
+
"field": [
|
| 543 |
+
{
|
| 544 |
+
"@type": "cr:Field",
|
| 545 |
+
"@id": "sheet-thickness/sheet_thickness_data",
|
| 546 |
+
"name": "sheet_thickness_data",
|
| 547 |
+
"dataType": "sc:Float",
|
| 548 |
+
"source": {
|
| 549 |
+
"field": {
|
| 550 |
+
"@id": "field-map/sheet_thickness_data"
|
| 551 |
+
}
|
| 552 |
+
},
|
| 553 |
+
"description": "Sheet thickness traverse."
|
| 554 |
+
}
|
| 555 |
+
]
|
| 556 |
+
},
|
| 557 |
+
{
|
| 558 |
+
"@type": "cr:RecordSet",
|
| 559 |
+
"@id": "oil-thickness",
|
| 560 |
+
"name": "oil-thickness",
|
| 561 |
+
"description": "Oil film traverse for one experiment (single modality). Measured on the blank after lubrication. Only present when has_oil is true (filter with the process-parameters has_oil column).",
|
| 562 |
+
"field": [
|
| 563 |
+
{
|
| 564 |
+
"@type": "cr:Field",
|
| 565 |
+
"@id": "oil-thickness/oil_thickness_data",
|
| 566 |
+
"name": "oil_thickness_data",
|
| 567 |
+
"dataType": "sc:Float",
|
| 568 |
+
"source": {
|
| 569 |
+
"field": {
|
| 570 |
+
"@id": "field-map/oil_thickness_data"
|
| 571 |
+
}
|
| 572 |
+
},
|
| 573 |
+
"description": "Oil/lubricant film traverse."
|
| 574 |
+
}
|
| 575 |
+
]
|
| 576 |
+
},
|
| 577 |
+
{
|
| 578 |
+
"@type": "cr:RecordSet",
|
| 579 |
+
"@id": "thickness",
|
| 580 |
+
"name": "thickness",
|
| 581 |
+
"description": "Sheet thickness and lubricant film traverses combined. Requires has_oil=true experiments; use the single-modality views otherwise.",
|
| 582 |
+
"field": [
|
| 583 |
+
{
|
| 584 |
+
"@type": "cr:Field",
|
| 585 |
+
"@id": "thickness/sheet_thickness_data",
|
| 586 |
+
"name": "sheet_thickness_data",
|
| 587 |
+
"dataType": "sc:Float",
|
| 588 |
+
"source": {
|
| 589 |
+
"field": {
|
| 590 |
+
"@id": "field-map/sheet_thickness_data"
|
| 591 |
+
}
|
| 592 |
+
},
|
| 593 |
+
"description": "Sheet thickness traverse."
|
| 594 |
+
},
|
| 595 |
+
{
|
| 596 |
+
"@type": "cr:Field",
|
| 597 |
+
"@id": "thickness/oil_thickness_data",
|
| 598 |
+
"name": "oil_thickness_data",
|
| 599 |
+
"dataType": "sc:Float",
|
| 600 |
+
"source": {
|
| 601 |
+
"field": {
|
| 602 |
+
"@id": "field-map/oil_thickness_data"
|
| 603 |
+
}
|
| 604 |
+
},
|
| 605 |
+
"description": "Oil/lubricant film traverse."
|
| 606 |
+
}
|
| 607 |
+
]
|
| 608 |
+
}
|
| 609 |
+
]
|
| 610 |
+
}
|
data/process_parameters.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/01_getting_started.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/02_views.ipynb
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "0827618f",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# Build your own view\n",
|
| 9 |
+
"\n",
|
| 10 |
+
"Companion notebook for the RDDAC [documentation](https://rddac.readthedocs.io). It is written to stand on its own: every step is annotated so the notebook reads top to bottom.\n",
|
| 11 |
+
"\n",
|
| 12 |
+
"## Walkthrough\n",
|
| 13 |
+
"\n",
|
| 14 |
+
"1. load the dataset and list the published RecordSets,\n",
|
| 15 |
+
"2. look up the available source fields in the `field-map` RecordSet,\n",
|
| 16 |
+
"3. append a custom RecordSet with slicing,\n",
|
| 17 |
+
"4. mix in `process-parameters` CSV columns,\n",
|
| 18 |
+
"5. inspect the resolved source fields and transforms,\n",
|
| 19 |
+
"6. stream records of the view with `rddac.streaming.iter_view`,\n",
|
| 20 |
+
"7. register the prefab recipes from `rddac.views`,\n",
|
| 21 |
+
"8. read the experiment index directly.\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"## Assumptions\n",
|
| 24 |
+
"\n",
|
| 25 |
+
"- This notebook lives in `notebooks/` of the repository and reads the dataset from `../data/` (on your machine: the directory `rddac download` wrote to).\n",
|
| 26 |
+
"- The data directory contains `metadata.json`, `process_parameters.csv`, and at least the bundled `sample.zip`."
|
| 27 |
+
]
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"cell_type": "code",
|
| 31 |
+
"execution_count": 1,
|
| 32 |
+
"id": "1d078b0e",
|
| 33 |
+
"metadata": {
|
| 34 |
+
"execution": {
|
| 35 |
+
"iopub.execute_input": "2026-07-07T09:01:56.801007Z",
|
| 36 |
+
"iopub.status.busy": "2026-07-07T09:01:56.800907Z",
|
| 37 |
+
"iopub.status.idle": "2026-07-07T09:01:58.620063Z",
|
| 38 |
+
"shell.execute_reply": "2026-07-07T09:01:58.619307Z"
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"outputs": [
|
| 42 |
+
{
|
| 43 |
+
"name": "stdout",
|
| 44 |
+
"output_type": "stream",
|
| 45 |
+
"text": [
|
| 46 |
+
"rddac 0.1.0\n"
|
| 47 |
+
]
|
| 48 |
+
}
|
| 49 |
+
],
|
| 50 |
+
"source": [
|
| 51 |
+
"import warnings\n",
|
| 52 |
+
"warnings.filterwarnings('ignore')\n",
|
| 53 |
+
"\n",
|
| 54 |
+
"import rddac\n",
|
| 55 |
+
"print('rddac', rddac.__version__)\n",
|
| 56 |
+
"\n",
|
| 57 |
+
"from pathlib import Path\n",
|
| 58 |
+
"DATA_DIR = Path('../data')\n",
|
| 59 |
+
"# DATA_DIR = Path('./data') # uncomment instead when running from the repository root\n",
|
| 60 |
+
"assert (DATA_DIR / 'metadata.json').is_file(), f'{DATA_DIR} does not contain the dataset'"
|
| 61 |
+
]
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"cell_type": "markdown",
|
| 65 |
+
"id": "fe132196",
|
| 66 |
+
"metadata": {},
|
| 67 |
+
"source": [
|
| 68 |
+
"## 1. Load the dataset\n",
|
| 69 |
+
"\n",
|
| 70 |
+
"`rddac.load(data_dir=...)` reads `metadata.json` from `data_dir`, registers any zip files it finds there so the HDF5 members can be read in place, and exposes the published RecordSets through `ds.metadata.record_sets`. Listing them first is good practice: a custom view is only ever needed when none of the published ones fit.\n",
|
| 71 |
+
"\n",
|
| 72 |
+
"Four h5-backed views ship with the manifest — `force-curve`, `thickness`, `pointcloud-op10`, and `pointcloud-op20` — plus the `process-parameters` index and the `field-map` lookup table that custom views build on."
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"cell_type": "code",
|
| 77 |
+
"execution_count": 2,
|
| 78 |
+
"id": "b12ab07e",
|
| 79 |
+
"metadata": {
|
| 80 |
+
"execution": {
|
| 81 |
+
"iopub.execute_input": "2026-07-07T09:01:58.622101Z",
|
| 82 |
+
"iopub.status.busy": "2026-07-07T09:01:58.621779Z",
|
| 83 |
+
"iopub.status.idle": "2026-07-07T09:01:58.760576Z",
|
| 84 |
+
"shell.execute_reply": "2026-07-07T09:01:58.759921Z"
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"outputs": [
|
| 88 |
+
{
|
| 89 |
+
"name": "stdout",
|
| 90 |
+
"output_type": "stream",
|
| 91 |
+
"text": [
|
| 92 |
+
"published RecordSets:\n",
|
| 93 |
+
" process-parameters\n",
|
| 94 |
+
" field-map\n",
|
| 95 |
+
" pointcloud-op10\n",
|
| 96 |
+
" pointcloud-op20\n",
|
| 97 |
+
" force-curve\n",
|
| 98 |
+
" sheet-thickness\n",
|
| 99 |
+
" oil-thickness\n",
|
| 100 |
+
" thickness\n"
|
| 101 |
+
]
|
| 102 |
+
}
|
| 103 |
+
],
|
| 104 |
+
"source": [
|
| 105 |
+
"ds = rddac.load(data_dir=DATA_DIR)\n",
|
| 106 |
+
"print('published RecordSets:')\n",
|
| 107 |
+
"for rs in ds.metadata.record_sets:\n",
|
| 108 |
+
" print(f' {rs.id}')"
|
| 109 |
+
]
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"cell_type": "markdown",
|
| 113 |
+
"id": "a8dd6ea5",
|
| 114 |
+
"metadata": {},
|
| 115 |
+
"source": [
|
| 116 |
+
"## 2. The `field-map` RecordSet\n",
|
| 117 |
+
"\n",
|
| 118 |
+
"Every HDF5 dataset that a view can pull from is declared once in the manifest's `field-map` RecordSet: the field name is what goes on the right-hand side of `add_view(fields=...)`, and the description documents what the array contains. The helper below prints the full lookup table, so there is no need to memorise anything."
|
| 119 |
+
]
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"cell_type": "code",
|
| 123 |
+
"execution_count": 3,
|
| 124 |
+
"id": "a32d80a1",
|
| 125 |
+
"metadata": {
|
| 126 |
+
"execution": {
|
| 127 |
+
"iopub.execute_input": "2026-07-07T09:01:58.762219Z",
|
| 128 |
+
"iopub.status.busy": "2026-07-07T09:01:58.762108Z",
|
| 129 |
+
"iopub.status.idle": "2026-07-07T09:01:58.765113Z",
|
| 130 |
+
"shell.execute_reply": "2026-07-07T09:01:58.764392Z"
|
| 131 |
+
}
|
| 132 |
+
},
|
| 133 |
+
"outputs": [
|
| 134 |
+
{
|
| 135 |
+
"name": "stdout",
|
| 136 |
+
"output_type": "stream",
|
| 137 |
+
"text": [
|
| 138 |
+
" force_data Press force and process signals, time series. Columns: [time (s), load_cell_1..4 (kN), punch_temp (degC), punch_pos (mm), total_force (kN)]. HDF5 path: force/data. Shape (per file): (1140, 8).\n",
|
| 139 |
+
" oil_thickness_data Lubricant film measurement along a sensor traverse. Columns: [sensor_position (mm), oil_value (g/m^2)]. HDF5 path: oil_thickness/data. Shape (per file): (421, 2).\n",
|
| 140 |
+
" pointcloud_op10_luminescence Flattened luminescence/intensity buffer of the OP10 scan, pixel-aligned with op10/z. HDF5 path: pointcloud/op10/luminescence. Shape (per file): (6400000).\n",
|
| 141 |
+
" pointcloud_op10_z Flattened height (Z) buffer of the OP10 laser scan (after deep drawing), row-major over a y_shape x x_shape grid (see group attributes). Reshape and apply per-pixel calibration to recover a 3D surface (see the rddacs preprocessing step). HDF5 path: pointcloud/op10/z. Shape (per file): (6400000).\n",
|
| 142 |
+
" pointcloud_op20_luminescence Flattened luminescence/intensity buffer of the OP20 scan, pixel-aligned with op20/z. HDF5 path: pointcloud/op20/luminescence. Shape (per file): (6400000).\n",
|
| 143 |
+
" pointcloud_op20_z Flattened height (Z) buffer of the OP20 laser scan (after cutting), row-major over a y_shape x x_shape grid (see group attributes). HDF5 path: pointcloud/op20/z. Shape (per file): (6400000).\n",
|
| 144 |
+
" sheet_thickness_data Blank sheet thickness measurement along a sensor traverse. Columns: [sensor_position (mm), sheet_thickness (um)]. HDF5 path: sheet_thickness/data. Shape (per file): (208, 2).\n"
|
| 145 |
+
]
|
| 146 |
+
}
|
| 147 |
+
],
|
| 148 |
+
"source": [
|
| 149 |
+
"from rddac.croissant import field_map\n",
|
| 150 |
+
"\n",
|
| 151 |
+
"for name, f in field_map(ds).items():\n",
|
| 152 |
+
" print(f' {name:32s} {(f.description or \"\")}')"
|
| 153 |
+
]
|
| 154 |
+
},
|
| 155 |
+
{
|
| 156 |
+
"cell_type": "markdown",
|
| 157 |
+
"id": "934737c7",
|
| 158 |
+
"metadata": {},
|
| 159 |
+
"source": [
|
| 160 |
+
"## 3. Append a custom RecordSet\n",
|
| 161 |
+
"\n",
|
| 162 |
+
"`rddac.add_view(ds, name, fields)` mutates `ds` in place. After it returns, the new RecordSet is part of `ds.metadata.record_sets` and can be streamed exactly like a published one.\n",
|
| 163 |
+
"\n",
|
| 164 |
+
"Each entry of `fields` maps an **alias** (the dict key) to a **source field** from `field-map`, plus an optional **index selection** along the first axis. The raw `force/data` table has shape `(n, 8)` with `n` varying per experiment, which makes it a good demonstrator for every supported shape:\n",
|
| 165 |
+
"\n",
|
| 166 |
+
"- `force` keeps the whole table -> `(n, 8)`, the form for a model that consumes the full press stroke.\n",
|
| 167 |
+
"- `force_head` takes rows `0..99` -> `(100, 8)`, a fixed-size window (handy for batching, see the PyTorch notebook).\n",
|
| 168 |
+
"- `first_sample` takes row `0` -> `(8,)`, a single snapshot; the integer index drops the axis.\n",
|
| 169 |
+
"- `sheet` is the shortcut form: a bare string means \"the whole field\", same as `(\"...\", None)`.\n",
|
| 170 |
+
"\n",
|
| 171 |
+
"The published manifest on DaRUS is **not** modified; only the in-memory dataset grows."
|
| 172 |
+
]
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"cell_type": "code",
|
| 176 |
+
"execution_count": 4,
|
| 177 |
+
"id": "32d95a8e",
|
| 178 |
+
"metadata": {
|
| 179 |
+
"execution": {
|
| 180 |
+
"iopub.execute_input": "2026-07-07T09:01:58.766703Z",
|
| 181 |
+
"iopub.status.busy": "2026-07-07T09:01:58.766601Z",
|
| 182 |
+
"iopub.status.idle": "2026-07-07T09:01:58.840512Z",
|
| 183 |
+
"shell.execute_reply": "2026-07-07T09:01:58.839804Z"
|
| 184 |
+
}
|
| 185 |
+
},
|
| 186 |
+
"outputs": [
|
| 187 |
+
{
|
| 188 |
+
"name": "stdout",
|
| 189 |
+
"output_type": "stream",
|
| 190 |
+
"text": [
|
| 191 |
+
"record_sets after add_view:\n",
|
| 192 |
+
" process-parameters\n",
|
| 193 |
+
" field-map\n",
|
| 194 |
+
" pointcloud-op10\n",
|
| 195 |
+
" pointcloud-op20\n",
|
| 196 |
+
" force-curve\n",
|
| 197 |
+
" sheet-thickness\n",
|
| 198 |
+
" oil-thickness\n",
|
| 199 |
+
" thickness\n",
|
| 200 |
+
" my-view\n"
|
| 201 |
+
]
|
| 202 |
+
}
|
| 203 |
+
],
|
| 204 |
+
"source": [
|
| 205 |
+
"rddac.add_view(\n",
|
| 206 |
+
" ds,\n",
|
| 207 |
+
" 'my-view',\n",
|
| 208 |
+
" fields={\n",
|
| 209 |
+
" 'force': ('force_data', None), # whole (n, 8) table\n",
|
| 210 |
+
" 'force_head': ('force_data', list(range(100))), # fixed 100-row window\n",
|
| 211 |
+
" 'first_sample': ('force_data', 0), # one row\n",
|
| 212 |
+
" 'sheet': 'sheet_thickness_data', # whole field, shortcut form\n",
|
| 213 |
+
" },\n",
|
| 214 |
+
")\n",
|
| 215 |
+
"\n",
|
| 216 |
+
"print('record_sets after add_view:')\n",
|
| 217 |
+
"for rs in ds.metadata.record_sets:\n",
|
| 218 |
+
" print(f' {rs.id}')"
|
| 219 |
+
]
|
| 220 |
+
},
|
| 221 |
+
{
|
| 222 |
+
"cell_type": "markdown",
|
| 223 |
+
"id": "455ccba5",
|
| 224 |
+
"metadata": {},
|
| 225 |
+
"source": [
|
| 226 |
+
"## 4. Mix in process-parameters columns\n",
|
| 227 |
+
"\n",
|
| 228 |
+
"`add_view` also accepts **qualified** field IDs of the form `\"<record-set>/<field>\"`, which lets a single view combine HDF5 fields from `field-map` with CSV columns from `process-parameters`. The two sources are joined on the experiment id automatically: `mlcroissant` requires an explicit cross-source `references` link to validate the manifest, and `add_view` injects one on the first field-map field for you, so no manual join wiring is needed on the consumer side.\n",
|
| 229 |
+
"\n",
|
| 230 |
+
"Iteration via `rddac.streaming.iter_view` returns one record per experiment with both kinds of fields side by side: HDF5 arrays and CSV columns appear under their respective aliases. (At this layer the CSV goes through pandas, so strings arrive as `str`, not `bytes`.)"
|
| 231 |
+
]
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"cell_type": "code",
|
| 235 |
+
"execution_count": 5,
|
| 236 |
+
"id": "7d72add9",
|
| 237 |
+
"metadata": {
|
| 238 |
+
"execution": {
|
| 239 |
+
"iopub.execute_input": "2026-07-07T09:01:58.842118Z",
|
| 240 |
+
"iopub.status.busy": "2026-07-07T09:01:58.842012Z",
|
| 241 |
+
"iopub.status.idle": "2026-07-07T09:02:00.165174Z",
|
| 242 |
+
"shell.execute_reply": "2026-07-07T09:02:00.164278Z"
|
| 243 |
+
}
|
| 244 |
+
},
|
| 245 |
+
"outputs": [
|
| 246 |
+
{
|
| 247 |
+
"name": "stdout",
|
| 248 |
+
"output_type": "stream",
|
| 249 |
+
"text": [
|
| 250 |
+
"experiment 0: force_head.shape=(100, 8) geometry='concave' blankholder_force=100 kN oil_type='coarse' split='val'\n"
|
| 251 |
+
]
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"name": "stdout",
|
| 255 |
+
"output_type": "stream",
|
| 256 |
+
"text": [
|
| 257 |
+
"experiment 4500: force_head.shape=(100, 8) geometry='convex' blankholder_force=100 kN oil_type='coarse' split='train'\n"
|
| 258 |
+
]
|
| 259 |
+
}
|
| 260 |
+
],
|
| 261 |
+
"source": [
|
| 262 |
+
"rddac.add_view(\n",
|
| 263 |
+
" ds,\n",
|
| 264 |
+
" 'my-view-with-params',\n",
|
| 265 |
+
" fields={\n",
|
| 266 |
+
" 'force_head': ('force_data', list(range(100))),\n",
|
| 267 |
+
" 'geometry': 'process-parameters/geometry',\n",
|
| 268 |
+
" 'blankholder_force': 'process-parameters/blankholder_force',\n",
|
| 269 |
+
" 'oil_type': 'process-parameters/oil_type',\n",
|
| 270 |
+
" 'split': 'process-parameters/split',\n",
|
| 271 |
+
" },\n",
|
| 272 |
+
")\n",
|
| 273 |
+
"\n",
|
| 274 |
+
"for rec in rddac.streaming.iter_view(\n",
|
| 275 |
+
" 'my-view-with-params',\n",
|
| 276 |
+
" data_dir=DATA_DIR,\n",
|
| 277 |
+
" dataset=ds,\n",
|
| 278 |
+
" sim_ids=[0, 4500],\n",
|
| 279 |
+
"):\n",
|
| 280 |
+
" print(f\"experiment {rec['_sim_id']:4d}: force_head.shape={rec['force_head'].shape} \"\n",
|
| 281 |
+
" f\"geometry={rec['geometry']!r} blankholder_force={rec['blankholder_force']} kN \"\n",
|
| 282 |
+
" f\"oil_type={rec['oil_type']!r} split={rec['split']!r}\")"
|
| 283 |
+
]
|
| 284 |
+
},
|
| 285 |
+
{
|
| 286 |
+
"cell_type": "markdown",
|
| 287 |
+
"id": "975c5ab0",
|
| 288 |
+
"metadata": {},
|
| 289 |
+
"source": [
|
| 290 |
+
"## 5. Inspect the new view's fields\n",
|
| 291 |
+
"\n",
|
| 292 |
+
"Each field of the view stores a **source** (the field-map entry it pulls from) and an **optional JSONPath transform** that records the index selection:\n",
|
| 293 |
+
"\n",
|
| 294 |
+
"- `(\"field_id\", 0)` -> JSONPath `$[0]`\n",
|
| 295 |
+
"- `(\"field_id\", [0, 1, ...])` -> JSONPath `$[0,1,...]`\n",
|
| 296 |
+
"- `\"field_id\"` or `(\"field_id\", None)` -> no transform (whole field)\n",
|
| 297 |
+
"\n",
|
| 298 |
+
"Printing the resolved transforms is a quick way to verify the view was built as expected before you start training on it."
|
| 299 |
+
]
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"cell_type": "code",
|
| 303 |
+
"execution_count": 6,
|
| 304 |
+
"id": "93d5169b",
|
| 305 |
+
"metadata": {
|
| 306 |
+
"execution": {
|
| 307 |
+
"iopub.execute_input": "2026-07-07T09:02:00.167153Z",
|
| 308 |
+
"iopub.status.busy": "2026-07-07T09:02:00.166906Z",
|
| 309 |
+
"iopub.status.idle": "2026-07-07T09:02:00.171823Z",
|
| 310 |
+
"shell.execute_reply": "2026-07-07T09:02:00.170983Z"
|
| 311 |
+
}
|
| 312 |
+
},
|
| 313 |
+
"outputs": [
|
| 314 |
+
{
|
| 315 |
+
"name": "stdout",
|
| 316 |
+
"output_type": "stream",
|
| 317 |
+
"text": [
|
| 318 |
+
" my-view/force <- field-map/force_data transforms=[]\n",
|
| 319 |
+
" my-view/force_head <- field-map/force_data transforms=['$[0,1,2,3,4,5,6,7,8,9,10,11...']\n",
|
| 320 |
+
" my-view/first_sample <- field-map/force_data transforms=['$[0]']\n",
|
| 321 |
+
" my-view/sheet <- field-map/sheet_thickness_data transforms=[]\n"
|
| 322 |
+
]
|
| 323 |
+
}
|
| 324 |
+
],
|
| 325 |
+
"source": [
|
| 326 |
+
"view = next(rs for rs in ds.metadata.record_sets if rs.id == 'my-view')\n",
|
| 327 |
+
"for f in view.fields:\n",
|
| 328 |
+
" transforms = [t.json_path for t in (f.source.transforms or [])]\n",
|
| 329 |
+
" shown = [t if len(t) <= 30 else t[:27] + '...' for t in transforms]\n",
|
| 330 |
+
" print(f' {f.id:24s} <- {f.source.uuid:28s} transforms={shown}')"
|
| 331 |
+
]
|
| 332 |
+
},
|
| 333 |
+
{
|
| 334 |
+
"cell_type": "markdown",
|
| 335 |
+
"id": "048ec63b",
|
| 336 |
+
"metadata": {},
|
| 337 |
+
"source": [
|
| 338 |
+
"## 6. Stream records of the view\n",
|
| 339 |
+
"\n",
|
| 340 |
+
"> **Heads up.** Do **not** iterate an h5-backed view through `ds.records(view)`. `mlcroissant` walks the whole FileSet at iterator setup and materialises every HDF5 member of every referenced zip before applying any filter — with the full release local (two ~40 GB zips) it did not produce a first record within several minutes in our tests. This path is fine for CSV-backed RecordSets (step 8 below) but the wrong tool for the measurement data.\n",
|
| 341 |
+
">\n",
|
| 342 |
+
"> Two replacements both work and both scale to the full release. They share the same lazy `experiment id -> local zip` index, open a zip only when a record is actually requested, and silently skip experiments whose zip is missing on a partial download. Both accept the `dataset=` kwarg so the in-memory `add_view` mutation flows through:\n",
|
| 343 |
+
">\n",
|
| 344 |
+
"> ```python\n",
|
| 345 |
+
"> # No-PyTorch path: plain Python generator (this notebook + 06_streaming).\n",
|
| 346 |
+
"> for rec in rddac.streaming.iter_view('my-view', data_dir=DATA_DIR, dataset=ds):\n",
|
| 347 |
+
"> ...\n",
|
| 348 |
+
">\n",
|
| 349 |
+
"> # PyTorch path: torch.utils.data.IterableDataset for DataLoader batching (03_pytorch).\n",
|
| 350 |
+
"> from rddac import RDDACDataset\n",
|
| 351 |
+
"> custom_ds = RDDACDataset(view='my-view', data_dir=DATA_DIR, dataset=ds)\n",
|
| 352 |
+
"> ```\n",
|
| 353 |
+
"\n",
|
| 354 |
+
"Each record is a dict keyed by the aliases declared in `add_view`, with values already sliced according to the JSONPath transform, plus a private `_sim_id` key carrying the experiment id. `first_sample` comes out as `(8,)` (the `$[0]` transform dropped the first axis) while `force` keeps the full per-experiment `(n, 8)` shape — note how `n` differs between the two experiments below."
|
| 355 |
+
]
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"cell_type": "code",
|
| 359 |
+
"execution_count": 7,
|
| 360 |
+
"id": "a007a9b9",
|
| 361 |
+
"metadata": {
|
| 362 |
+
"execution": {
|
| 363 |
+
"iopub.execute_input": "2026-07-07T09:02:00.173504Z",
|
| 364 |
+
"iopub.status.busy": "2026-07-07T09:02:00.173322Z",
|
| 365 |
+
"iopub.status.idle": "2026-07-07T09:02:00.221711Z",
|
| 366 |
+
"shell.execute_reply": "2026-07-07T09:02:00.221031Z"
|
| 367 |
+
}
|
| 368 |
+
},
|
| 369 |
+
"outputs": [
|
| 370 |
+
{
|
| 371 |
+
"name": "stdout",
|
| 372 |
+
"output_type": "stream",
|
| 373 |
+
"text": [
|
| 374 |
+
"experiment 0\n",
|
| 375 |
+
" force shape=(1140, 8) dtype=float32\n",
|
| 376 |
+
" force_head shape=(100, 8) dtype=float32\n",
|
| 377 |
+
" first_sample shape=(8,) dtype=float32\n",
|
| 378 |
+
" sheet shape=(208, 2) dtype=float32\n",
|
| 379 |
+
"experiment 4500\n",
|
| 380 |
+
" force shape=(720, 8) dtype=float32\n",
|
| 381 |
+
" force_head shape=(100, 8) dtype=float32\n",
|
| 382 |
+
" first_sample shape=(8,) dtype=float32\n",
|
| 383 |
+
" sheet shape=(208, 2) dtype=float32\n"
|
| 384 |
+
]
|
| 385 |
+
}
|
| 386 |
+
],
|
| 387 |
+
"source": [
|
| 388 |
+
"import numpy as np\n",
|
| 389 |
+
"\n",
|
| 390 |
+
"for rec in rddac.streaming.iter_view('my-view', data_dir=DATA_DIR, dataset=ds, sim_ids=[0, 4500]):\n",
|
| 391 |
+
" print(f\"experiment {rec['_sim_id']:4d}\")\n",
|
| 392 |
+
" for k, v in rec.items():\n",
|
| 393 |
+
" if k.startswith('_'):\n",
|
| 394 |
+
" continue\n",
|
| 395 |
+
" arr = np.asarray(v)\n",
|
| 396 |
+
" print(f' {k:14s} shape={arr.shape} dtype={arr.dtype}')"
|
| 397 |
+
]
|
| 398 |
+
},
|
| 399 |
+
{
|
| 400 |
+
"cell_type": "markdown",
|
| 401 |
+
"id": "b31d5795",
|
| 402 |
+
"metadata": {},
|
| 403 |
+
"source": [
|
| 404 |
+
"## 8. Read the experiment index\n",
|
| 405 |
+
"\n",
|
| 406 |
+
"The `process-parameters` RecordSet is sourced from the CSV (not from the h5 zips), so the plain `mlcroissant` records iterator works regardless of which zips are downloaded locally — this is the one RecordSet where `ds.records(...)` is the canonical access path. For tabular work, `pandas.read_csv(DATA_DIR / 'process_parameters.csv')` is one line away."
|
| 407 |
+
]
|
| 408 |
+
},
|
| 409 |
+
{
|
| 410 |
+
"cell_type": "code",
|
| 411 |
+
"execution_count": 8,
|
| 412 |
+
"id": "949f0eb6",
|
| 413 |
+
"metadata": {
|
| 414 |
+
"execution": {
|
| 415 |
+
"iopub.execute_input": "2026-07-07T09:02:00.223417Z",
|
| 416 |
+
"iopub.status.busy": "2026-07-07T09:02:00.223299Z",
|
| 417 |
+
"iopub.status.idle": "2026-07-07T09:02:00.247872Z",
|
| 418 |
+
"shell.execute_reply": "2026-07-07T09:02:00.247287Z"
|
| 419 |
+
}
|
| 420 |
+
},
|
| 421 |
+
"outputs": [
|
| 422 |
+
{
|
| 423 |
+
"name": "stdout",
|
| 424 |
+
"output_type": "stream",
|
| 425 |
+
"text": [
|
| 426 |
+
" process-parameters/index = 0\n",
|
| 427 |
+
" process-parameters/experiment_id = 1\n",
|
| 428 |
+
" process-parameters/category = 0\n",
|
| 429 |
+
" process-parameters/geometry = b'concave'\n",
|
| 430 |
+
" process-parameters/blankholder_force = 100\n",
|
| 431 |
+
" process-parameters/mean_punch_temp = 20.2\n",
|
| 432 |
+
" process-parameters/oil_type = b'coarse'\n",
|
| 433 |
+
" process-parameters/has_pointcloud = True\n",
|
| 434 |
+
" process-parameters/has_oil = True\n",
|
| 435 |
+
" process-parameters/split = b'val'\n"
|
| 436 |
+
]
|
| 437 |
+
}
|
| 438 |
+
],
|
| 439 |
+
"source": [
|
| 440 |
+
"for n, rec in enumerate(ds.records('process-parameters'), start=1):\n",
|
| 441 |
+
" if n == 1:\n",
|
| 442 |
+
" for k, v in rec.items():\n",
|
| 443 |
+
" print(f' {k:42s} = {v}')\n",
|
| 444 |
+
" if n >= 1:\n",
|
| 445 |
+
" break"
|
| 446 |
+
]
|
| 447 |
+
}
|
| 448 |
+
],
|
| 449 |
+
"metadata": {
|
| 450 |
+
"kernelspec": {
|
| 451 |
+
"display_name": "Python 3 (ipykernel)",
|
| 452 |
+
"language": "python",
|
| 453 |
+
"name": "python3"
|
| 454 |
+
},
|
| 455 |
+
"language_info": {
|
| 456 |
+
"codemirror_mode": {
|
| 457 |
+
"name": "ipython",
|
| 458 |
+
"version": 3
|
| 459 |
+
},
|
| 460 |
+
"file_extension": ".py",
|
| 461 |
+
"mimetype": "text/x-python",
|
| 462 |
+
"name": "python",
|
| 463 |
+
"nbconvert_exporter": "python",
|
| 464 |
+
"pygments_lexer": "ipython3",
|
| 465 |
+
"version": "3.11.14"
|
| 466 |
+
}
|
| 467 |
+
},
|
| 468 |
+
"nbformat": 4,
|
| 469 |
+
"nbformat_minor": 5
|
| 470 |
+
}
|
notebooks/03_pytorch.ipynb
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "5ab3480b",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# PyTorch training\n",
|
| 9 |
+
"\n",
|
| 10 |
+
"Companion notebook for the RDDAC [documentation](https://rddac.readthedocs.io). It is written to stand on its own: every step is annotated so the notebook reads top to bottom.\n",
|
| 11 |
+
"\n",
|
| 12 |
+
"## Walkthrough\n",
|
| 13 |
+
"\n",
|
| 14 |
+
"1. construct an `RDDACDataset` over a published view,\n",
|
| 15 |
+
"2. stream single records through a `DataLoader` (the raw signals are ragged),\n",
|
| 16 |
+
"3. batch properly with a fixed-shape custom view via `add_view` + `dataset=`,\n",
|
| 17 |
+
"4. filter via process-parameter columns and an explicit `sim_ids` allowlist,\n",
|
| 18 |
+
"5. build the canonical train / val / test splits from the CSV `split` column,\n",
|
| 19 |
+
"6. enable per-shard shuffle and `set_epoch` for multi-epoch training,\n",
|
| 20 |
+
"7. understand the metadata-column limitation and its workarounds,\n",
|
| 21 |
+
"8. run a minimal training-loop skeleton.\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"## Assumptions\n",
|
| 24 |
+
"\n",
|
| 25 |
+
"- This notebook lives in `notebooks/` of the repository and reads the dataset from `../data/` (on your machine: the directory `rddac download` wrote to).\n",
|
| 26 |
+
"- The data directory contains `metadata.json`, `process_parameters.csv`, and at least the bundled `sample.zip`.\n",
|
| 27 |
+
"- The PyTorch extra is installed: `pip install rddac[torch]`."
|
| 28 |
+
]
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"cell_type": "code",
|
| 32 |
+
"execution_count": 1,
|
| 33 |
+
"id": "abb54f16",
|
| 34 |
+
"metadata": {
|
| 35 |
+
"execution": {
|
| 36 |
+
"iopub.execute_input": "2026-07-07T09:02:01.880898Z",
|
| 37 |
+
"iopub.status.busy": "2026-07-07T09:02:01.880754Z",
|
| 38 |
+
"iopub.status.idle": "2026-07-07T09:02:03.720461Z",
|
| 39 |
+
"shell.execute_reply": "2026-07-07T09:02:03.719726Z"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"outputs": [
|
| 43 |
+
{
|
| 44 |
+
"name": "stdout",
|
| 45 |
+
"output_type": "stream",
|
| 46 |
+
"text": [
|
| 47 |
+
"rddac 0.1.0\n",
|
| 48 |
+
"sample experiments: [0, 500, 1002, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500]\n"
|
| 49 |
+
]
|
| 50 |
+
}
|
| 51 |
+
],
|
| 52 |
+
"source": [
|
| 53 |
+
"import warnings\n",
|
| 54 |
+
"warnings.filterwarnings('ignore')\n",
|
| 55 |
+
"\n",
|
| 56 |
+
"import zipfile\n",
|
| 57 |
+
"from pathlib import Path\n",
|
| 58 |
+
"\n",
|
| 59 |
+
"import rddac\n",
|
| 60 |
+
"from rddac import RDDACDataset\n",
|
| 61 |
+
"from torch.utils.data import DataLoader\n",
|
| 62 |
+
"\n",
|
| 63 |
+
"print('rddac', rddac.__version__)\n",
|
| 64 |
+
"\n",
|
| 65 |
+
"DATA_DIR = Path('../data')\n",
|
| 66 |
+
"# DATA_DIR = Path('./data') # uncomment instead when running from the repository root\n",
|
| 67 |
+
"assert (DATA_DIR / 'metadata.json').is_file(), f'{DATA_DIR} does not contain the dataset'\n",
|
| 68 |
+
"\n",
|
| 69 |
+
"# The 18 experiments bundled in sample.zip (one per category) - a cheap allowlist for the demos below.\n",
|
| 70 |
+
"with zipfile.ZipFile(DATA_DIR / 'h5' / 'sample.zip') as zf:\n",
|
| 71 |
+
" SAMPLE_IDS = sorted(int(Path(n).stem) for n in zf.namelist() if n.endswith('.h5'))\n",
|
| 72 |
+
"print('sample experiments:', SAMPLE_IDS)"
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"cell_type": "markdown",
|
| 77 |
+
"id": "59de6163",
|
| 78 |
+
"metadata": {},
|
| 79 |
+
"source": [
|
| 80 |
+
"## 1. Construct an `RDDACDataset`\n",
|
| 81 |
+
"\n",
|
| 82 |
+
"`RDDACDataset(view, data_dir, ...)` is a `torch.utils.data.IterableDataset` that streams records of a Croissant view. At construction time it:\n",
|
| 83 |
+
"\n",
|
| 84 |
+
"1. loads the manifest (same code path as `rddac.load`),\n",
|
| 85 |
+
"2. resolves the view's fields to HDF5 paths and JSONPath transforms,\n",
|
| 86 |
+
"3. scans `data_dir` for zip files and builds an index `experiment id -> local zip path`,\n",
|
| 87 |
+
"4. reads `process_parameters.csv` and applies the optional `sim_ids` allowlist and `where` predicate.\n",
|
| 88 |
+
"\n",
|
| 89 |
+
"(The `sim_ids` argument name is kept for drop-in DDACS compatibility — for RDDAC the ids are experiment ids.) After construction it knows exactly which experiments are locally available; iteration silently skips ones whose zip is missing, so a partial download still streams whatever is on disk."
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"cell_type": "code",
|
| 94 |
+
"execution_count": 2,
|
| 95 |
+
"id": "b8ffffe3",
|
| 96 |
+
"metadata": {
|
| 97 |
+
"execution": {
|
| 98 |
+
"iopub.execute_input": "2026-07-07T09:02:03.722209Z",
|
| 99 |
+
"iopub.status.busy": "2026-07-07T09:02:03.721996Z",
|
| 100 |
+
"iopub.status.idle": "2026-07-07T09:02:03.857389Z",
|
| 101 |
+
"shell.execute_reply": "2026-07-07T09:02:03.856753Z"
|
| 102 |
+
}
|
| 103 |
+
},
|
| 104 |
+
"outputs": [
|
| 105 |
+
{
|
| 106 |
+
"name": "stdout",
|
| 107 |
+
"output_type": "stream",
|
| 108 |
+
"text": [
|
| 109 |
+
"view: force-curve\n",
|
| 110 |
+
"field specs: {'force_data': ('force/data', None)}\n",
|
| 111 |
+
"total sim_ids: 9000 (every experiment in process_parameters.csv)\n",
|
| 112 |
+
"locally indexed: 18 (only these will actually stream)\n"
|
| 113 |
+
]
|
| 114 |
+
}
|
| 115 |
+
],
|
| 116 |
+
"source": [
|
| 117 |
+
"ds_force = RDDACDataset(view='force-curve', data_dir=DATA_DIR)\n",
|
| 118 |
+
"print('view: ', ds_force.view)\n",
|
| 119 |
+
"print('field specs: ', ds_force._field_specs)\n",
|
| 120 |
+
"print('total sim_ids: ', len(ds_force._sim_ids), '(every experiment in process_parameters.csv)')\n",
|
| 121 |
+
"print('locally indexed:', len(ds_force._h5_index), '(only these will actually stream)')"
|
| 122 |
+
]
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"cell_type": "markdown",
|
| 126 |
+
"id": "4c9af18c",
|
| 127 |
+
"metadata": {},
|
| 128 |
+
"source": [
|
| 129 |
+
"## 2. Single records through a `DataLoader`\n",
|
| 130 |
+
"\n",
|
| 131 |
+
"`RDDACDataset` plugs straight into a `DataLoader` with no extra glue. One thing is specific to the *raw* experimental data though: the press was sampled until the operator stopped the recording, so `force/data` has a **per-experiment row count** (`n` differs). The default `collate_fn` stacks each field along a new batch axis and therefore needs equal shapes — with a ragged field that only works at `batch_size=1`.\n",
|
| 132 |
+
"\n",
|
| 133 |
+
"The two experiments below make the raggedness visible: `(1, 1140, 8)` vs `(1, 1141, 8)`."
|
| 134 |
+
]
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"cell_type": "code",
|
| 138 |
+
"execution_count": 3,
|
| 139 |
+
"id": "f193d080",
|
| 140 |
+
"metadata": {
|
| 141 |
+
"execution": {
|
| 142 |
+
"iopub.execute_input": "2026-07-07T09:02:03.859125Z",
|
| 143 |
+
"iopub.status.busy": "2026-07-07T09:02:03.859018Z",
|
| 144 |
+
"iopub.status.idle": "2026-07-07T09:02:04.018796Z",
|
| 145 |
+
"shell.execute_reply": "2026-07-07T09:02:04.018185Z"
|
| 146 |
+
}
|
| 147 |
+
},
|
| 148 |
+
"outputs": [
|
| 149 |
+
{
|
| 150 |
+
"name": "stdout",
|
| 151 |
+
"output_type": "stream",
|
| 152 |
+
"text": [
|
| 153 |
+
" force_data shape=(1, 1140, 8) dtype=torch.float32\n",
|
| 154 |
+
" force_data shape=(1, 720, 8) dtype=torch.float32\n"
|
| 155 |
+
]
|
| 156 |
+
}
|
| 157 |
+
],
|
| 158 |
+
"source": [
|
| 159 |
+
"loader = DataLoader(RDDACDataset(view='force-curve', data_dir=DATA_DIR, sim_ids=[0, 4500]),\n",
|
| 160 |
+
" batch_size=1, num_workers=0)\n",
|
| 161 |
+
"for batch in loader:\n",
|
| 162 |
+
" for k, v in batch.items():\n",
|
| 163 |
+
" print(f' {k:12s} shape={tuple(v.shape)} dtype={v.dtype}')"
|
| 164 |
+
]
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"cell_type": "markdown",
|
| 168 |
+
"id": "0582de03",
|
| 169 |
+
"metadata": {},
|
| 170 |
+
"source": [
|
| 171 |
+
"## 3. Fixed-shape batching via a custom view\n",
|
| 172 |
+
"\n",
|
| 173 |
+
"For real batches, give every record the same shape. The cleanest lever is a custom view that slices a **fixed window** out of the ragged table — here the first 512 rows of `force/data`, so every record is `(512, 8)`.\n",
|
| 174 |
+
"\n",
|
| 175 |
+
"To stream a view built with `rddac.add_view` through `RDDACDataset`, pass the same loaded object via the `dataset=` kwarg. Without it, `RDDACDataset.__init__` would re-parse `metadata.json` from disk and the in-memory mutation would be invisible (it would raise `ValueError: view 'force-window' not found`). With it, the constructor uses the caller's object as-is.\n",
|
| 176 |
+
"\n",
|
| 177 |
+
"`num_workers=2` demonstrates the automatic sharding: each worker gets a disjoint slice of the id list (`sim_ids[worker_id::num_workers]`), so no experiment is produced twice."
|
| 178 |
+
]
|
| 179 |
+
},
|
| 180 |
+
{
|
| 181 |
+
"cell_type": "code",
|
| 182 |
+
"execution_count": 4,
|
| 183 |
+
"id": "bc2a6bdd",
|
| 184 |
+
"metadata": {
|
| 185 |
+
"execution": {
|
| 186 |
+
"iopub.execute_input": "2026-07-07T09:02:04.020718Z",
|
| 187 |
+
"iopub.status.busy": "2026-07-07T09:02:04.020611Z",
|
| 188 |
+
"iopub.status.idle": "2026-07-07T09:02:05.323248Z",
|
| 189 |
+
"shell.execute_reply": "2026-07-07T09:02:05.322415Z"
|
| 190 |
+
}
|
| 191 |
+
},
|
| 192 |
+
"outputs": [
|
| 193 |
+
{
|
| 194 |
+
"name": "stdout",
|
| 195 |
+
"output_type": "stream",
|
| 196 |
+
"text": [
|
| 197 |
+
" batch 0: window shape=(4, 512, 8) dtype=torch.float32\n",
|
| 198 |
+
" batch 1: window shape=(4, 512, 8) dtype=torch.float32\n"
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"name": "stdout",
|
| 203 |
+
"output_type": "stream",
|
| 204 |
+
"text": [
|
| 205 |
+
" batch 2: window shape=(4, 512, 8) dtype=torch.float32\n"
|
| 206 |
+
]
|
| 207 |
+
}
|
| 208 |
+
],
|
| 209 |
+
"source": [
|
| 210 |
+
"ds_manifest = rddac.load(data_dir=DATA_DIR)\n",
|
| 211 |
+
"rddac.add_view(\n",
|
| 212 |
+
" ds_manifest,\n",
|
| 213 |
+
" 'force-window',\n",
|
| 214 |
+
" fields={\n",
|
| 215 |
+
" 'window': ('force_data', list(range(512))), # first 512 samples -> (512, 8) for every experiment\n",
|
| 216 |
+
" },\n",
|
| 217 |
+
")\n",
|
| 218 |
+
"\n",
|
| 219 |
+
"windowed = RDDACDataset(view='force-window', data_dir=DATA_DIR, dataset=ds_manifest, sim_ids=SAMPLE_IDS)\n",
|
| 220 |
+
"loader = DataLoader(windowed, batch_size=4, num_workers=2)\n",
|
| 221 |
+
"for i, batch in enumerate(loader):\n",
|
| 222 |
+
" print(f' batch {i}: window shape={tuple(batch[\"window\"].shape)} dtype={batch[\"window\"].dtype}')\n",
|
| 223 |
+
" if i >= 2:\n",
|
| 224 |
+
" break"
|
| 225 |
+
]
|
| 226 |
+
},
|
| 227 |
+
{
|
| 228 |
+
"cell_type": "markdown",
|
| 229 |
+
"id": "a5bfde27",
|
| 230 |
+
"metadata": {},
|
| 231 |
+
"source": [
|
| 232 |
+
"## 4. Filter via the Croissant manifest\n",
|
| 233 |
+
"\n",
|
| 234 |
+
"Both filters run against `process_parameters.csv` rows **before** any zip is opened, so the IO scales with the surviving experiments rather than with the full 9 000.\n",
|
| 235 |
+
"\n",
|
| 236 |
+
"The row keys are not magic: they come straight from the Croissant manifest. `metadata.json` declares `process_parameters.csv` as a `FileObject` and exposes its columns as the `process-parameters` RecordSet. `RDDACDataset` simply consumes those rows at construction time and applies the predicate before any zip is touched.\n",
|
| 237 |
+
"\n",
|
| 238 |
+
"### What `where` receives\n",
|
| 239 |
+
"\n",
|
| 240 |
+
"`RDDACDataset` reads `process_parameters.csv` with `pandas` and runs `where` once per row via `df.apply(where, axis=1)`. The `row` argument is a `pandas.Series` whose index is the CSV column names, so you can read columns with either `row['split']` or `row.split`. Values come back as native Python types (strings are `str` here, not the `bytes` that `mlcroissant` yields):\n",
|
| 241 |
+
"\n",
|
| 242 |
+
"| Column | Type | Example |\n",
|
| 243 |
+
"|--------|------|---------|\n",
|
| 244 |
+
"| `index` | `int` | `42` (the experiment id, matches the h5 filename) |\n",
|
| 245 |
+
"| `experiment_id` | `int` | `43` (1-based repetition counter within the category) |\n",
|
| 246 |
+
"| `category` | `int` | `0` ... `17` |\n",
|
| 247 |
+
"| `geometry` | `str` | `'concave'`, `'convex'` |\n",
|
| 248 |
+
"| `blankholder_force` | `int` | `100`, `300`, `500` (kN) |\n",
|
| 249 |
+
"| `mean_punch_temp` | `float` | `20.2` (degC) |\n",
|
| 250 |
+
"| `oil_type` | `str` | `'coarse'`, `'medium'`, `'fine'` |\n",
|
| 251 |
+
"| `has_pointcloud`, `has_oil` | `bool` | `True` |\n",
|
| 252 |
+
"| `split` | `str` | `'train'`, `'val'`, `'test'` |\n",
|
| 253 |
+
"\n",
|
| 254 |
+
"Any predicate returning truthy keeps the row.\n",
|
| 255 |
+
"\n",
|
| 256 |
+
"- `where=<callable>`: any function `pd.Series -> bool`.\n",
|
| 257 |
+
"- `sim_ids=[...]`: explicit allowlist of integers, applied before `where`.\n",
|
| 258 |
+
"\n",
|
| 259 |
+
"Both can be combined; the predicate is applied after the allowlist."
|
| 260 |
+
]
|
| 261 |
+
},
|
| 262 |
+
{
|
| 263 |
+
"cell_type": "code",
|
| 264 |
+
"execution_count": 5,
|
| 265 |
+
"id": "1be58721",
|
| 266 |
+
"metadata": {
|
| 267 |
+
"execution": {
|
| 268 |
+
"iopub.execute_input": "2026-07-07T09:02:05.325652Z",
|
| 269 |
+
"iopub.status.busy": "2026-07-07T09:02:05.325449Z",
|
| 270 |
+
"iopub.status.idle": "2026-07-07T09:02:05.771103Z",
|
| 271 |
+
"shell.execute_reply": "2026-07-07T09:02:05.770465Z"
|
| 272 |
+
}
|
| 273 |
+
},
|
| 274 |
+
"outputs": [
|
| 275 |
+
{
|
| 276 |
+
"name": "stdout",
|
| 277 |
+
"output_type": "stream",
|
| 278 |
+
"text": [
|
| 279 |
+
"convex-only sim_ids: 4500 (of 9000)\n",
|
| 280 |
+
"500 kN + oiled sim_ids: 2988\n"
|
| 281 |
+
]
|
| 282 |
+
},
|
| 283 |
+
{
|
| 284 |
+
"name": "stdout",
|
| 285 |
+
"output_type": "stream",
|
| 286 |
+
"text": [
|
| 287 |
+
"sim_ids=SAMPLE_IDS: 18\n"
|
| 288 |
+
]
|
| 289 |
+
}
|
| 290 |
+
],
|
| 291 |
+
"source": [
|
| 292 |
+
"convex = RDDACDataset(\n",
|
| 293 |
+
" view='force-curve',\n",
|
| 294 |
+
" data_dir=DATA_DIR,\n",
|
| 295 |
+
" where=lambda row: row['geometry'] == 'convex',\n",
|
| 296 |
+
")\n",
|
| 297 |
+
"print(f'convex-only sim_ids: {len(convex._sim_ids):>5d} (of 9000)')\n",
|
| 298 |
+
"\n",
|
| 299 |
+
"heavy_oiled = RDDACDataset(\n",
|
| 300 |
+
" view='force-curve',\n",
|
| 301 |
+
" data_dir=DATA_DIR,\n",
|
| 302 |
+
" where=lambda row: row['blankholder_force'] == 500 and row['has_oil'],\n",
|
| 303 |
+
")\n",
|
| 304 |
+
"print(f'500 kN + oiled sim_ids: {len(heavy_oiled._sim_ids):>5d}')\n",
|
| 305 |
+
"\n",
|
| 306 |
+
"ids_only = RDDACDataset(\n",
|
| 307 |
+
" view='force-curve',\n",
|
| 308 |
+
" data_dir=DATA_DIR,\n",
|
| 309 |
+
" sim_ids=SAMPLE_IDS,\n",
|
| 310 |
+
")\n",
|
| 311 |
+
"print(f'sim_ids=SAMPLE_IDS: {len(ids_only._sim_ids):>5d}')"
|
| 312 |
+
]
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"cell_type": "markdown",
|
| 316 |
+
"id": "dd491320",
|
| 317 |
+
"metadata": {},
|
| 318 |
+
"source": [
|
| 319 |
+
"## 5. Train / val / test splits\n",
|
| 320 |
+
"\n",
|
| 321 |
+
"`process_parameters.csv` ships with a `split` column whose canonical values are `'train'`, `'val'`, and `'test'`. Because the column is part of the Croissant manifest, the same `where=` predicate that filtered by geometry above works on it. Three `RDDACDataset` instances, one per split, is the fastest way to wire up a training loop without writing any custom partitioning code.\n",
|
| 322 |
+
"\n",
|
| 323 |
+
"Shuffle the train split for SGD; leave `val`/`test` deterministic for reproducible evaluation."
|
| 324 |
+
]
|
| 325 |
+
},
|
| 326 |
+
{
|
| 327 |
+
"cell_type": "code",
|
| 328 |
+
"execution_count": 6,
|
| 329 |
+
"id": "3ffc77e6",
|
| 330 |
+
"metadata": {
|
| 331 |
+
"execution": {
|
| 332 |
+
"iopub.execute_input": "2026-07-07T09:02:05.773003Z",
|
| 333 |
+
"iopub.status.busy": "2026-07-07T09:02:05.772892Z",
|
| 334 |
+
"iopub.status.idle": "2026-07-07T09:02:06.312332Z",
|
| 335 |
+
"shell.execute_reply": "2026-07-07T09:02:06.311363Z"
|
| 336 |
+
}
|
| 337 |
+
},
|
| 338 |
+
"outputs": [
|
| 339 |
+
{
|
| 340 |
+
"name": "stdout",
|
| 341 |
+
"output_type": "stream",
|
| 342 |
+
"text": [
|
| 343 |
+
"train: 7200 sim_ids (of 9000), 14 streamable now (zip on disk)\n",
|
| 344 |
+
" val: 900 sim_ids (of 9000), 2 streamable now (zip on disk)\n",
|
| 345 |
+
" test: 900 sim_ids (of 9000), 2 streamable now (zip on disk)\n"
|
| 346 |
+
]
|
| 347 |
+
}
|
| 348 |
+
],
|
| 349 |
+
"source": [
|
| 350 |
+
"splits = {}\n",
|
| 351 |
+
"for name in ('train', 'val', 'test'):\n",
|
| 352 |
+
" splits[name] = RDDACDataset(\n",
|
| 353 |
+
" view='force-curve',\n",
|
| 354 |
+
" data_dir=DATA_DIR,\n",
|
| 355 |
+
" where=lambda row, n=name: row['split'] == n,\n",
|
| 356 |
+
" shuffle=(name == 'train'),\n",
|
| 357 |
+
" seed=42,\n",
|
| 358 |
+
" )\n",
|
| 359 |
+
"\n",
|
| 360 |
+
"for name, split_ds in splits.items():\n",
|
| 361 |
+
" streamable = sum(1 for sid in split_ds._sim_ids if sid in split_ds._h5_index)\n",
|
| 362 |
+
" print(f'{name:>5s}: {len(split_ds._sim_ids):>5d} sim_ids (of 9000), {streamable:>5d} streamable now (zip on disk)')"
|
| 363 |
+
]
|
| 364 |
+
},
|
| 365 |
+
{
|
| 366 |
+
"cell_type": "markdown",
|
| 367 |
+
"id": "05a3b1d8",
|
| 368 |
+
"metadata": {},
|
| 369 |
+
"source": [
|
| 370 |
+
"## 6. Shuffle + `set_epoch`\n",
|
| 371 |
+
"\n",
|
| 372 |
+
"`shuffle=True` permutes each shard with a seed derived from `seed + epoch + shard_id`. Worker shards stay disjoint, so two workers do not produce the same experiment. Call `set_epoch(n)` once per epoch to get a different permutation each time. Without it, every epoch sees the same order, which biases optimisation.\n",
|
| 373 |
+
"\n",
|
| 374 |
+
"Records do not carry the experiment id (that is `iter_view`'s `_sim_id` extra), so the cell below fingerprints the first record of each epoch by its data sum — the changing fingerprint shows the permutation changing."
|
| 375 |
+
]
|
| 376 |
+
},
|
| 377 |
+
{
|
| 378 |
+
"cell_type": "code",
|
| 379 |
+
"execution_count": 7,
|
| 380 |
+
"id": "d441bdec",
|
| 381 |
+
"metadata": {
|
| 382 |
+
"execution": {
|
| 383 |
+
"iopub.execute_input": "2026-07-07T09:02:06.314064Z",
|
| 384 |
+
"iopub.status.busy": "2026-07-07T09:02:06.313885Z",
|
| 385 |
+
"iopub.status.idle": "2026-07-07T09:02:06.401700Z",
|
| 386 |
+
"shell.execute_reply": "2026-07-07T09:02:06.400895Z"
|
| 387 |
+
}
|
| 388 |
+
},
|
| 389 |
+
"outputs": [
|
| 390 |
+
{
|
| 391 |
+
"name": "stdout",
|
| 392 |
+
"output_type": "stream",
|
| 393 |
+
"text": [
|
| 394 |
+
"epoch 0: first record fingerprint sum= 240630.2\n",
|
| 395 |
+
"epoch 1: first record fingerprint sum= 232123.9\n",
|
| 396 |
+
"epoch 2: first record fingerprint sum= 258301.7\n"
|
| 397 |
+
]
|
| 398 |
+
}
|
| 399 |
+
],
|
| 400 |
+
"source": [
|
| 401 |
+
"ds_shuf = RDDACDataset(\n",
|
| 402 |
+
" view='force-window',\n",
|
| 403 |
+
" data_dir=DATA_DIR,\n",
|
| 404 |
+
" dataset=ds_manifest,\n",
|
| 405 |
+
" sim_ids=SAMPLE_IDS,\n",
|
| 406 |
+
" shuffle=True,\n",
|
| 407 |
+
" seed=42,\n",
|
| 408 |
+
")\n",
|
| 409 |
+
"for epoch in range(3):\n",
|
| 410 |
+
" ds_shuf.set_epoch(epoch)\n",
|
| 411 |
+
" first = next(iter(ds_shuf))\n",
|
| 412 |
+
" print(f'epoch {epoch}: first record fingerprint sum={float(first[\"window\"].sum()):>12.1f}')"
|
| 413 |
+
]
|
| 414 |
+
},
|
| 415 |
+
{
|
| 416 |
+
"cell_type": "markdown",
|
| 417 |
+
"id": "7856bb22",
|
| 418 |
+
"metadata": {},
|
| 419 |
+
"source": [
|
| 420 |
+
"## 7. Metadata columns: the `RDDACDataset` limitation\n",
|
| 421 |
+
"\n",
|
| 422 |
+
"Views that mix in `process-parameters` CSV columns (qualified `\"process-parameters/<col>\"` entries) **cannot** be streamed through `RDDACDataset`: the adapter only resolves field-map sources and raises `ValueError` at construction. Three workarounds, in order of preference:\n",
|
| 423 |
+
"\n",
|
| 424 |
+
"1. **Keep the view pure h5** — the training-relevant metadata is usually better expressed as a `where=` filter or a label lookup anyway.\n",
|
| 425 |
+
"2. **Join the metadata yourself** — `pandas.read_csv(DATA_DIR / 'process_parameters.csv')` indexed by `index` gives you labels per experiment id; combine with `sim_ids=`.\n",
|
| 426 |
+
"3. **`rddac.streaming.iter_view`** — handles mixed views (it joins the CSV internally), at the cost of doing your own batching.\n"
|
| 427 |
+
]
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"cell_type": "code",
|
| 431 |
+
"execution_count": 8,
|
| 432 |
+
"id": "1749cae0",
|
| 433 |
+
"metadata": {
|
| 434 |
+
"execution": {
|
| 435 |
+
"iopub.execute_input": "2026-07-07T09:02:06.403443Z",
|
| 436 |
+
"iopub.status.busy": "2026-07-07T09:02:06.403248Z",
|
| 437 |
+
"iopub.status.idle": "2026-07-07T09:02:06.786369Z",
|
| 438 |
+
"shell.execute_reply": "2026-07-07T09:02:06.785616Z"
|
| 439 |
+
}
|
| 440 |
+
},
|
| 441 |
+
"outputs": [
|
| 442 |
+
{
|
| 443 |
+
"name": "stdout",
|
| 444 |
+
"output_type": "stream",
|
| 445 |
+
"text": [
|
| 446 |
+
"RDDACDataset: ValueError: view field 'geometry' sources RecordSet 'process-parameters', but this dataset only streams 'field-map' (HDF5) fields. For views that include process-parameters metadata columns use streaming.iter_view, or build the view from field-map fields only.\n",
|
| 447 |
+
"iter_view: force.shape=(1140, 8) geometry='concave' blankholder_force=100 kN split='val'\n"
|
| 448 |
+
]
|
| 449 |
+
}
|
| 450 |
+
],
|
| 451 |
+
"source": [
|
| 452 |
+
"mixed = rddac.load(data_dir=DATA_DIR)\n",
|
| 453 |
+
"rddac.add_view(mixed, 'force-signals', fields={\n",
|
| 454 |
+
" 'force': 'force_data',\n",
|
| 455 |
+
" 'geometry': 'process-parameters/geometry', # CSV columns -> not RDDACDataset-compatible\n",
|
| 456 |
+
" 'blankholder_force': 'process-parameters/blankholder_force',\n",
|
| 457 |
+
" 'split': 'process-parameters/split',\n",
|
| 458 |
+
"})\n",
|
| 459 |
+
"\n",
|
| 460 |
+
"try:\n",
|
| 461 |
+
" RDDACDataset(view='force-signals', data_dir=DATA_DIR, dataset=mixed)\n",
|
| 462 |
+
"except ValueError as e:\n",
|
| 463 |
+
" print(f'RDDACDataset: ValueError: {e}')\n",
|
| 464 |
+
"\n",
|
| 465 |
+
"# Workaround 3: iter_view streams the mixed view without complaint.\n",
|
| 466 |
+
"for rec in rddac.streaming.iter_view('force-signals', data_dir=DATA_DIR, dataset=mixed, sim_ids=[0]):\n",
|
| 467 |
+
" print(f\"iter_view: force.shape={rec['force'].shape} geometry={rec['geometry']!r} \"\n",
|
| 468 |
+
" f\"blankholder_force={rec['blankholder_force']} kN split={rec['split']!r}\")"
|
| 469 |
+
]
|
| 470 |
+
},
|
| 471 |
+
{
|
| 472 |
+
"cell_type": "markdown",
|
| 473 |
+
"id": "694b20ad",
|
| 474 |
+
"metadata": {},
|
| 475 |
+
"source": [
|
| 476 |
+
"## 8. Training-loop skeleton\n",
|
| 477 |
+
"\n",
|
| 478 |
+
"Everything above composes into the usual PyTorch loop. The toy task: predict the **peak total press force** from the first 512 samples of the four load cells — input `(512, 4)`, target a scalar, both cut from the same `force-window` view so no metadata join is needed. This is a skeleton, not an experiment: 18 experiments, no validation, three epochs, and the raw kN scale is left unnormalised — expect the loss to be large and noisy. The point is the wiring:\n",
|
| 479 |
+
"\n",
|
| 480 |
+
"- `set_epoch(epoch)` before each pass so the shuffle reseeds,\n",
|
| 481 |
+
"- fields arrive as a dict of tensors; slice columns inside the step,\n",
|
| 482 |
+
"- swap `SAMPLE_IDS` for `where=lambda r: r['split'] == 'train'` to scale the same loop to the full release."
|
| 483 |
+
]
|
| 484 |
+
},
|
| 485 |
+
{
|
| 486 |
+
"cell_type": "code",
|
| 487 |
+
"execution_count": 9,
|
| 488 |
+
"id": "fb9b87ba",
|
| 489 |
+
"metadata": {
|
| 490 |
+
"execution": {
|
| 491 |
+
"iopub.execute_input": "2026-07-07T09:02:06.788006Z",
|
| 492 |
+
"iopub.status.busy": "2026-07-07T09:02:06.787832Z",
|
| 493 |
+
"iopub.status.idle": "2026-07-07T09:02:11.576439Z",
|
| 494 |
+
"shell.execute_reply": "2026-07-07T09:02:11.575328Z"
|
| 495 |
+
}
|
| 496 |
+
},
|
| 497 |
+
"outputs": [
|
| 498 |
+
{
|
| 499 |
+
"name": "stdout",
|
| 500 |
+
"output_type": "stream",
|
| 501 |
+
"text": [
|
| 502 |
+
"epoch 0: mean MSE loss = 103331.1 (raw kN^2 scale, illustrative only)\n"
|
| 503 |
+
]
|
| 504 |
+
},
|
| 505 |
+
{
|
| 506 |
+
"name": "stdout",
|
| 507 |
+
"output_type": "stream",
|
| 508 |
+
"text": [
|
| 509 |
+
"epoch 1: mean MSE loss = 33068.9 (raw kN^2 scale, illustrative only)\n"
|
| 510 |
+
]
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"name": "stdout",
|
| 514 |
+
"output_type": "stream",
|
| 515 |
+
"text": [
|
| 516 |
+
"epoch 2: mean MSE loss = 11153.1 (raw kN^2 scale, illustrative only)\n"
|
| 517 |
+
]
|
| 518 |
+
}
|
| 519 |
+
],
|
| 520 |
+
"source": [
|
| 521 |
+
"import torch\n",
|
| 522 |
+
"import torch.nn as nn\n",
|
| 523 |
+
"\n",
|
| 524 |
+
"train_ds = RDDACDataset(view='force-window', data_dir=DATA_DIR, dataset=ds_manifest,\n",
|
| 525 |
+
" sim_ids=SAMPLE_IDS, shuffle=True, seed=0)\n",
|
| 526 |
+
"train_loader = DataLoader(train_ds, batch_size=4, num_workers=0)\n",
|
| 527 |
+
"\n",
|
| 528 |
+
"model = nn.Sequential(nn.Flatten(), nn.Linear(512 * 4, 64), nn.ReLU(), nn.Linear(64, 1))\n",
|
| 529 |
+
"optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)\n",
|
| 530 |
+
"loss_fn = nn.MSELoss()\n",
|
| 531 |
+
"\n",
|
| 532 |
+
"for epoch in range(3):\n",
|
| 533 |
+
" train_ds.set_epoch(epoch)\n",
|
| 534 |
+
" total, batches = 0.0, 0\n",
|
| 535 |
+
" for batch in train_loader:\n",
|
| 536 |
+
" window = batch['window'] # (B, 512, 8) float32\n",
|
| 537 |
+
" x = window[:, :, 1:5] # the four load cells -> (B, 512, 4)\n",
|
| 538 |
+
" y = window[:, :, 7].amax(dim=1, keepdim=True) # peak total force [kN] -> (B, 1)\n",
|
| 539 |
+
" optimizer.zero_grad()\n",
|
| 540 |
+
" loss = loss_fn(model(x), y)\n",
|
| 541 |
+
" loss.backward()\n",
|
| 542 |
+
" optimizer.step()\n",
|
| 543 |
+
" total, batches = total + loss.item(), batches + 1\n",
|
| 544 |
+
" print(f'epoch {epoch}: mean MSE loss = {total / batches:.1f} (raw kN^2 scale, illustrative only)')"
|
| 545 |
+
]
|
| 546 |
+
}
|
| 547 |
+
],
|
| 548 |
+
"metadata": {
|
| 549 |
+
"kernelspec": {
|
| 550 |
+
"display_name": "Python 3 (ipykernel)",
|
| 551 |
+
"language": "python",
|
| 552 |
+
"name": "python3"
|
| 553 |
+
},
|
| 554 |
+
"language_info": {
|
| 555 |
+
"codemirror_mode": {
|
| 556 |
+
"name": "ipython",
|
| 557 |
+
"version": 3
|
| 558 |
+
},
|
| 559 |
+
"file_extension": ".py",
|
| 560 |
+
"mimetype": "text/x-python",
|
| 561 |
+
"name": "python",
|
| 562 |
+
"nbconvert_exporter": "python",
|
| 563 |
+
"pygments_lexer": "ipython3",
|
| 564 |
+
"version": "3.11.14"
|
| 565 |
+
}
|
| 566 |
+
},
|
| 567 |
+
"nbformat": 4,
|
| 568 |
+
"nbformat_minor": 5
|
| 569 |
+
}
|
notebooks/04_visualization.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/05_loose_h5.ipynb
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "9bbc94a2",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# Loose HDF5 recipe\n",
|
| 9 |
+
"\n",
|
| 10 |
+
"Companion notebook for the RDDAC [documentation](https://rddac.readthedocs.io). It is written to stand on its own: every step is annotated so the notebook reads top to bottom.\n",
|
| 11 |
+
"\n",
|
| 12 |
+
"## Walkthrough\n",
|
| 13 |
+
"\n",
|
| 14 |
+
"1. the `rddac download --extract --remove-zip` workflow that leaves loose `.h5` files on disk,\n",
|
| 15 |
+
"2. simulate it here by extracting three members of `sample.zip` into a throwaway directory,\n",
|
| 16 |
+
"3. inspect the loose layout,\n",
|
| 17 |
+
"4. read `process_parameters.csv` with pandas and filter the rows of interest,\n",
|
| 18 |
+
"5. open each loose `.h5` directly with `h5py`,\n",
|
| 19 |
+
"6. stream the loose layout with `rddac.streaming.iter_view` (this works — unlike the zip-only manifest path).\n",
|
| 20 |
+
"\n",
|
| 21 |
+
"## Assumptions\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"- This notebook writes a throwaway copy into the system temp directory; the project-local `../data` stays untouched.\n",
|
| 24 |
+
"- `rddac.open_h5` and `RDDACDataset` walk the **zips** referenced by the manifest. Once `--remove-zip` deletes them, those two are gone for the extracted experiments — but `rddac.streaming.iter_view` recognises loose files natively (a deliberate difference from `ddacs`), so the view machinery keeps working."
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"cell_type": "code",
|
| 29 |
+
"execution_count": 1,
|
| 30 |
+
"id": "15a888aa",
|
| 31 |
+
"metadata": {
|
| 32 |
+
"execution": {
|
| 33 |
+
"iopub.execute_input": "2026-07-06T12:50:54.717372Z",
|
| 34 |
+
"iopub.status.busy": "2026-07-06T12:50:54.717230Z",
|
| 35 |
+
"iopub.status.idle": "2026-07-06T12:50:56.471033Z",
|
| 36 |
+
"shell.execute_reply": "2026-07-06T12:50:56.470389Z"
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"outputs": [
|
| 40 |
+
{
|
| 41 |
+
"name": "stdout",
|
| 42 |
+
"output_type": "stream",
|
| 43 |
+
"text": [
|
| 44 |
+
"rddac 0.1.0\n",
|
| 45 |
+
"loose layout goes to: /tmp/rddac_loose_w6y5flzl\n"
|
| 46 |
+
]
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"source": [
|
| 50 |
+
"import warnings\n",
|
| 51 |
+
"warnings.filterwarnings('ignore')\n",
|
| 52 |
+
"\n",
|
| 53 |
+
"import shutil\n",
|
| 54 |
+
"import tempfile\n",
|
| 55 |
+
"import zipfile\n",
|
| 56 |
+
"from pathlib import Path\n",
|
| 57 |
+
"\n",
|
| 58 |
+
"import h5py\n",
|
| 59 |
+
"import numpy as np\n",
|
| 60 |
+
"import pandas as pd\n",
|
| 61 |
+
"\n",
|
| 62 |
+
"import rddac\n",
|
| 63 |
+
"print('rddac', rddac.__version__)\n",
|
| 64 |
+
"\n",
|
| 65 |
+
"DATA_DIR = Path('../data')\n",
|
| 66 |
+
"# DATA_DIR = Path('./data') # uncomment instead when running from the repository root\n",
|
| 67 |
+
"assert (DATA_DIR / 'metadata.json').is_file(), f'{DATA_DIR} does not contain the dataset'\n",
|
| 68 |
+
"LOOSE_DIR = Path(tempfile.mkdtemp(prefix='rddac_loose_'))\n",
|
| 69 |
+
"print('loose layout goes to:', LOOSE_DIR)"
|
| 70 |
+
]
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"cell_type": "markdown",
|
| 74 |
+
"id": "94651cc5",
|
| 75 |
+
"metadata": {},
|
| 76 |
+
"source": [
|
| 77 |
+
"## 1. Download with extract + remove\n",
|
| 78 |
+
"\n",
|
| 79 |
+
"`rddac download --extract --remove-zip` fetches the bundle, unzips each archive next to the zip, and deletes the zip on success. The result is a directory of loose `NNNN.h5` files instead of `.zip` archives. Run this once from a shell:\n",
|
| 80 |
+
"\n",
|
| 81 |
+
"```bash\n",
|
| 82 |
+
"rddac download --small --extract --remove-zip --out ./data -y\n",
|
| 83 |
+
"```\n",
|
| 84 |
+
"\n",
|
| 85 |
+
"The zip members sit at the archive root, so extraction leaves the `.h5` files directly beside `metadata.json` and `process_parameters.csv`. (`rddac.streaming` also recognises an `h5/` subdirectory if you prefer to tidy them away.)\n",
|
| 86 |
+
"\n",
|
| 87 |
+
"The dataset is already on disk in this repository, so instead of re-downloading, the next cell **simulates** the workflow: it extracts three members of `sample.zip` into the throwaway directory and copies the two index files alongside — byte-for-byte the layout the CLI command produces."
|
| 88 |
+
]
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"cell_type": "code",
|
| 92 |
+
"execution_count": 2,
|
| 93 |
+
"id": "8eb7962d",
|
| 94 |
+
"metadata": {
|
| 95 |
+
"execution": {
|
| 96 |
+
"iopub.execute_input": "2026-07-06T12:50:56.473126Z",
|
| 97 |
+
"iopub.status.busy": "2026-07-06T12:50:56.472916Z",
|
| 98 |
+
"iopub.status.idle": "2026-07-06T12:50:56.511143Z",
|
| 99 |
+
"shell.execute_reply": "2026-07-06T12:50:56.510524Z"
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
"outputs": [
|
| 103 |
+
{
|
| 104 |
+
"name": "stdout",
|
| 105 |
+
"output_type": "stream",
|
| 106 |
+
"text": [
|
| 107 |
+
"extracted ['0000.h5', '0500.h5', '1002.h5']\n"
|
| 108 |
+
]
|
| 109 |
+
}
|
| 110 |
+
],
|
| 111 |
+
"source": [
|
| 112 |
+
"members = ['0000.h5', '0500.h5', '1002.h5']\n",
|
| 113 |
+
"with zipfile.ZipFile(DATA_DIR / 'h5' / 'sample.zip') as zf:\n",
|
| 114 |
+
" for name in members:\n",
|
| 115 |
+
" zf.extract(name, LOOSE_DIR)\n",
|
| 116 |
+
"\n",
|
| 117 |
+
"shutil.copy(DATA_DIR / 'process_parameters.csv', LOOSE_DIR)\n",
|
| 118 |
+
"shutil.copy(DATA_DIR / 'metadata.json', LOOSE_DIR)\n",
|
| 119 |
+
"print('extracted', members)"
|
| 120 |
+
]
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"cell_type": "markdown",
|
| 124 |
+
"id": "2bd1d7f9",
|
| 125 |
+
"metadata": {},
|
| 126 |
+
"source": [
|
| 127 |
+
"## 2. Inspect the loose layout\n",
|
| 128 |
+
"\n",
|
| 129 |
+
"After extraction, `metadata.json` and `process_parameters.csv` sit at the root next to the loose experiment files."
|
| 130 |
+
]
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"cell_type": "code",
|
| 134 |
+
"execution_count": 3,
|
| 135 |
+
"id": "dc1a4129",
|
| 136 |
+
"metadata": {
|
| 137 |
+
"execution": {
|
| 138 |
+
"iopub.execute_input": "2026-07-06T12:50:56.512984Z",
|
| 139 |
+
"iopub.status.busy": "2026-07-06T12:50:56.512881Z",
|
| 140 |
+
"iopub.status.idle": "2026-07-06T12:50:56.515733Z",
|
| 141 |
+
"shell.execute_reply": "2026-07-06T12:50:56.515155Z"
|
| 142 |
+
}
|
| 143 |
+
},
|
| 144 |
+
"outputs": [
|
| 145 |
+
{
|
| 146 |
+
"name": "stdout",
|
| 147 |
+
"output_type": "stream",
|
| 148 |
+
"text": [
|
| 149 |
+
" 0000.h5 10.0 MB\n",
|
| 150 |
+
" 0500.h5 10.0 MB\n",
|
| 151 |
+
" 1002.h5 10.0 MB\n",
|
| 152 |
+
" metadata.json 0.0 MB\n",
|
| 153 |
+
" process_parameters.csv 0.4 MB\n"
|
| 154 |
+
]
|
| 155 |
+
}
|
| 156 |
+
],
|
| 157 |
+
"source": [
|
| 158 |
+
"for entry in sorted(LOOSE_DIR.iterdir()):\n",
|
| 159 |
+
" size_mb = entry.stat().st_size / 1e6\n",
|
| 160 |
+
" print(f' {entry.name:28s} {size_mb:8.1f} MB')"
|
| 161 |
+
]
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"cell_type": "markdown",
|
| 165 |
+
"id": "9951a844",
|
| 166 |
+
"metadata": {},
|
| 167 |
+
"source": [
|
| 168 |
+
"## 3. Read `process_parameters.csv` with pandas\n",
|
| 169 |
+
"\n",
|
| 170 |
+
"The CSV is the experiment index: one row per experiment id, with every process parameter exposed as a named column. Filter it in pandas before touching any HDF5 file."
|
| 171 |
+
]
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"cell_type": "code",
|
| 175 |
+
"execution_count": 4,
|
| 176 |
+
"id": "2eb84796",
|
| 177 |
+
"metadata": {
|
| 178 |
+
"execution": {
|
| 179 |
+
"iopub.execute_input": "2026-07-06T12:50:56.517430Z",
|
| 180 |
+
"iopub.status.busy": "2026-07-06T12:50:56.517334Z",
|
| 181 |
+
"iopub.status.idle": "2026-07-06T12:50:56.529868Z",
|
| 182 |
+
"shell.execute_reply": "2026-07-06T12:50:56.529240Z"
|
| 183 |
+
}
|
| 184 |
+
},
|
| 185 |
+
"outputs": [
|
| 186 |
+
{
|
| 187 |
+
"name": "stdout",
|
| 188 |
+
"output_type": "stream",
|
| 189 |
+
"text": [
|
| 190 |
+
"rows: 9000, columns: ['index', 'experiment_id', 'category', 'geometry', 'blankholder_force', 'mean_punch_temp', 'oil_type', 'has_pointcloud', 'has_oil', 'split']\n",
|
| 191 |
+
"\n",
|
| 192 |
+
" index experiment_id category geometry blankholder_force mean_punch_temp oil_type has_pointcloud has_oil split\n",
|
| 193 |
+
"0 0 1 0 concave 100 20.2 coarse True True val\n",
|
| 194 |
+
"1 1 2 0 concave 100 20.3 coarse True True train\n",
|
| 195 |
+
"2 2 3 0 concave 100 20.4 coarse True True val\n"
|
| 196 |
+
]
|
| 197 |
+
}
|
| 198 |
+
],
|
| 199 |
+
"source": [
|
| 200 |
+
"params = pd.read_csv(LOOSE_DIR / 'process_parameters.csv')\n",
|
| 201 |
+
"print(f'rows: {len(params)}, columns: {list(params.columns)}')\n",
|
| 202 |
+
"print()\n",
|
| 203 |
+
"print(params.head(3).to_string())"
|
| 204 |
+
]
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"cell_type": "markdown",
|
| 208 |
+
"id": "637767a7",
|
| 209 |
+
"metadata": {},
|
| 210 |
+
"source": [
|
| 211 |
+
"## 4. Iterate the loose files with `h5py`\n",
|
| 212 |
+
"\n",
|
| 213 |
+
"Walk the (filtered) rows, build the zero-padded path, skip experiments whose `.h5` is missing locally, and open each one with `h5py.File`. Below: take the concave subset, then read the sheet-thickness traverse from every loose file that landed on disk. The raw traverse contains negative sensor-error spikes, so the summary masks `value <= 0` first (see the visualization notebook). With three extracted files the loop yields three lines."
|
| 214 |
+
]
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
"cell_type": "code",
|
| 218 |
+
"execution_count": 5,
|
| 219 |
+
"id": "040f1a48",
|
| 220 |
+
"metadata": {
|
| 221 |
+
"execution": {
|
| 222 |
+
"iopub.execute_input": "2026-07-06T12:50:56.531678Z",
|
| 223 |
+
"iopub.status.busy": "2026-07-06T12:50:56.531577Z",
|
| 224 |
+
"iopub.status.idle": "2026-07-06T12:50:56.698366Z",
|
| 225 |
+
"shell.execute_reply": "2026-07-06T12:50:56.697749Z"
|
| 226 |
+
}
|
| 227 |
+
},
|
| 228 |
+
"outputs": [
|
| 229 |
+
{
|
| 230 |
+
"name": "stdout",
|
| 231 |
+
"output_type": "stream",
|
| 232 |
+
"text": [
|
| 233 |
+
"concave experiments in CSV: 4500 of 9000\n",
|
| 234 |
+
" experiment 0 oil_type=coarse sheet thickness 985.9 - 1000.4 um (206 valid samples)\n",
|
| 235 |
+
" experiment 500 oil_type=fine sheet thickness 950.1 - 988.7 um (206 valid samples)\n",
|
| 236 |
+
" experiment 1002 oil_type=medium sheet thickness 983.2 - 998.4 um (206 valid samples)\n"
|
| 237 |
+
]
|
| 238 |
+
},
|
| 239 |
+
{
|
| 240 |
+
"name": "stdout",
|
| 241 |
+
"output_type": "stream",
|
| 242 |
+
"text": [
|
| 243 |
+
"\n",
|
| 244 |
+
"opened 3 loose h5 file(s)\n"
|
| 245 |
+
]
|
| 246 |
+
}
|
| 247 |
+
],
|
| 248 |
+
"source": [
|
| 249 |
+
"concave = params.query(\"geometry == 'concave'\")\n",
|
| 250 |
+
"print(f'concave experiments in CSV: {len(concave):>5d} of {len(params)}')\n",
|
| 251 |
+
"\n",
|
| 252 |
+
"found = 0\n",
|
| 253 |
+
"for _, row in concave.iterrows():\n",
|
| 254 |
+
" h5_path = LOOSE_DIR / f\"{row['index']:04d}.h5\"\n",
|
| 255 |
+
" if not h5_path.is_file():\n",
|
| 256 |
+
" continue\n",
|
| 257 |
+
" with h5py.File(h5_path, 'r') as f:\n",
|
| 258 |
+
" thickness = f['sheet_thickness/data'][:]\n",
|
| 259 |
+
" valid = thickness[thickness[:, 1] > 0, 1]\n",
|
| 260 |
+
" print(f\" experiment {row['index']:>4d} oil_type={row['oil_type']:<7s} \"\n",
|
| 261 |
+
" f\"sheet thickness {valid.min():7.1f} - {valid.max():7.1f} um ({len(valid)} valid samples)\")\n",
|
| 262 |
+
" found += 1\n",
|
| 263 |
+
"print(f'\\nopened {found} loose h5 file(s)')"
|
| 264 |
+
]
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"cell_type": "markdown",
|
| 268 |
+
"id": "c86a5447",
|
| 269 |
+
"metadata": {},
|
| 270 |
+
"source": [
|
| 271 |
+
"## 5. Stream the loose layout with `iter_view`\n",
|
| 272 |
+
"\n",
|
| 273 |
+
"`rddac.streaming.iter_view` builds a unified index at startup that recognises **both** loose `NNNN.h5` files (at the data-dir root or under `h5/`) and zipped archives — preferring loose files when both exist, because direct `h5py` reads skip the per-record `BytesIO` round trip. Pointing `data_dir` at the loose directory is therefore all it takes; views, slicing, `where=` filters, and the numpy export from the streaming notebook keep working unchanged.\n",
|
| 274 |
+
"\n",
|
| 275 |
+
"The zip-backed single-file helper does *not* survive the transition: `rddac.open_h5` walks the manifest-mapped zips only, so on this directory it raises `FileNotFoundError` — reach for `h5py.File(path)` directly instead (step 4), the file name is just the zero-padded experiment id."
|
| 276 |
+
]
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"cell_type": "code",
|
| 280 |
+
"execution_count": 6,
|
| 281 |
+
"id": "d8443bbf",
|
| 282 |
+
"metadata": {
|
| 283 |
+
"execution": {
|
| 284 |
+
"iopub.execute_input": "2026-07-06T12:50:56.700220Z",
|
| 285 |
+
"iopub.status.busy": "2026-07-06T12:50:56.700118Z",
|
| 286 |
+
"iopub.status.idle": "2026-07-06T12:50:56.947223Z",
|
| 287 |
+
"shell.execute_reply": "2026-07-06T12:50:56.946651Z"
|
| 288 |
+
}
|
| 289 |
+
},
|
| 290 |
+
"outputs": [
|
| 291 |
+
{
|
| 292 |
+
"name": "stdout",
|
| 293 |
+
"output_type": "stream",
|
| 294 |
+
"text": [
|
| 295 |
+
" experiment 0: force_data shape=(1140, 8)\n",
|
| 296 |
+
" experiment 500: force_data shape=(1140, 8)\n",
|
| 297 |
+
" experiment 1002: force_data shape=(1140, 8)\n",
|
| 298 |
+
"\n",
|
| 299 |
+
"open_h5 on the loose layout: FileNotFoundError: 0000.h5 not found in any locally mapped zip under PosixPath('/tmp/rddac_loose_w6...\n"
|
| 300 |
+
]
|
| 301 |
+
}
|
| 302 |
+
],
|
| 303 |
+
"source": [
|
| 304 |
+
"for rec in rddac.streaming.iter_view('force-curve', data_dir=LOOSE_DIR):\n",
|
| 305 |
+
" print(f\" experiment {rec['_sim_id']:>4d}: force_data shape={rec['force_data'].shape}\")\n",
|
| 306 |
+
"\n",
|
| 307 |
+
"try:\n",
|
| 308 |
+
" rddac.open_h5(0, data_dir=LOOSE_DIR)\n",
|
| 309 |
+
"except FileNotFoundError as e:\n",
|
| 310 |
+
" print(f'\\nopen_h5 on the loose layout: FileNotFoundError: {str(e)[:80]}...')"
|
| 311 |
+
]
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"cell_type": "markdown",
|
| 315 |
+
"id": "bc5a3c38",
|
| 316 |
+
"metadata": {},
|
| 317 |
+
"source": [
|
| 318 |
+
"## 6. Clean up\n",
|
| 319 |
+
"\n",
|
| 320 |
+
"The loose copy was a demonstration artifact; remove it so repeated runs start fresh."
|
| 321 |
+
]
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"cell_type": "code",
|
| 325 |
+
"execution_count": 7,
|
| 326 |
+
"id": "5a1801f1",
|
| 327 |
+
"metadata": {
|
| 328 |
+
"execution": {
|
| 329 |
+
"iopub.execute_input": "2026-07-06T12:50:56.949016Z",
|
| 330 |
+
"iopub.status.busy": "2026-07-06T12:50:56.948915Z",
|
| 331 |
+
"iopub.status.idle": "2026-07-06T12:50:56.955859Z",
|
| 332 |
+
"shell.execute_reply": "2026-07-06T12:50:56.955169Z"
|
| 333 |
+
}
|
| 334 |
+
},
|
| 335 |
+
"outputs": [
|
| 336 |
+
{
|
| 337 |
+
"name": "stdout",
|
| 338 |
+
"output_type": "stream",
|
| 339 |
+
"text": [
|
| 340 |
+
"removed /tmp/rddac_loose_w6y5flzl\n"
|
| 341 |
+
]
|
| 342 |
+
}
|
| 343 |
+
],
|
| 344 |
+
"source": [
|
| 345 |
+
"shutil.rmtree(LOOSE_DIR)\n",
|
| 346 |
+
"print('removed', LOOSE_DIR)"
|
| 347 |
+
]
|
| 348 |
+
}
|
| 349 |
+
],
|
| 350 |
+
"metadata": {
|
| 351 |
+
"kernelspec": {
|
| 352 |
+
"display_name": "Python 3 (ipykernel)",
|
| 353 |
+
"language": "python",
|
| 354 |
+
"name": "python3"
|
| 355 |
+
},
|
| 356 |
+
"language_info": {
|
| 357 |
+
"codemirror_mode": {
|
| 358 |
+
"name": "ipython",
|
| 359 |
+
"version": 3
|
| 360 |
+
},
|
| 361 |
+
"file_extension": ".py",
|
| 362 |
+
"mimetype": "text/x-python",
|
| 363 |
+
"name": "python",
|
| 364 |
+
"nbconvert_exporter": "python",
|
| 365 |
+
"pygments_lexer": "ipython3",
|
| 366 |
+
"version": "3.11.14"
|
| 367 |
+
}
|
| 368 |
+
},
|
| 369 |
+
"nbformat": 4,
|
| 370 |
+
"nbformat_minor": 5
|
| 371 |
+
}
|
notebooks/06_streaming.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RDDAC notebooks
|
| 2 |
+
|
| 3 |
+
Six end-to-end Jupyter notebooks that companion the [online documentation](https://rddac.readthedocs.io). Each notebook is self-contained: it opens with a Walkthrough list and the Assumptions it relies on, then walks through the topic step by step. Reading top to bottom is the intended flow.
|
| 4 |
+
|
| 5 |
+
RDDAC is the experimental counterpart to the [DDACS](https://ddacs.readthedocs.io) simulation dataset, and the `rddac` package mirrors the `ddacs` API 1:1 — these notebooks mirror the DDACS notebook series the same way.
|
| 6 |
+
|
| 7 |
+
## Prerequisites
|
| 8 |
+
|
| 9 |
+
```bash
|
| 10 |
+
# Install the package + the PyTorch extra (needed for 03_pytorch.ipynb).
|
| 11 |
+
pip install 'rddac[torch]'
|
| 12 |
+
|
| 13 |
+
# Fetch the small sample bundle once. Writes metadata.json,
|
| 14 |
+
# process_parameters.csv, and one sample zip with 18 experiments
|
| 15 |
+
# (one per category) into ./data.
|
| 16 |
+
rddac download --small -y
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
The full release (`rddac download`, ~87 GB) additionally fetches the matching DDACS simulations into `./data/simulation/`; the notebooks only need the small bundle. Notebooks 05 and 06 write throwaway artifacts into the system temp directory and clean up after themselves, so the data directory stays untouched.
|
| 20 |
+
|
| 21 |
+
## Run
|
| 22 |
+
|
| 23 |
+
From the repository root:
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
jupyter lab notebooks/
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
Inside each notebook the data directory is hard-coded as `DATA_DIR = '../data'` because the notebooks live in `notebooks/` while the data sits at the repo root (adjust to `'../data'` if you downloaded with the default `rddac download` output directory).
|
| 30 |
+
|
| 31 |
+
## Index
|
| 32 |
+
|
| 33 |
+
| Notebook | What it covers |
|
| 34 |
+
|----------|----------------|
|
| 35 |
+
| [`01_getting_started.ipynb`](01_getting_started.ipynb) | Install, download, `rddac.load`, iterate one record of the experiment index, open one HDF5 file with `rddac.open_h5` + `inspect_h5`, render the OP10 laser scan as a height image. |
|
| 36 |
+
| [`02_views.ipynb`](02_views.ipynb) | The `field-map` lookup table, appending a custom `RecordSet` with `rddac.add_view` (whole fields, index slicing, `process-parameters` CSV columns), inspecting the resolved transforms, streaming with `rddac.streaming.iter_view`. |
|
| 37 |
+
| [`03_pytorch.ipynb`](03_pytorch.ipynb) | Build an `RDDACDataset`, stream ragged records at `batch_size=1`, batch properly via a fixed-shape custom view + `dataset=`, filter by manifest columns and `sim_ids`, canonical train/val/test splits, shuffle with `set_epoch`, the metadata-column limitation and its workarounds, and a minimal training-loop skeleton. |
|
| 38 |
+
| [`04_visualization.ipynb`](04_visualization.ipynb) | OP10 vs OP20 height scans with `plot_scan`, the luminescence channel, `scan_to_pointcloud` + `plot_point_cloud`, press signals with `plot_force`, and the sheet-thickness / oil-film traverses with `plot_traverse` (including masking the raw sensor spikes). |
|
| 39 |
+
| [`05_loose_h5.ipynb`](05_loose_h5.ipynb) | The post-`--extract --remove-zip` workflow: inspect the loose layout, filter `process_parameters.csv` with pandas, open loose `.h5` files directly with `h5py`, and stream the loose layout with `rddac.streaming.iter_view`. |
|
| 40 |
+
| [`06_streaming.ipynb`](06_streaming.ipynb) | `rddac.streaming.iter_view` in depth (`where=`, `sim_ids=`, `dataset=`), `export_to_numpy` with `transforms` + `record_transform` on a fixed-shape scan-profile view, `load_export` + `by_sim_id`, back-to-back timing of the streaming vs memmap paths, and `export_to_numpy_per_sim` for ragged fields. |
|
| 41 |
+
|
| 42 |
+
If any of these fail to run end to end after `rddac download --small`, please open an [issue](https://github.com/BaumSebastian/RDDAC/issues) so we can fix the discrepancy with the docs.
|
rddac_documentation.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:932842c3e87b99406761f9acb4fe8ecdd7a77bdf1f89c1ac4f0c77627c7c5cfa
|
| 3 |
+
size 685509
|