This version deliberately uses runtime introspection.
It imports:
import pyclesperanto_prototype
import pyclesperantoand then compares the public callable API using:
dir(module)
getattr(module, name)
callable(...)
inspect.signature(...)There is no source-folder parsing.
The generated transition notes contain:
- Functions in
pyclesperanto_prototypebut not inpyclesperanto. - Functions present in both libraries whose signatures differ.
- Parameter rename candidates for common functions.
- Added/removed parameters.
- Parameter kind changes.
- Default-value changes.
- Functions in
pyclesperantobut not inpyclesperanto_prototype.
Both libraries must be importable in the Python environment in which this tool runs.
For example:
pip install pyclesperanto pyclesperanto-prototypeor install your local development checkouts into the same environment.
python -m venv .venv
source .venv/bin/activate
pip install -e .For tests:
pip install -e ".[dev]"
pytestclesperanto-api-diff --ignore config/api-diff-ignore.toml --output transition_notes.md --json-output transition_notes.jsonEquivalent:
python -m api_diff \
--ignore config/api-diff-ignore.toml \
--output transition_notes.mdBy default it imports:
pyclesperanto_prototype
pyclesperanto
You can override them:
clesperanto-api-diff \
--prototype-module some_old_module \
--current-module some_new_moduleconfig/api-diff-ignore.toml:
[ignore_functions]
both = [
"some_internal_helper",
]
prototype = [
"old_function_we_do_not_want_to_document",
]
pyclesperanto = [
"new_function_we_do_not_want_to_document",
]Function matching is currently by exact public name.
[ignore_parameters.gaussian_blur]
both = ["device"]
prototype = ["destination"]
pyclesperanto = ["output_image"]Parameter ignores are applied before signature comparison.
This is useful for known differences which should not show up in the generated transition notes.
For a function present in both libraries:
# pyclesperanto_prototype
def gaussian_blur(source, destination, sigma_x, sigma_y):
...
# pyclesperanto
def gaussian_blur(input_image, output_image, sigma_x, sigma_y):
...the comparator sees compatible parameter kinds at the same positions and emits:
source -> input_image
destination -> output_image
This is intentionally only a rename candidate. Matching position does not prove that the two parameters have identical semantics.
The runtime scanner:
- skips names beginning with
_; - skips classes;
- requires the object to be callable;
- requires
inspect.signature(object)to succeed.
This means Python functions, wrapped functions, many extension functions, and other inspectable callables can be compared.
Objects for which Python cannot provide a signature are skipped.
Use:
--json-output transition_notes.jsonThe JSON contains the complete extracted runtime API snapshots as well as the computed differences.
The package itself defines its public runtime namespace.
By comparing what users actually see after:
import pyclesperanto as clewe avoid trying to reconstruct exports, aliases, decorators, or generated functions from package source code.