Open xp1632 opened 1 month ago
help()
.__annotation__
when checking the source code for kornia method: morphology.dilation
:
https://github.com/kornia/kornia/blob/main/kornia/morphology/morphology.py
inspect
import kornia
import inspect
# Iterate over the attributes of the kornia module
for name, obj in inspect.getmembers(kornia):
# Check if the attribute is a function
if inspect.isfunction(obj):
print(f"Function name: {name}")
# Get the function's signature
sig = inspect.signature(obj)
# Iterate over the parameters of the function
for param_name, param in sig.parameters.items():
print(f" Parameter: {param_name}")
# Check if the parameter has a type annotation
if param.annotation is not param.empty:
print(f" Type: {param.annotation}")
else:
print(f" Type: Unknown")
In theory, what we did in the pipeline is just to extract and rearrange the information into the JSON format that VP project could recognize
Without the java-python, type incompatibility problem we are facing now
Auto generation for other libraries could be even easier