Auto create functionSignatures.json from class? Or other way round?

5 次查看(过去 30 天)
As described here, we now can configure the tab-completion of all our custom classes and functions using a functionSignatures.json file.
I love it!
Nevertheless it's still a lot of effort to write the json files. Is there a way to couple or to automate the creation of the json? Usually one must have an imput parser anyway, so maybe it's the other way to go: Specify the user interface/parameters by the json file and auto generate an input parser for these parameters?
How does Mathworks create these files? By hand?
Thanks!

回答(3 个)

Grant Junno
Grant Junno 2018-11-15
I'm also interested in this. Considering how tied to one another these are, it would be nice to be able to reduce some duplication of effort.

Johan Jeppsson
Johan Jeppsson 2018-11-23
I develop a python api, which I can call from MATLAB. Great .
Now I would like to have code-copleation and see my python doc-string as tooltips for my python classes. (In matlab)
I wonder if there is a good way to do this?
Maybe I can generate a lot of functionSignatures.json? typically 1 for each python class?
Can you even have functionSignatures.json for classes?
Wher should i put these functionSignatures.json files? maybe in a subfolder to (C:\MATLAB\R2018b\toolbox\matlab\external\interfaces\python) ??
Should I make subfolders for the different python packages maybe? My python api have several python packages (files ending with .py) and those files have several classes, and those classes contain instances of other classes.
Python version is 3.6 and all classes and methods have docstrings and Type-hints
Would appreciate any feedback and helpful tips :-)
/Henrik Lasu

Jan Kappen
Jan Kappen 2024-1-10
Follow-up on my initial question. Since we now have Function Argument Validation - MATLAB & Simulink (mathworks.com) which is awesome, a manual generation of functionSignatures.json feels even more redundant. But I need it for the Compiler SDK.
@MathWorks Support Team, is there any chance to automatic generate the files from class introspection?

类别

Help CenterFile Exchange 中查找有关 Python Package Integration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by