[py] Add to_dict() and __repr__ to PlatformConfig and PlatformSchemaConfig#4458
Merged
aaronwolen merged 3 commits intoMay 5, 2026
Merged
Conversation
The pybind11 binding for `PlatformConfig.dense_nd_array_dim_zstd_level` was aliased to `&PlatformConfig::sparse_nd_array_dim_zstd_level`, so mutations to the dense level silently overwrote the sparse level and reads always returned the sparse level. Bind it to the correct member. Adds a regression test that verifies both fields can be set and read back independently.
…rmSchemaConfig Both pybind11-bound config structs now expose: * `to_dict()` — returns a Python dict of all fields, useful for diagnostic logging, serialization, and structural comparison. * `__repr__` — readable single-line representation showing each field and its current value. The optional fields `tile_order` and `cell_order` render as `None` when unset and `'value'` when set.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4458 +/- ##
==========================================
- Coverage 85.27% 85.26% -0.01%
==========================================
Files 136 136
Lines 21266 21266
==========================================
- Hits 18135 18133 -2
- Misses 3131 3133 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jp-dark
approved these changes
May 5, 2026
jp-dark
pushed a commit
that referenced
this pull request
May 15, 2026
…SchemaConfig` (#4458) (#4460) * fix(python): bind dense_nd_array_dim_zstd_level to the correct field The pybind11 binding for `PlatformConfig.dense_nd_array_dim_zstd_level` was aliased to `&PlatformConfig::sparse_nd_array_dim_zstd_level`, so mutations to the dense level silently overwrote the sparse level and reads always returned the sparse level. Bind it to the correct member. Adds a regression test that verifies both fields can be set and read back independently. * feat(python): add to_dict() and __repr__ to PlatformConfig and PlatformSchemaConfig Both pybind11-bound config structs now expose: * `to_dict()` — returns a Python dict of all fields, useful for diagnostic logging, serialization, and structural comparison. * `__repr__` — readable single-line representation showing each field and its current value. The optional fields `tile_order` and `cell_order` render as `None` when unset and `'value'` when set. * docs(python): correct schema_config_options return type in docstring (cherry picked from commit 2ed76cb) Co-authored-by: Aaron Wolen <aaron@wolen.com>
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.
Issue and/or context: [SOMA-939]
The
PlatformConfigandPlatformSchemaConfigattributes can only be viewed individually, with no convenient way to dump the full configuration for logging, diagnostics, etc.Changes:
PlatformConfigandPlatformSchemaConfignow expose:to_dict()returns a Python dict of all fields.__repr__provides a single-line representation showing each field.Example:
Output:
Notes for Reviewer:
PR includes two other fixes:
schema_config_optionsdocstring which incorrectly said the method returned aPlatformConfig, rather than aPlatformSchemaConfig.PlatformConfig.dense_nd_array_dim_zstd_levelis now bound to the correct C++ member.