From 6172813d0f2cdf8568afebc0f2ca2a72a67702e1 Mon Sep 17 00:00:00 2001 From: Ryan McKenna Date: Fri, 28 Aug 2026 05:01:46 -0700 Subject: [PATCH] Fix Sphinx documentation configuration and internal links. - Uncomment templates_path, define root_doc/master_doc, and add autodoc_mock_imports in conf.py. - Fix scalable pipeline document links in index.md and processing_lifecycle.md with Copybara tags for GitHub. - Expose Schema in api_reference.rst under dpsynth.domain. - Document compress_columns in in_memory_api.md. PiperOrigin-RevId: 972518306 --- docs/api_reference.rst | 1 + docs/conf.py | 15 ++++++++++++++- docs/in_memory_api.md | 3 +++ docs/index.md | 2 +- docs/processing_lifecycle.md | 3 ++- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/api_reference.rst b/docs/api_reference.rst index 412ffc99..2586e028 100644 --- a/docs/api_reference.rst +++ b/docs/api_reference.rst @@ -44,6 +44,7 @@ argument to :class:`~dpsynth.TabularConfig`. :nosignatures: :template: autosummary/class.rst + Schema CategoricalAttribute NumericalAttribute OpenSetCategoricalAttribute diff --git a/docs/conf.py b/docs/conf.py index c15e515c..a7a07825 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,9 +45,22 @@ 'show-inheritance': True, } -# templates_path = ['_templates'] +templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +root_doc = 'index' +master_doc = 'index' + +autodoc_mock_imports = [ + 'pipeline_dp', + 'apache_beam', + 'tensorflow', + 'flax', + 'gemma', + 'jax_privacy', + 'optax', +] + # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/docs/in_memory_api.md b/docs/in_memory_api.md index 5a16d3e1..8e2c3b86 100644 --- a/docs/in_memory_api.md +++ b/docs/in_memory_api.md @@ -53,6 +53,9 @@ When initializing `dpsynth.TabularConfig`: partition selection (default: `0.1`). * `cross_attribute_constraints`: Optional sequence of constraints to enforce on generated data. +* `compress_columns`: Whether to compress rare categories (< 3*sigma) for + `CategoricalAttribute` columns not present in constraints + (default: `False`). When calling `config.calibrate(...)`: diff --git a/docs/index.md b/docs/index.md index 3576de82..7eb2bec3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -136,7 +136,7 @@ APIs: data_and_terminology in_memory_api -scalable_pipeline_api +scalable_beam_api ``` ```{toctree} diff --git a/docs/processing_lifecycle.md b/docs/processing_lifecycle.md index d712757e..99364ede 100644 --- a/docs/processing_lifecycle.md +++ b/docs/processing_lifecycle.md @@ -11,7 +11,8 @@ floating-point ranges, unbounded string categories, high-dimensional state spaces, and strict privacy budget accounting. This page details the 5-stage mathematical lifecycle executed across both the -[In-Memory](in_memory_api.md) and [Scalable Pipeline](scalable_beam_api.md) +[In-Memory](in_memory_api.md) and +[Scalable Pipeline](scalable_beam_api.md) APIs. ```