Improve bindings for configuration types#35
Open
wdeconinck wants to merge 2 commits into
Open
Conversation
5e014ca to
df7d464
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the atlas4py Python bindings for configuration-related types by extracting config binding logic into a dedicated module and expanding the Python-facing Config API (including YAML/file constructors), while updating string representations to use the new config-to-Python conversion helper.
Changes:
- Split configuration binding/conversion logic into
_atlas4py_Config.{hpp,cpp}and register it from_atlas4py.cpp. - Expanded Python bindings for
eckit::Configuration/eckit::LocalConfiguration/atlas::util::Config(mapping protocol, constructors from kwargs/YAML/file). - Added pytest coverage for new
Configbehaviors and bumped the package dev version.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_bindings.py |
Adds tests for new Config constructors and mapping/contains semantics. |
src/atlas4py/CMakeLists.txt |
Ensures the new config binding translation unit is compiled into _atlas4py. |
src/atlas4py/_atlas4py.cpp |
Wires in bind_Config() and updates several __repr__ paths to use make_object(). |
src/atlas4py/_atlas4py_Config.hpp |
Declares the new config binding/conversion API surface used by _atlas4py.cpp. |
src/atlas4py/_atlas4py_Config.cpp |
Implements the new binding/conversion logic and Config constructors. |
pyproject.toml |
Bumps atlas4py version from 0.41.1.dev4 to 0.41.1.dev5. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
851aa3c to
ed6806c
Compare
Collaborator
Author
|
Hi @tehrengruber this is the following PR in line, now ready for you to review :) |
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.
This pull request refactors and extends the Python bindings for configuration objects in
atlas4py, improving maintainability and usability. The main changes involve extracting the configuration binding logic into a new dedicated source file, enhancing the Python interface for configuration objects, and updating tests to cover the new features.Refactoring and modularization:
eckit::Configuration,eckit::LocalConfiguration,atlas::util::Config) into new files:_atlas4py_Config.cppand_atlas4py_Config.hppThis significantly improves code organization and maintainability.Enhancements to Python bindings:
Configobjects from keyword arguments, YAML strings, and files.__repr__methods for several types (Projection,Domain,Grid,Spacing,Metadata) to use the newatlas4py::make_objectfunction for consistent and improved string representations.Testing improvements:
tests/test_bindings.pyto verify the newConfigconstructors (from_kwargs,from_yaml,from_file) and their correct behavior, including nested configuration and type handling.