跳到正文
FunCoding

load-3w-dataset

Load, filter and inspect 3W Dataset instances (Parquet files of offshore oil well time series) with ThreeWToolkit's ParquetDataset, including event classes, sources (real, simulated, drawn), variables and transient labels. Use when writing code, analyses or notebooks that read the 3W Dataset.

Star
555
分类
数据
许可证
Apache-2.0
最近提交
2026年11月29日

.claude/skills/load-3w-dataset/SKILL.md

在 GitHub 上查看

Load the 3W Dataset

Dataset facts

  • Location: dataset/<label>/<source>_<id>.parquet, 2228 files in version 2.0.0. Metadata lives in dataset/dataset.ini.

  • Folder = event label:

    LabelEventTransient
    0Normal operation–
    1Abrupt increase of BSWyes
    2Spurious closure of DHSVyes
    3Severe sluggingno
    4Flow instabilityno
    5Rapid productivity lossyes
    6Quick restriction in PCKyes
    7Scaling in PCKyes
    8Hydrate in production lineyes
    9Hydrate in service lineyes
  • Source from the filename prefix: WELL- (real), SIMULATED_, DRAWN_ (hand-drawn).

  • Each file: timestamp index (1 s sampling), float sensor columns, plus class (per-observation label) and state (operational status), both pandas nullable integers that may contain <NA>. In class, 0 marks normal periods, label + 100 the transient period before the event is established (TRANSIENT_OFFSET = 100), and label the steady event.

  • Variables (units in dataset.ini): pressures in Pa (P-PDG, P-TPT, P-MON-CKP, ...), temperatures in °C (T-TPT, T-JUS-CKP, ...), flow rates in m³/s (QGL, QBS), choke openings in % (ABER-CKP, ABER-CKGL) and valve states in {0, 0.5, 1} (ESTADO-*, categorical). Not every instance has every variable, and many columns can be all-NaN.

Loading with the toolkit

from ThreeWToolkit.dataset import ParquetDatasetConfig

ds = ParquetDatasetConfig(
    path="dataset",                 # repo dataset folder or a download path
    target_class=[0, 4],            # list of labels; None loads all
    event_type=["real"],            # "real", "simulated", "drawn"; None = all
    columns=["P-PDG", "P-TPT", "T-TPT"],  # None loads every signal column
    target_column="class",          # None keeps `class` inside `signal`
).build()

print(len(ds))                      # number of instances
event = ds[0]                       # DatasetOutputs
event.signal                        # pandas DataFrame of variables
event.label                         # pandas Series from `class`
event.metadata                      # file_name, event_class, event_type
  • path must contain the full dataset. If the expected number of Parquet files is not found, the loader downloads it from Figshare (about 1.8 GB) into path. Do not trigger this in unit tests.
  • force_download=True deletes and re-downloads path. Never point it at the repository's dataset/ folder.
  • split only supports None or "list" (with file_list of paths relative to path, e.g. "4/WELL-00001_20170316110203.parquet"); train, val and test splits are not implemented. Use utils.data_splitter for splitting.
  • Iterating (for event in ds) loads files lazily, one at a time. Avoid materializing all instances in memory unless needed.
  • For clustering, ds.load_instances_by_variable(["P-PDG"]) returns {variable: [np.ndarray, ...]}.

Common next steps

  • Clean and normalize with ThreeWToolkit.preprocessing (CleanSignals, ImputeMissing, Normalize, FillLabels, RemapClass).
  • Apply a transform to a whole dataset lazily with TransformedDataset(ds, step.transform) from ThreeWToolkit.dataset.
  • Plot with ThreeWToolkit.data_visualization (e.g. the 3W chart).
  • See toolkit/demos/01_dataset_examples.ipynb and dataset/demos/_basic/main.ipynb for complete examples.

Rules

  • Treat files under dataset/ as read-only (CC BY 4.0 data, versioned separately). Write derived data to ignored folders such as output/ or processed_data/.
  • In tests, use mock_dataset_factory from tests/conftest.py instead of real files, or mark the test @pytest.mark.slow.

相似的 Skill

精选

agentic-os

构建持久多智能体系统,无需外部数据库,用文件保存状态,定时执行任务。

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

health

GAgarrytan/gstack143k近 7 天新增 598 个 star

deprecation-and-migration

ADaddyosmani/agent-skills122k近 7 天新增 1,667 个 star

ccs-align

THthedotmack/claude-mem121k近 7 天新增 1,626 个 star

handoff

THthedotmack/claude-mem121k近 7 天新增 1,626 个 star

mem-search

THthedotmack/claude-mem121k近 7 天新增 1,626 个 star