Skip to content

Dataset catalog

Datasets ship with the package or download on first use, and the catalog is how they are addressed: kd.list_datasets enumerates them, kd.get_dataset takes one stable id, and both return a kd.DatasetSpec carrying the equation, the left-hand side, the axes and the loader itself. Their provenance is tabulated under Bundled datasets. The generate_* functions synthesize data from an analytic solution instead, for self-checks.

The named loaders at the end of this page are the short spelling of a catalog entry, not a second way in: kd.load_kdv is the object kd.get_dataset("kdv") carries as its loader. A few of the bundled datasets have no such name and are reached through the catalog alone.

Name Summary
kd.DatasetSpec(id, loader[, ...]) Static metadata and loader pointer for a discoverable dataset.
kd.list_datasets() Return built-in dataset specs sorted by stable dataset id.
kd.list_datasets_answer_blind() Return the catalog as JSON-safe rows with the ground truth withheld.
kd.get_dataset(dataset_id) Return the dataset spec for dataset_id.
kd.DATASET_CATALOG
kd.list_remote_datasets() Return remote dataset specs sorted by stable dataset id.
kd.load_from_hub(dataset_id, cache_dir[, ...]) Fetch dataset_id from Hugging Face Hub and return a PDEDataset.
kd.generate_advection_data(speeds, waves[, ...]) Generate synthetic advection equation data.
kd.generate_burgers_data(nx, nt[, ...]) Generate synthetic Burgers equation data.
kd.generate_diffusion_data(alpha, waves[, ...]) Generate synthetic diffusion equation data.
kd.load_kdv(data_dir) Load KdV (Korteweg-de Vries) equation dataset.
kd.load_burgers(data_dir) Load the Burgers equation reference dataset from SGA-PDE (Chen et al.).
kd.load_burgers_2d(data_dir) Load the EqGPT 2D viscous Burgers benchmark (.mat), a 2+1D dataset.
kd.load_chafee_infante(data_dir) Load Chafee-Infante equation dataset.
kd.load_wave(data_dir) Load the wave equation benchmark (EqGPT), a second-order LHS dataset.
kd.load_klein_gordon(data_dir) Load the Klein-Gordon benchmark (EqGPT), a second-order LHS dataset.
kd.load_allen_cahn(data_dir) Load the Allen-Cahn reaction-diffusion benchmark (EqGPT).
kd.load_convection_diffusion(data_dir) Load the convection-diffusion benchmark (EqGPT).
kd.load_eq_6_2_12(data_dir) Load the EqGPT Eq. 6.2.12 mixed-derivative benchmark (CSV).
kd.load_pde_compound(data_dir) Load PDE_compound (Eq. S5 from SGA-PDE paper).
kd.load_pde_divide(data_dir) Load PDE_divide (Eq. S4 from SGA-PDE paper).
kd.load_llm4ed_heat(cache_dir, offline) Load the LLM4ED heat-equation mirror dataset from Hugging Face Hub.
kd.load_llm4ed_fisher(cache_dir, offline) Load the LLM4ED Fisher mirror dataset from Hugging Face Hub.
kd.load_llm4ed_fisher_nonlinear(cache_dir, offline) Load the LLM4ED nonlinear-Fisher mirror dataset from Hugging Face Hub.
kd.load_tlc_cc(target) Load the TLC-CC chromatography dataset (real-world experimental data).
kd.load_wave_breaking(case, data_dir) Load wave-tank surface-elevation data (real-world experimental data).

DatasetSpec dataclass

Static metadata and loader pointer for a discoverable dataset.

list_datasets

list_datasets() -> list[DatasetSpec]

Return built-in dataset specs sorted by stable dataset id.

list_datasets_answer_blind

list_datasets_answer_blind() -> list[dict[str, Any]]

Return the catalog as JSON-safe rows with the ground truth withheld.

get_dataset

get_dataset(dataset_id: str) -> DatasetSpec

Return the dataset spec for dataset_id.

Raises:

  • KeyError

    If dataset_id is not registered.

DATASET_CATALOG module-attribute

DATASET_CATALOG: dict[str, DatasetSpec]

list_remote_datasets

list_remote_datasets() -> list[DatasetSpec]

Return remote dataset specs sorted by stable dataset id.

load_from_hub

load_from_hub(
    dataset_id: str,
    *,
    cache_dir: Path | None = None,
    offline: bool = False,
) -> PDEDataset

Fetch dataset_id from Hugging Face Hub and return a PDEDataset.

generate_advection_data

generate_advection_data(
    speeds: tuple[float, ...],
    waves: tuple[float, ...],
    grid_sizes: tuple[int, ...],
    nt: int,
    noise_level: float = 0.0,
    device: device | None = None,
    seed: int | None = None,
) -> PDEDataset

Generate synthetic advection equation data.

Parameters:

  • speeds (tuple[float, ...]) –

    Advection speeds for each spatial dimension.

  • waves (tuple[float, ...]) –

    Wave numbers for each spatial dimension.

  • grid_sizes (tuple[int, ...]) –

    Number of grid points for each spatial dimension.

  • nt (int) –

    Number of temporal grid points.

  • noise_level (float, default: 0.0 ) –

    Standard deviation of Gaussian noise (default: 0.0).

  • device (device | None, default: None ) –

    Target device for tensors (default: CPU).

  • seed (int | None, default: None ) –

    Random seed for reproducibility (default: None).

Returns:

  • PDEDataset

    PDEDataset with analytic advection solution.

Raises:

  • ValueError

    If parameters are invalid or inconsistent.

generate_burgers_data

generate_burgers_data(
    nx: int = 256,
    nt: int = 101,
    nu: float = 0.1,
    noise_level: float = 0.0,
    device: device | None = None,
    seed: int | None = None,
) -> PDEDataset

Generate synthetic Burgers equation data.

Parameters:

  • nx (int, default: 256 ) –

    Number of spatial grid points (default: 256)

  • nt (int, default: 101 ) –

    Number of time steps (default: 101)

  • nu (float, default: 0.1 ) –

    Viscosity coefficient (default: 0.1)

  • noise_level (float, default: 0.0 ) –

    Standard deviation of Gaussian noise to add (default: 0.0)

  • device (device | None, default: None ) –

    Target device for tensors (default: CPU)

  • seed (int | None, default: None ) –

    Random seed for reproducibility (default: None)

Returns:

Raises:

  • ValueError

    If parameters are invalid.

Example

dataset = generate_burgers_data(nx=128, nt=51, nu=0.1) dataset.get_shape() (128, 51) dataset.get_field("u").shape torch.Size([128, 51])

generate_diffusion_data

generate_diffusion_data(
    alpha: float,
    waves: tuple[float, ...],
    grid_sizes: tuple[int, ...],
    nt: int,
    noise_level: float = 0.0,
    device: device | None = None,
    seed: int | None = None,
) -> PDEDataset

Generate synthetic diffusion equation data.

Parameters:

  • alpha (float) –

    Diffusion coefficient (must be positive).

  • waves (tuple[float, ...]) –

    Wave numbers for each spatial dimension.

  • grid_sizes (tuple[int, ...]) –

    Number of grid points for each spatial dimension.

  • nt (int) –

    Number of temporal grid points.

  • noise_level (float, default: 0.0 ) –

    Standard deviation of Gaussian noise (default: 0.0).

  • device (device | None, default: None ) –

    Target device for tensors (default: CPU).

  • seed (int | None, default: None ) –

    Random seed for reproducibility (default: None).

Returns:

  • PDEDataset

    PDEDataset with analytic diffusion solution.

Raises:

  • ValueError

    If parameters are invalid or inconsistent.

load_kdv

load_kdv(data_dir: Path | str | None = None) -> PDEDataset

Load KdV (Korteweg-de Vries) equation dataset.

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory containing data files. Defaults to validation/data/ relative to project root.

Returns:

Raises:

  • FileNotFoundError

    If the data file is missing.

load_burgers

load_burgers(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the Burgers equation reference dataset from SGA-PDE (Chen et al.).

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory containing data files. Defaults to bundled package data.

Returns:

Raises:

  • FileNotFoundError

    If the data file is missing.

load_burgers_2d

load_burgers_2d(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the EqGPT 2D viscous Burgers benchmark (.mat), a 2+1D dataset.

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_burgers_2d.mat. If None, falls back to the bundled package data under _assets/data.

Returns:

  • PDEDataset

    PDEDataset with the 2D Burgers data oriented [x, y, t].

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

  • ValueError

    If any of the x/y/t axes is non-uniformly spaced, or the field/axes are otherwise inconsistent.

load_chafee_infante

load_chafee_infante(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load Chafee-Infante equation dataset.

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory containing data files. Defaults to validation/data/ relative to project root.

Returns:

  • PDEDataset

    PDEDataset with Chafee-Infante data.

Raises:

  • FileNotFoundError

    If any required data file is missing.

load_wave

load_wave(data_dir: Path | str | None = None) -> PDEDataset

Load the wave equation benchmark (EqGPT), a second-order LHS dataset.

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_wave.mat. If None, falls back to the bundled package data, then a source checkout's data directory.

Returns:

  • PDEDataset

    PDEDataset with wave data (lhs_order=2).

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

load_klein_gordon

load_klein_gordon(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the Klein-Gordon benchmark (EqGPT), a second-order LHS dataset.

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_klein_gordon.mat. If None, falls back to the bundled package data, then a source checkout's data directory.

Returns:

  • PDEDataset

    PDEDataset with Klein-Gordon data (lhs_order=2).

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

load_allen_cahn

load_allen_cahn(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the Allen-Cahn reaction-diffusion benchmark (EqGPT).

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_allen_cahn.mat. If None, falls back to the bundled package data, then a source checkout's data directory.

Returns:

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

load_convection_diffusion

load_convection_diffusion(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the convection-diffusion benchmark (EqGPT).

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_convection_diffusion.mat. If None, falls back to the bundled package data, then a source checkout's data directory.

Returns:

  • PDEDataset

    PDEDataset with convection-diffusion data.

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

load_eq_6_2_12

load_eq_6_2_12(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load the EqGPT Eq. 6.2.12 mixed-derivative benchmark (CSV).

Parameters:

  • data_dir (Path | str | None, default: None ) –

    Directory holding eqgpt_eq_6_2_12.csv. If None, falls back to the bundled package data under _assets/data.

Returns:

  • PDEDataset

    PDEDataset with the Eq. 6.2.12 data oriented [x, t].

Raises:

  • FileNotFoundError

    If the data file cannot be resolved.

  • ValueError

    If the CSV is malformed (see read_grid_csv) or does not match the expected 501x501 grid.

load_pde_compound

load_pde_compound(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load PDE_compound (Eq. S5 from SGA-PDE paper).

load_pde_divide

load_pde_divide(
    data_dir: Path | str | None = None,
) -> PDEDataset

Load PDE_divide (Eq. S4 from SGA-PDE paper).

load_llm4ed_heat

load_llm4ed_heat(
    *, cache_dir: Path | None = None, offline: bool = False
) -> PDEDataset

Load the LLM4ED heat-equation mirror dataset from Hugging Face Hub.

load_llm4ed_fisher

load_llm4ed_fisher(
    *, cache_dir: Path | None = None, offline: bool = False
) -> PDEDataset

Load the LLM4ED Fisher mirror dataset from Hugging Face Hub.

load_llm4ed_fisher_nonlinear

load_llm4ed_fisher_nonlinear(
    *, cache_dir: Path | None = None, offline: bool = False
) -> PDEDataset

Load the LLM4ED nonlinear-Fisher mirror dataset from Hugging Face Hub.

load_tlc_cc

load_tlc_cc(
    target: Literal["start", "end"] = "start",
) -> TabularDataset

Load the TLC-CC chromatography dataset (real-world experimental data).

Parameters:

  • target (Literal['start', 'end'], default: 'start' ) –

    Which retention volume to use as y: "start" (V_S) or "end" (V_E).

Returns:

  • TabularDataset

    The dataset with X = (R_F, r) and the chosen retention volume as y.

Raises:

  • ValueError

    If target is not "start" or "end".

  • FileNotFoundError

    If the bundled data file is missing.

load_wave_breaking

load_wave_breaking(
    case: str = "N_G2Tp12A100_broad",
    data_dir: Path | str | None = None,
) -> TabularDataset

Load wave-tank surface-elevation data (real-world experimental data).

Parameters:

  • case (str, default: 'N_G2Tp12A100_broad' ) –

    Experiment identifier. Defaults to the bundled case.

  • data_dir (Path | str | None, default: None ) –

    Directory holding wave_breaking_<case>.npz files for non-bundled cases. When given, it is authoritative.

Returns:

  • TabularDataset

    The dataset with X = (t, x) and surface elevation as y.

Raises:

  • FileNotFoundError

    If the case is not bundled and data_dir does not provide it.