Some questions about pyminsky
System dynamics program with additional features for economics
Brought to you by:
hpcoder,
profstevekeen
I recently installed Minsky version 3.13.0, (linux Ubuntu from the Opensuse's repository) and I just interacted with pymisnky and I see that it is more stable than in previous versions, thank you very much for the improvement.
I was trying to interact with previous versions of Minsky through the REST service. It was quite difficult for me to be able to write the commands to perform actions, I was trying to follow the documentation found at: https://minsky.sourceforge.io/doxydoc/html/md_RESTService.htmlhttps://minsky.sourceforge.io/doxydoc/html/md_RESTService.html
Trying to find some references elsewhere in the documentation about the functions. Although, most of the time though I was just guessing at the parameters and couldn't get to do anything meaningful. Not sure if it was the right or only place to look for the information.
Now that I was able to interact with pyminsky, I would like to know more about the methods and syntax of the library.
I read the disclaimer:
“Minsky is open source, so ultimately the documented API is found by consulting the source code.”
From what I understand, there is no detailed documentation or guide about the methods, parameters or attributes of the library, is this correct?
If this is correct, I would like to know if the pyminsky methods are directly mapped to the C++ code functions or if somehow the REST API or typescript API were used as the base of the python library (I don't know if this makes sense, apologies in advance, I'm not an experienced developer). I would like to know this, so I know where to begin to understand some of the code.
If the main minsky functions are in the source code. All the relevant methods would be in the “Engine” directory (https://github.com/highperformancecoder/minsky/tree/master/engine
https://github.com/highperformancecoder/minsky/tree/master/engine), right? or should I take into account other directories to understand the functions?*
Glad to see Minksy being actively developed. Thanks, you do a great job.
edits: Format
Last edit: Paulo Rozario 2025-05-30
Hi Paulo, welcome to the journey!
I just did the 3.16 release last week, and the SourceForge
documentation you refer to below now sports a page on script
python.
https://minsky.sourceforge.io/doxydoc/html/md_python-minsky.html
The same documentation appears on the Github website.
https://github.com/highperformancecoder/minsky/blob/master/python-minsky.md
The version on SF should refer to the latest release (currently
3.16.19). I notice that it says 3.17.0-beta.1 - there's no difference
actually, but I'll fix the version number today as it is confusing.
The version on Github is the absolute bleeding edge.
A good source of example python scripts is the test directory
https://github.com/highperformancecoder/minsky/tree/master/test. Most
of the regression tests involve the use of python scripts, mostly
generated on the fly from bash shell "here documents" - take a look at
the 00 directory.
I'll answer your questions below:
On Fri, May 30, 2025 at 09:24:27PM -0000, Paulo Rozario wrote:
The best source to look at is the one you found:
https://minsky.sourceforge.io/doxydoc/html/index.html. So the
pyminsky.minsky object is the global Minsky object, which is
documented at
https://minsky.sourceforge.io/doxydoc/html/classminsky_1_1Minsky.html
.
The detailed documentation is generated directly from the source code
using Doxygen. It is the one at
https://minsky.sourceforge.io/doxydoc/html/index.html .
Pyminsky methods are directly mapped to the C++ methods. C++
attributes are mapped to python setter/getter methods.
All 3 of these bindings make use of the "RESTProcess" classdesc
descriptor to automatically reflect C++ objects, and the
"json_pack/unpack" descriptors to handle marshalling of arguments via
JSON. At some point in the future, it may be possible to do the python
<=> C++ type conversion directly without going through a JSON
intermediary, but for now that is how it is done. The Typescript one
additionally uses a "typeScriptAPI" descriptor to generate typescript
declarations of the method signatures, which helps strong type safety
when coding in Typescript, as otherwise you'd be dropping down to
vanilla Javascript which has no such type safety.
The main Minsky class is declared in the "model" directory. But the
doxygen annotated view is usually easier to understand than the
underlying raw codebase - speaking from experience of working on other
codebases to which I wasn't initially familiar. Of course once you do
find your way around the codebase, you tend not to look at the doxygen
annotated stuff as much.
Your welcome.
--
Dr Russell Standish Phone 0425 253119 (mobile)
Principal, High Performance Coders hpcoder@hpcoders.com.au
http://www.hpcoders.com.au