Centralize Public API into dedicated API module #648
Merged
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 PR implements a comprehensive refactoring to centralize PythonCall.jl's public API into a dedicated module structure.
Key Changes
New Centralized API Module
src/API/
directory with organized API components:types.jl
- All public type definitionsfunctions.jl
- Public function declarationsmacros.jl
- Public macro declarationsexports.jl
- Centralized export statementspublics.jl
- Public API declarations using modernMeta.parse()
patternType System Reorganization
All major types moved to centralized API:
Py
,PyException
,pybuiltins
PyArray
,PyDict
,PyIO
,PyIterable
,PyList
,PyPandasDataFrame
,PySet
,PyTable
PyObjectArray
,PyObjectVector
,PyObjectMatrix
(with updatedPtr{Cvoid}
storage)Function and Macro Centralization
pyfunc
,pyclassmethod
,pystaticmethod
,pyproperty
, etc.)pytable
function fromCompat
@py
macro fromPyMacro
@pyconst
macro fromCore
Core
builtin functionsModule Structure Updates
Technical Improvements
PyObjectArray
usesPtr{Cvoid}
instead ofC.PyPtr
for improved type safetyImpact
This refactoring establishes a clear architectural boundary between PythonCall's public API and internal implementation. It reduces code duplication, improves maintainability, and provides users with a single, well-defined interface while preserving full backward compatibility.
The centralized approach makes the codebase more modular and easier to extend, setting up a foundation for future API evolution.