Skip to content

API reference

Every public name in the package, each linking to its full signature and parameters. kd itself is flat: it is kd.load_kdv, not kd.datasets.load_kdv. The batch loop is the one group imported from a subpackage, kd.harness.

Descriptions come from the library's own docstrings, cut to reference length. Where a parameter carries more than a sentence of contract, the guide pages under Guide hold it: resume tiers in Parameter tiers and resuming, what the scores mean in Score conventions, term syntax in Equation representation.

Model and result

Name Summary
kd.Model(algorithm, generations[, ...]) High-level facade for PDE discovery (PySR-style API).
kd.ExperimentResult(best_expression, best_score[, ...]) Serializable value object for a completed experiment.

Algorithm settings

Name Summary
kd.instrument_schemas() Return agent-facing schemas for facade plugins in registration order.
kd.SGAConfig(num, p_var[, ...]) Configuration for the SGA search algorithm.
kd.DLGAConfig(mode, library[, ...]) DLGA Stage I (constant-coefficient) configuration.
kd.DiscoverConfig(n_iterations, seed[, ...]) Configuration for a DISCOVER (RL + optional PINN) search run.
kd.EqGPTConfig(sparsity_alpha, seed[, ...]) Static configuration for the EqGPT plugin.
kd.Llm4edConfig(temperature, max_tokens[, ...]) Static configuration for the LLM4ED plugin.
kd.PySRConfig(terms, seed[, ...]) Frozen configuration for a PySR symbolic-regression run.
kd.PySINDyConfig(terms, threshold[, ...]) Frozen configuration for a PySINDy STLSQ fit.

Datasets

Name Summary
kd.PDEDataset(name, task_type[, ...]) Complete PDE dataset specification.
kd.TabularDataset(X, y[, ...]) A scalar regression dataset: features X, target y, metadata.
kd.FieldData(name, values[, ...]) Field data container.
kd.AxisInfo(name, values[, ...]) Coordinate axis information.
kd.DataTopology(value, names[, ...]) Data layout topology.
kd.TaskType(value, names[, ...]) Type of discovery task.
kd.DatasetReport(name, topology[, ...]) Structured result of kd.preview_report (JSON-dumpable, answer-blind).
kd.FieldReport(name, dtype[, ...]) Per-field facts of one dataset field.
kd.AxisReport(name, n[, ...]) Per-axis facts of one dataset axis.

Dataset catalog

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).

Terms and equations

Name Summary
kd.evaluate_terms(dataset, terms[, ...]) Evaluate candidate terms against a dataset, fail-loud.
kd.validate_terms(dataset, terms[, ...]) Classify each term as valid / rejected WITHOUT fitting.
kd.verify_equation(eq, executor[, ...]) Verify an equation on a dataset using its reported coefficients unchanged.
kd.law_signature(eq) Build a versioned signature from an equation's active law.
kd.Sketch(lhs_spec, vocabulary[, ...]) A versioned evolution-law template with pinned, anchored, and hole clauses.
kd.EvaluationResult(mse, nmse[, ...]) Result from evaluating an expression or term list.
kd.TermValidationReport(results, valid[, ...]) Structured result of validate_terms (JSON-dumpable, no fitting).
kd.TermRejection(term, reason) A single rejected term and the reason it was rejected.
kd.VerificationReport(signature, form[, ...]) JSON-serializable measurements for one equation on one dataset.
kd.VerifyPolicy(nmse_max, coeff_atol[, ...]) Thresholds used when reporting and comparing empirical verification.
kd.InvalidTermsError(rejected) Raised when one or more terms are rejected and cannot be fitted.
kd.EvaluationFailedError Raised when the final fit is invalid (solver failure / non-finite MSE).

Figures

Name Summary
kd.preview(dataset, file) Print a sanity-check summary of a PDEDataset.
kd.preview_report(dataset) Build a typed report of a PDEDataset without printing anything.
kd.VizEngine(output_dir, style) Orchestrates rendering of universal, plugin, and comparison plots.

Checkpoints

Name Summary
kd.load_checkpoint_manifest(directory) Load + fully verify a directory's manifest, returning entries in order.
kd.CheckpointManifestEntry(filename, kind[, ...]) A frozen, JSON-safe manifest entry (kd-ckptman-v1).
kd.CheckpointManifestError Raised on any kd-ckptman-v1 manifest contract violation.
kd.KIND_FINAL
kd.FINAL_STATUS_COMPLETED

Batch experiments

Name Summary
kd.harness.ExperimentPlan(name, entries) An ordered execution matrix of plan entries with a content identity.
kd.harness.PlanEntry(instrument, dataset_ref[, ...]) One declarative episode: an instrument applied to a dataset at a seed.
kd.harness.run_plan(plan, datasets[, ...]) Pre-flight, then run every plan entry serially into a fresh store.
kd.harness.PlanRunResult(store_root, outcomes) The outcome of a whole batch: the store root plus every episode outcome.
kd.harness.EpisodeOutcome(entry_index, entry[, ...]) The sealed result of running one plan entry.
kd.harness.EvidenceStore(root, plan[, ...]) A fresh-dir, append-only, tamper-evident batch evidence directory.
kd.harness.build_consensus(store, datasets[, ...]) Aggregate a sealed evidence store into a consensus report tree.
kd.harness.ConsensusReport(provenance, datasets[, ...]) The full consensus report tree for one sealed evidence store.
kd.harness.render_consensus_markdown(report) Render the report as a deterministic Markdown document (pure function).
kd.harness.SKETCH_SIDECAR_FILENAME

Surrogate models

Name Summary
kd.models.save_field_model(model, path) Write model as a kd-surrogate-v1 file and return its path.
kd.models.load_field_model(path) Rebuild the FieldModel a kd-surrogate-v1 file describes.

Plugin interfaces

Name Summary
kd.search.SurrogateTrainer(args, kwargs) Plugin face for training the derivative surrogate as a standalone action.