Define domain.Schema, relational.RelationalSchema, and support presets with backwards compatibility. - #154
Open
copybara-service[bot] wants to merge 1 commit into
Open
Define domain.Schema, relational.RelationalSchema, and support presets with backwards compatibility.#154copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
cl/970150970
branch
from
August 25, 2026 01:15
16dbfa9 to
f44f5f0
Compare
copybara-service
Bot
force-pushed
the
cl/970150970
branch
2 times, most recently
from
August 25, 2026 11:53
a62f3d9 to
fb8e6c4
Compare
copybara-service
Bot
force-pushed
the
cl/970150970
branch
2 times, most recently
from
August 25, 2026 12:40
22db8e9 to
11f6cf6
Compare
copybara-service
Bot
force-pushed
the
cl/970150970
branch
3 times, most recently
from
August 25, 2026 16:03
37d33c8 to
170a419
Compare
copybara-service
Bot
force-pushed
the
cl/970150970
branch
3 times, most recently
from
August 25, 2026 22:16
096e93f to
146703c
Compare
…s with backwards compatibility. - Introduce `dpsynth.domain.Schema` dataclass implementing `Mapping[str, AttributeType]` to encapsulate column attribute domains and cross-attribute constraints. - Introduce `dpsynth.relational.RelationalSchema` dataclass to encapsulate relational table schemas and foreign key relationships. - Support reusable algorithm presets by accepting schemas at configure/calibration time (`configure(schema, ...)` and `calibrate(schema, ...)`). - Provide backwards compatibility by preserving optional domain/schema/attribute fields on configuration classes (`TabularConfig`, `BeamTabularConfig`, `MultiTableConfig`, initializers, discrete mechanisms), falling back to them when not provided at configure time. - Update `MechanismConfig.configure(domain=None, ...)` and `MechanismConfig.calibrate(domain=None, ...)` in `api.py` to forward domain arguments to polymorphic mechanisms. PiperOrigin-RevId: 970150970
copybara-service
Bot
force-pushed
the
cl/970150970
branch
from
August 25, 2026 23:48
146703c to
2026536
Compare
MuhammadNiazAli
approved these changes
Aug 28, 2026
MuhammadNiazAli
left a comment
There was a problem hiding this comment.
The migration in bin/main.py from TabularSynthesizer(domains=...) to TabularConfig(discrete_mechanism=...).calibrate(attribute_domains, ...) lines up cleanly with the new preset-based API described in the PR. The docs update in in_memory_api.md correctly reflects the new configure(schema, ...)/calibrate(schema, ...) signature and the dpsynth.domain import.
I've only looked at these 2 of the 29 changed files so far holding off on approving the whole PR until I've gone through the rest (particularly the actual Schema/RelationalSchema dataclass definitions and the backwards-compatibility fallback logic on TabularConfig/BeamTabularConfig/MultiTableConfig, since that's the riskiest part of this change).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Define domain.Schema, relational.RelationalSchema, and support presets with backwards compatibility.
dpsynth.domain.Schemadataclass implementingMapping[str, AttributeType]to encapsulate column attribute domains and cross-attribute constraints.dpsynth.relational.RelationalSchemadataclass to encapsulate relational table schemas and foreign key relationships.configure(schema, ...)andcalibrate(schema, ...)).TabularConfig,BeamTabularConfig,MultiTableConfig, initializers, discrete mechanisms), falling back to them when not provided at configure time.MechanismConfig.configure(domain=None, ...)andMechanismConfig.calibrate(domain=None, ...)inapi.pyto forward domain arguments to polymorphic mechanisms.