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

4 ビュー (過去 30 日間)
Jan Kappen
Jan Kappen 2018 年 3 月 19 日
回答済み: Jan Kappen 2024 年 1 月 10 日
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 Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by