pymoca 0.10.0.dev6__tar.gz → 0.11.0.dev5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/MANIFEST.in +1 -2
  2. pymoca-0.11.0.dev5/PKG-INFO +155 -0
  3. pymoca-0.11.0.dev5/README.md +77 -0
  4. pymoca-0.11.0.dev5/branding/icons/pymocalogo.svg +336 -0
  5. pymoca-0.11.0.dev5/pyproject.toml +77 -0
  6. pymoca-0.11.0.dev5/setup.cfg +19 -0
  7. pymoca-0.11.0.dev5/src/pymoca/__init__.py +3 -0
  8. pymoca-0.11.0.dev5/src/pymoca/_version.py +683 -0
  9. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/ast.py +202 -134
  10. pymoca-0.11.0.dev5/src/pymoca/backends/casadi/_options.py +42 -0
  11. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/alias_relation.py +2 -2
  12. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/api.py +155 -123
  13. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/generator.py +260 -174
  14. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/model.py +443 -206
  15. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/mtensor.py +8 -1
  16. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/sympy/generator.py +53 -50
  17. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/sympy/runtime.py +35 -27
  18. pymoca-0.11.0.dev5/src/pymoca/backends/xml/ModelicaXML/schemas/Equation_Statement_separate.xsd +156 -0
  19. pymoca-0.11.0.dev5/src/pymoca/backends/xml/ModelicaXML/schemas/Expression.xsd +129 -0
  20. pymoca-0.11.0.dev5/src/pymoca/backends/xml/ModelicaXML/schemas/Modelica.xsd +38 -0
  21. pymoca-0.11.0.dev5/src/pymoca/backends/xml/ModelicaXML/schemas/Types.xsd +139 -0
  22. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/analysis.py +9 -8
  23. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/generator.py +35 -56
  24. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/model.py +52 -41
  25. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/parser.py +126 -135
  26. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/sim_scipy.py +58 -56
  27. pymoca-0.11.0.dev5/src/pymoca/generated/ModelicaLexer.py +7261 -0
  28. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/generated/ModelicaListener.py +261 -347
  29. pymoca-0.11.0.dev5/src/pymoca/generated/ModelicaParser.py +15653 -0
  30. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/generated/ModelicaVisitor.py +134 -234
  31. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/parser.py +405 -99
  32. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/tree.py +344 -181
  33. pymoca-0.11.0.dev5/src/pymoca.egg-info/PKG-INFO +155 -0
  34. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca.egg-info/SOURCES.txt +6 -3
  35. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca.egg-info/requires.txt +4 -8
  36. pymoca-0.10.0.dev6/PKG-INFO +0 -46
  37. pymoca-0.10.0.dev6/README.md +0 -50
  38. pymoca-0.10.0.dev6/java/antlr-4.7-complete.jar +0 -0
  39. pymoca-0.10.0.dev6/setup.cfg +0 -45
  40. pymoca-0.10.0.dev6/setup.py +0 -140
  41. pymoca-0.10.0.dev6/src/pymoca/__init__.py +0 -4
  42. pymoca-0.10.0.dev6/src/pymoca/_version.py +0 -21
  43. pymoca-0.10.0.dev6/src/pymoca/backends/casadi/_options.py +0 -42
  44. pymoca-0.10.0.dev6/src/pymoca/generated/ModelicaLexer.py +0 -510
  45. pymoca-0.10.0.dev6/src/pymoca/generated/ModelicaParser.py +0 -7812
  46. pymoca-0.10.0.dev6/src/pymoca.egg-info/PKG-INFO +0 -46
  47. pymoca-0.10.0.dev6/versioneer.py +0 -1822
  48. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/LICENSE +0 -0
  49. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/.gitignore +0 -0
  50. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/Makefile +0 -0
  51. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/make.bat +0 -0
  52. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/source/modules.rst +0 -0
  53. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/source/pymoca.generated.rst +0 -0
  54. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/source/pymoca.rst +0 -0
  55. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/doc/source/setup.rst +0 -0
  56. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/Modelica.g4 +0 -0
  57. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/__init__.py +0 -0
  58. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/casadi/__init__.py +0 -0
  59. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/sympy/__init__.py +0 -0
  60. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/backends/xml/__init__.py +0 -0
  61. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca/generated/__init__.py +0 -0
  62. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca.egg-info/dependency_links.txt +0 -0
  63. {pymoca-0.10.0.dev6 → pymoca-0.11.0.dev5}/src/pymoca.egg-info/top_level.txt +0 -0
@@ -1,8 +1,7 @@
1
1
  include LICENSE
2
2
  include README.md
3
+ include branding/icons/pymocalogo.svg
3
4
  recursive-include doc *
4
- recursive-include java *
5
- include versioneer.py
6
5
  include src/pymoca/_version.py
7
6
  include src/pymoca/Modelica.g4
8
7
  include src/pymoca/backends/xml/ModelicaXML/schemas/*.xsd
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.1
2
+ Name: pymoca
3
+ Version: 0.11.0.dev5
4
+ Summary: A Modelica to computer algebra system (CAS) translator.
5
+ Author: Pymoca Contributors
6
+ Maintainer-email: Jack Vreeken <jack@vreeken.me>, Kent Rutan <gs1150e@icloud.com>
7
+ License: Copyright (c) 2016-2021, James Goppert and the Pymoca contributors.
8
+ All rights reserved.
9
+
10
+ Redistribution and use in source and binary forms, with or without
11
+ modification, are permitted provided that the following conditions are met:
12
+
13
+ * Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+
16
+ * Redistributions in binary form must reproduce the above copyright notice,
17
+ this list of conditions and the following disclaimer in the documentation
18
+ and/or other materials provided with the distribution.
19
+
20
+ * Neither the name of pymoca nor the names of its
21
+ contributors may be used to endorse or promote products derived from
22
+ this software without specific prior written permission.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+
36
+ Project-URL: homepage, https://github.com/pymoca/pymoca
37
+ Keywords: modelica,simulation,compiler
38
+ Classifier: Development Status :: 3 - Alpha
39
+ Classifier: Intended Audience :: Science/Research
40
+ Classifier: Intended Audience :: Developers
41
+ Classifier: License :: OSI Approved :: BSD License
42
+ Classifier: Programming Language :: Python
43
+ Classifier: Programming Language :: Python :: 3
44
+ Classifier: Programming Language :: Other
45
+ Classifier: Topic :: Software Development
46
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
47
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
48
+ Classifier: Topic :: Scientific/Engineering :: Physics
49
+ Classifier: Topic :: Scientific/Engineering :: Visualization
50
+ Classifier: Operating System :: Microsoft :: Windows
51
+ Classifier: Operating System :: POSIX
52
+ Classifier: Operating System :: Unix
53
+ Classifier: Operating System :: MacOS
54
+ Classifier: Topic :: Software Development :: Code Generators
55
+ Classifier: Topic :: Software Development :: Compilers
56
+ Classifier: Topic :: Software Development :: Embedded Systems
57
+ Requires-Python: >=3.9
58
+ Description-Content-Type: text/markdown
59
+ License-File: LICENSE
60
+ Requires-Dist: numpy>=1.8.2
61
+ Requires-Dist: antlr4-python3-runtime==4.13.*
62
+ Provides-Extra: casadi
63
+ Requires-Dist: casadi>=3.4.0; extra == "casadi"
64
+ Requires-Dist: setuptools>=60.0.0; extra == "casadi"
65
+ Provides-Extra: lxml
66
+ Requires-Dist: lxml>=3.5.0; extra == "lxml"
67
+ Requires-Dist: scipy>=0.13.3; extra == "lxml"
68
+ Provides-Extra: sympy
69
+ Requires-Dist: sympy>=0.7.6.1; extra == "sympy"
70
+ Requires-Dist: scipy>=0.13.3; extra == "sympy"
71
+ Requires-Dist: jinja2>=2.10.1; extra == "sympy"
72
+ Provides-Extra: examples
73
+ Requires-Dist: jupyterlab; extra == "examples"
74
+ Requires-Dist: matplotlib; extra == "examples"
75
+ Requires-Dist: control<=0.10.0,>=0.9.3.post2; extra == "examples"
76
+ Provides-Extra: all
77
+ Requires-Dist: pymoca[casadi,examples,lxml,sympy]; extra == "all"
78
+
79
+ # <img alt="Pymoca" src="branding/icons/pymocalogo.svg" height="60">
80
+
81
+ A Modelica to computer algebra system (CAS) translator written in Python.
82
+
83
+ [![CI](https://github.com/pymoca/pymoca/workflows/CI/badge.svg)](https://github.com/pymoca/pymoca/actions?query=workflow%3ACI)
84
+ [![Coverage](https://codecov.io/gh/pymoca/pymoca/branch/master/graph/badge.svg)](https://codecov.io/gh/pymoca/pymoca)
85
+ [![DOI](https://zenodo.org/badge/20664755.svg)](https://zenodo.org/badge/latestdoi/20664755)
86
+
87
+ ## Overview
88
+ Pymoca can be used in applications that need to translate [Modelica](https://modelica.org) mathematical models into other forms. Pymoca can "flatten" a model containing a connected set of components defined by object-oriented Modelica classes into a set of variables and simultaneous equations that are easier to further process for analysis or simulation. It is particularly suited to provide Modelica models in symbolic form to [computer algebra systems](https://en.wikipedia.org/wiki/Computer_algebra_system). A common use in this context is to provide differential and algebraic equations for use in [optimal control problems](https://en.wikipedia.org/wiki/Optimal_control). Pymoca can translate Modelica to [CasADi](https://web.casadi.org), [SymPy](https://www.sympy.org), and [ModelicaXML](https://github.com/modelica-association/ModelicaXML), but most development and usage has been with CasADi.
89
+
90
+ ## Install
91
+
92
+ For parser support without backend dependencies:
93
+ ```bash
94
+ pip install pymoca
95
+ ```
96
+
97
+ Other options are:
98
+ ```bash
99
+ pip install "pymoca[casadi]" # CasADi backend dependencies
100
+ pip install "pymoca[sympy]" # SymPy backend dependencies
101
+ pip install "pymoca[lxml]" # ModelicaXML backend dependencies
102
+
103
+ pip install "pymoca[examples]" # To run Jupyter notebook examples in the repo
104
+
105
+ pip install "pymoca[all]" # All of the above
106
+ ```
107
+
108
+ ## Usage
109
+
110
+ Pymoca reads and understands Modelica code (`pymoca.parser`) and provides access to an internal representation of the code called an Abstract Syntax Tree or AST (`pymoca.ast`). The AST is further processed to generate output in various formats (`pymoca.backends`). The `pymoca.tree` module provides functionality to transform the AST into a form that can be more easily used by the backends to generate the target output. In particular, `pymoca.tree` provides classes and functions to convert a hierarchical, object-oriented Modelica model of connected components into a "flat" system of equations and associated variables, parameters, and constants. Pymoca error checking is not always complete or easy to understand, so it is better to develop the Modelica code with other tools and then use Pymoca for translation.
111
+
112
+ The [test suite](test) contains examples showing how to use Pymoca and the subset of Modelica that it currently supports.
113
+
114
+ Here is an example using a simple spring and damper model from the test suite:
115
+
116
+ ```Python
117
+ from pprint import pprint
118
+
119
+ import pymoca.parser
120
+ import pymoca.backends.casadi.generator as casadi_backend
121
+
122
+
123
+ MODELICA_MODEL = """
124
+ model Spring
125
+ Real x, v_x;
126
+ parameter Real c = 0.1;
127
+ parameter Real k = 2;
128
+ equation
129
+ der(x) = v_x;
130
+ der(v_x) = -k*x - c*v_x;
131
+ end Spring;
132
+ """
133
+
134
+ print("Modelica Model:\n", MODELICA_MODEL)
135
+
136
+ print("\nEquations from the parsed AST in a JSON representation:")
137
+ ast = pymoca.parser.parse(MODELICA_MODEL)
138
+ pprint(ast.to_json(ast.classes["Spring"].equations))
139
+
140
+ print("\nGenerated CasADi model:")
141
+ casadi_model = casadi_backend.generate(ast, "Spring")
142
+ print(casadi_model)
143
+ ```
144
+
145
+ Some more interesting examples are in Jupyter notebooks:
146
+
147
+ * [Casadi Example](test/notebooks/Casadi.ipynb)
148
+ * [Sympy Example](test/notebooks/Spring.ipynb)
149
+
150
+ ## Roadmap
151
+
152
+ See the [GitHub Projects](https://github.com/orgs/pymoca/projects) for plans. In particular, see the [Info Panel in the Modelica Flattening project](https://github.com/orgs/pymoca/projects/1/views/1?pane=info) for an overview of a project getting some current focus. Breaking API changes are expected.
153
+
154
+ <!--- vim:ts=4:sw=4:expandtab:
155
+ !-->
@@ -0,0 +1,77 @@
1
+ # <img alt="Pymoca" src="branding/icons/pymocalogo.svg" height="60">
2
+
3
+ A Modelica to computer algebra system (CAS) translator written in Python.
4
+
5
+ [![CI](https://github.com/pymoca/pymoca/workflows/CI/badge.svg)](https://github.com/pymoca/pymoca/actions?query=workflow%3ACI)
6
+ [![Coverage](https://codecov.io/gh/pymoca/pymoca/branch/master/graph/badge.svg)](https://codecov.io/gh/pymoca/pymoca)
7
+ [![DOI](https://zenodo.org/badge/20664755.svg)](https://zenodo.org/badge/latestdoi/20664755)
8
+
9
+ ## Overview
10
+ Pymoca can be used in applications that need to translate [Modelica](https://modelica.org) mathematical models into other forms. Pymoca can "flatten" a model containing a connected set of components defined by object-oriented Modelica classes into a set of variables and simultaneous equations that are easier to further process for analysis or simulation. It is particularly suited to provide Modelica models in symbolic form to [computer algebra systems](https://en.wikipedia.org/wiki/Computer_algebra_system). A common use in this context is to provide differential and algebraic equations for use in [optimal control problems](https://en.wikipedia.org/wiki/Optimal_control). Pymoca can translate Modelica to [CasADi](https://web.casadi.org), [SymPy](https://www.sympy.org), and [ModelicaXML](https://github.com/modelica-association/ModelicaXML), but most development and usage has been with CasADi.
11
+
12
+ ## Install
13
+
14
+ For parser support without backend dependencies:
15
+ ```bash
16
+ pip install pymoca
17
+ ```
18
+
19
+ Other options are:
20
+ ```bash
21
+ pip install "pymoca[casadi]" # CasADi backend dependencies
22
+ pip install "pymoca[sympy]" # SymPy backend dependencies
23
+ pip install "pymoca[lxml]" # ModelicaXML backend dependencies
24
+
25
+ pip install "pymoca[examples]" # To run Jupyter notebook examples in the repo
26
+
27
+ pip install "pymoca[all]" # All of the above
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ Pymoca reads and understands Modelica code (`pymoca.parser`) and provides access to an internal representation of the code called an Abstract Syntax Tree or AST (`pymoca.ast`). The AST is further processed to generate output in various formats (`pymoca.backends`). The `pymoca.tree` module provides functionality to transform the AST into a form that can be more easily used by the backends to generate the target output. In particular, `pymoca.tree` provides classes and functions to convert a hierarchical, object-oriented Modelica model of connected components into a "flat" system of equations and associated variables, parameters, and constants. Pymoca error checking is not always complete or easy to understand, so it is better to develop the Modelica code with other tools and then use Pymoca for translation.
33
+
34
+ The [test suite](test) contains examples showing how to use Pymoca and the subset of Modelica that it currently supports.
35
+
36
+ Here is an example using a simple spring and damper model from the test suite:
37
+
38
+ ```Python
39
+ from pprint import pprint
40
+
41
+ import pymoca.parser
42
+ import pymoca.backends.casadi.generator as casadi_backend
43
+
44
+
45
+ MODELICA_MODEL = """
46
+ model Spring
47
+ Real x, v_x;
48
+ parameter Real c = 0.1;
49
+ parameter Real k = 2;
50
+ equation
51
+ der(x) = v_x;
52
+ der(v_x) = -k*x - c*v_x;
53
+ end Spring;
54
+ """
55
+
56
+ print("Modelica Model:\n", MODELICA_MODEL)
57
+
58
+ print("\nEquations from the parsed AST in a JSON representation:")
59
+ ast = pymoca.parser.parse(MODELICA_MODEL)
60
+ pprint(ast.to_json(ast.classes["Spring"].equations))
61
+
62
+ print("\nGenerated CasADi model:")
63
+ casadi_model = casadi_backend.generate(ast, "Spring")
64
+ print(casadi_model)
65
+ ```
66
+
67
+ Some more interesting examples are in Jupyter notebooks:
68
+
69
+ * [Casadi Example](test/notebooks/Casadi.ipynb)
70
+ * [Sympy Example](test/notebooks/Spring.ipynb)
71
+
72
+ ## Roadmap
73
+
74
+ See the [GitHub Projects](https://github.com/orgs/pymoca/projects) for plans. In particular, see the [Info Panel in the Modelica Flattening project](https://github.com/orgs/pymoca/projects/1/views/1?pane=info) for an overview of a project getting some current focus. Breaking API changes are expected.
75
+
76
+ <!--- vim:ts=4:sw=4:expandtab:
77
+ !-->
@@ -0,0 +1,336 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
6
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
7
+ xmlns:cc="http://creativecommons.org/ns#"
8
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
9
+ xmlns:svg="http://www.w3.org/2000/svg"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ xmlns:xlink="http://www.w3.org/1999/xlink"
12
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
13
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
14
+ version="1.0"
15
+ id="svg2"
16
+ sodipodi:version="0.32"
17
+ inkscape:version="0.91 r13725"
18
+ sodipodi:docname="Pymocalogoicon.svg"
19
+ width="272.35025pt"
20
+ height="81.046288pt"
21
+ inkscape:export-filename="/home/wees/Desktop/pymoca_logo_plain2.png"
22
+ inkscape:export-xdpi="90"
23
+ inkscape:export-ydpi="90">
24
+ <metadata
25
+ id="metadata371">
26
+ <rdf:RDF>
27
+ <cc:Work
28
+ rdf:about="">
29
+ <dc:format>image/svg+xml</dc:format>
30
+ <dc:type
31
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
32
+ <dc:title></dc:title>
33
+ </cc:Work>
34
+ </rdf:RDF>
35
+ </metadata>
36
+ <sodipodi:namedview
37
+ inkscape:window-height="1018"
38
+ inkscape:window-width="1920"
39
+ inkscape:pageshadow="2"
40
+ inkscape:pageopacity="0.0"
41
+ guidetolerance="10.0"
42
+ gridtolerance="10.0"
43
+ objecttolerance="10.0"
44
+ borderopacity="1.0"
45
+ bordercolor="#666666"
46
+ pagecolor="#ffffff"
47
+ id="base"
48
+ inkscape:zoom="0.70710678"
49
+ inkscape:cx="-293.726"
50
+ inkscape:cy="-220.14679"
51
+ inkscape:window-x="1358"
52
+ inkscape:window-y="-8"
53
+ inkscape:current-layer="svg2"
54
+ width="210mm"
55
+ height="40mm"
56
+ units="mm"
57
+ showgrid="false"
58
+ inkscape:snap-intersection-paths="true"
59
+ inkscape:object-paths="true"
60
+ inkscape:object-nodes="true"
61
+ inkscape:snap-smooth-nodes="true"
62
+ inkscape:snap-midpoints="true"
63
+ inkscape:snap-bbox="true"
64
+ inkscape:snap-object-midpoints="true"
65
+ inkscape:bbox-paths="true"
66
+ inkscape:snap-nodes="false"
67
+ inkscape:window-maximized="1"
68
+ inkscape:snap-others="false"
69
+ fit-margin-top="1"
70
+ fit-margin-left="1"
71
+ fit-margin-right="1"
72
+ fit-margin-bottom="1" />
73
+ <defs
74
+ id="defs4">
75
+ <linearGradient
76
+ id="linearGradient4689">
77
+ <stop
78
+ id="stop5663"
79
+ offset="0"
80
+ style="stop-color:#5a9fd4;stop-opacity:1;" />
81
+ <stop
82
+ id="stop5665"
83
+ offset="1"
84
+ style="stop-color:#306998;stop-opacity:1;" />
85
+ </linearGradient>
86
+ <linearGradient
87
+ inkscape:collect="always"
88
+ id="linearGradient5645"
89
+ osb:paint="gradient">
90
+ <stop
91
+ style="stop-color:#5294c8;stop-opacity:1;"
92
+ offset="0"
93
+ id="stop5647" />
94
+ <stop
95
+ style="stop-color:#5294c8;stop-opacity:0;"
96
+ offset="1"
97
+ id="stop5649" />
98
+ </linearGradient>
99
+ <linearGradient
100
+ inkscape:collect="always"
101
+ id="linearGradient4199">
102
+ <stop
103
+ style="stop-color:#000000;stop-opacity:1;"
104
+ offset="0"
105
+ id="stop4201" />
106
+ <stop
107
+ style="stop-color:#000000;stop-opacity:0;"
108
+ offset="1"
109
+ id="stop4203" />
110
+ </linearGradient>
111
+ <linearGradient
112
+ id="linearGradient4206">
113
+ <stop
114
+ style="stop-color:#ffc334;stop-opacity:1"
115
+ offset="0"
116
+ id="stop4208" />
117
+ <stop
118
+ style="stop-color:#ffe873;stop-opacity:1"
119
+ offset="1"
120
+ id="stop4210" />
121
+ </linearGradient>
122
+ <linearGradient
123
+ id="linearGradient4980">
124
+ <stop
125
+ id="stop4982"
126
+ offset="0"
127
+ style="stop-color:#ffc334;stop-opacity:1" />
128
+ <stop
129
+ id="stop4984"
130
+ offset="1"
131
+ style="stop-color:#ffe873;stop-opacity:1" />
132
+ </linearGradient>
133
+ <linearGradient
134
+ id="linearGradient4974">
135
+ <stop
136
+ id="stop4976"
137
+ offset="0"
138
+ style="stop-color:#ffc334;stop-opacity:1" />
139
+ <stop
140
+ id="stop4978"
141
+ offset="1"
142
+ style="stop-color:#ffe873;stop-opacity:1" />
143
+ </linearGradient>
144
+ <linearGradient
145
+ id="linearGradient4968">
146
+ <stop
147
+ id="stop4970"
148
+ offset="0"
149
+ style="stop-color:#ffda3a;stop-opacity:1" />
150
+ <stop
151
+ id="stop4972"
152
+ offset="1"
153
+ style="stop-color:#ffe873;stop-opacity:1" />
154
+ </linearGradient>
155
+ <linearGradient
156
+ id="linearGradient2795">
157
+ <stop
158
+ style="stop-color:#b8b8b8;stop-opacity:0.49803922;"
159
+ offset="0"
160
+ id="stop2797" />
161
+ <stop
162
+ style="stop-color:#7f7f7f;stop-opacity:0;"
163
+ offset="1"
164
+ id="stop2799" />
165
+ </linearGradient>
166
+ <linearGradient
167
+ id="linearGradient4671">
168
+ <stop
169
+ style="stop-color:#ffd43b;stop-opacity:1;"
170
+ offset="0"
171
+ id="stop4673" />
172
+ <stop
173
+ style="stop-color:#ffe873;stop-opacity:1"
174
+ offset="1"
175
+ id="stop4675" />
176
+ </linearGradient>
177
+ <linearGradient
178
+ id="linearGradient5667">
179
+ <stop
180
+ style="stop-color:#5a9fd4;stop-opacity:1;"
181
+ offset="0"
182
+ id="stop4691" />
183
+ <stop
184
+ style="stop-color:#306998;stop-opacity:1;"
185
+ offset="1"
186
+ id="stop4693" />
187
+ </linearGradient>
188
+ <linearGradient
189
+ inkscape:collect="always"
190
+ xlink:href="#linearGradient4689"
191
+ id="linearGradient4617"
192
+ gradientUnits="userSpaceOnUse"
193
+ gradientTransform="matrix(0.58343394,0,0,0.54612692,-17.894821,-1.7421448)"
194
+ x1="406.60007"
195
+ y1="107.55585"
196
+ x2="284.98608"
197
+ y2="163.11092" />
198
+ <linearGradient
199
+ inkscape:collect="always"
200
+ xlink:href="#linearGradient4968"
201
+ id="linearGradient4950"
202
+ gradientUnits="userSpaceOnUse"
203
+ gradientTransform="matrix(0.562541,0,0,0.567972,-9.399749,-5.305317)"
204
+ x1="308.90121"
205
+ y1="192.35176"
206
+ x2="262.97415"
207
+ y2="194.03658" />
208
+ <linearGradient
209
+ inkscape:collect="always"
210
+ xlink:href="#linearGradient4206"
211
+ id="linearGradient4960"
212
+ gradientUnits="userSpaceOnUse"
213
+ gradientTransform="matrix(0.562541,0,0,0.567972,-9.399749,-5.305317)"
214
+ x1="348.44852"
215
+ y1="135.56718"
216
+ x2="336.11029"
217
+ y2="84.32283" />
218
+ <linearGradient
219
+ inkscape:collect="always"
220
+ xlink:href="#linearGradient4974"
221
+ id="linearGradient4962"
222
+ gradientUnits="userSpaceOnUse"
223
+ gradientTransform="matrix(0.562541,0,0,0.567972,-9.399749,-5.305317)"
224
+ x1="348.44852"
225
+ y1="135.56718"
226
+ x2="336.11029"
227
+ y2="84.32283" />
228
+ <linearGradient
229
+ inkscape:collect="always"
230
+ xlink:href="#linearGradient4980"
231
+ id="linearGradient4964"
232
+ gradientUnits="userSpaceOnUse"
233
+ gradientTransform="matrix(0.562541,0,0,0.567972,-9.399749,-5.305317)"
234
+ x1="348.44852"
235
+ y1="135.56718"
236
+ x2="336.11029"
237
+ y2="84.32283" />
238
+ <linearGradient
239
+ inkscape:collect="always"
240
+ xlink:href="#linearGradient4689"
241
+ id="linearGradient4198"
242
+ gradientUnits="userSpaceOnUse"
243
+ gradientTransform="matrix(0.58343394,0,0,0.54612692,-17.894821,-17.62437)"
244
+ x1="406.60007"
245
+ y1="136.95195"
246
+ x2="285.26132"
247
+ y2="191.78731" />
248
+ <radialGradient
249
+ inkscape:collect="always"
250
+ xlink:href="#linearGradient4199"
251
+ id="radialGradient4205"
252
+ cx="227.98499"
253
+ cy="56.396729"
254
+ fx="227.98499"
255
+ fy="56.396729"
256
+ r="104.83887"
257
+ gradientTransform="matrix(1,0,0,0.26505519,0,41.448483)"
258
+ gradientUnits="userSpaceOnUse" />
259
+ <linearGradient
260
+ inkscape:collect="always"
261
+ xlink:href="#linearGradient5667"
262
+ id="linearGradient5659"
263
+ x1="123.14611"
264
+ y1="56.396729"
265
+ x2="332.82385"
266
+ y2="56.396729"
267
+ gradientUnits="userSpaceOnUse" />
268
+ </defs>
269
+ <g
270
+ id="g4562-7"
271
+ transform="matrix(1.5568422,0,0,1.736926,-229.01857,-97.594068)">
272
+ <g
273
+ id="g4818-5" />
274
+ </g>
275
+ <g
276
+ id="g4562"
277
+ transform="matrix(1.5568422,0,0,1.736926,-229.01857,-70.007819)">
278
+ <g
279
+ id="g4818">
280
+ <g
281
+ id="g4213">
282
+ <rect
283
+ y="57.061661"
284
+ x="148.67363"
285
+ height="14.393244"
286
+ width="70.655846"
287
+ id="rect3721-6-3"
288
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4198);fill-opacity:1;fill-rule:nonzero;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
289
+ ry="0" />
290
+ <rect
291
+ y="72.943886"
292
+ x="148.67363"
293
+ height="14.393244"
294
+ width="70.655846"
295
+ id="rect3721-6"
296
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4617);fill-opacity:1;fill-rule:nonzero;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
297
+ ry="0" />
298
+ </g>
299
+ </g>
300
+ </g>
301
+ <g
302
+ id="g4935"
303
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4950);fill-opacity:1;fill-rule:nonzero;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
304
+ transform="matrix(1.6784641,0,0,1.6784641,-253.14727,-64.901928)">
305
+ <path
306
+ sodipodi:nodetypes="ccccscc"
307
+ id="path1950-7-2"
308
+ d="m 167.04474,50.303207 c 1.35663,-3.545181 6.46718,-4.695077 10.96059,-5.201647 8.87679,-1.030861 3.71811,8.215412 1.10945,14.681838 L 167.26027,92.84086 c -1.36196,3.54318 -6.59333,4.8913 -10.96834,5.18543 -7.64269,0.51377 -3.80572,-7.89169 -1.08773,-14.68346 z"
309
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4960);fill-opacity:1;fill-rule:nonzero;stroke:#e5bd00;stroke-width:0.46351901;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
310
+ inkscape:connector-curvature="0" />
311
+ <path
312
+ sodipodi:nodetypes="csccscc"
313
+ id="path1950-7-2-6-3-6"
314
+ d="m 184.87941,92.835153 c -1.36196,3.543177 -6.59333,4.891297 -10.96834,5.185427 -7.64269,0.51377 -3.80572,-7.891687 -1.08773,-14.683457 l 11.66987,-32.978569 c 1.34047,-3.551359 6.56358,-4.93114 10.93673,-5.251761 7.63943,-0.560093 3.85345,7.868492 1.17664,14.676605 z"
315
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4962);fill-opacity:1;fill-rule:nonzero;stroke:#e5bd00;stroke-width:0.46351901;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
316
+ inkscape:connector-curvature="0" />
317
+ <path
318
+ sodipodi:nodetypes="ccccscccsccccscc"
319
+ id="path1950-4"
320
+ d="m 203.65666,45.923027 0.0628,-0.08283 c 0.83017,-2.501501 2.37198,-4.483825 5.15058,-5.334721 3.32736,-1.018536 6.52652,-1.231686 10.53357,-0.117087 2.6635,0.739157 5.29873,2.257077 5.3325,5.300325 l 0.0446,4.019203 -8.0156,0.06575 -14.38253,43.061486 c -1.36196,3.543177 -6.59333,4.891297 -10.96834,5.185427 -7.64269,0.51377 -3.80572,-7.891687 -1.08773,-14.683457 z m 16.48506,1.156663 c 1.09323,-0.01215 1.96893,-0.917763 1.95662,-2.025464 -0.0123,-1.111685 -0.90808,-2.005931 -2.00129,-1.99376 -1.0893,0.01211 -1.96883,0.926098 -1.95647,2.03777 0.0124,1.107697 0.91185,1.993583 2.00114,1.981454 z"
321
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4964);fill-opacity:1;fill-rule:nonzero;stroke:#e5bd00;stroke-width:0.46351901;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
322
+ inkscape:connector-curvature="0" />
323
+ </g>
324
+ <text
325
+ xml:space="preserve"
326
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#4e90c3;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
327
+ x="127.07842"
328
+ y="73.679176"
329
+ id="text4178"
330
+ sodipodi:linespacing="125%"><tspan
331
+ sodipodi:role="line"
332
+ id="tspan4180"
333
+ x="127.07842"
334
+ y="73.679176"
335
+ style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:60px;font-family:Arial;-inkscape-font-specification:'Arial Bold Italic';fill:#4e90c3;fill-opacity:1;stroke:none;stroke-opacity:1">Pymoca</tspan></text>
336
+ </svg>
@@ -0,0 +1,77 @@
1
+ [build-system]
2
+ requires = ["setuptools", "versioneer[toml]==0.29"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pymoca"
7
+ dynamic = ["version"]
8
+ license = { file = "LICENSE" }
9
+ description = "A Modelica to computer algebra system (CAS) translator."
10
+ keywords = ["modelica", "simulation", "compiler"]
11
+ readme = "README.md"
12
+ authors = [{ name = "Pymoca Contributors" }]
13
+ maintainers = [
14
+ { name = "Jack Vreeken", email = "jack@vreeken.me" },
15
+ { name = "Kent Rutan", email = "gs1150e@icloud.com" },
16
+ ]
17
+ requires-python = ">=3.9"
18
+ dependencies = ["numpy >= 1.8.2", "antlr4-python3-runtime == 4.13.*"]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Intended Audience :: Science/Research",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: BSD License",
24
+ "Programming Language :: Python",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Other",
27
+ "Topic :: Software Development",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
+ "Topic :: Scientific/Engineering :: Mathematics",
30
+ "Topic :: Scientific/Engineering :: Physics",
31
+ "Topic :: Scientific/Engineering :: Visualization",
32
+ "Operating System :: Microsoft :: Windows",
33
+ "Operating System :: POSIX",
34
+ "Operating System :: Unix",
35
+ "Operating System :: MacOS",
36
+ "Topic :: Software Development :: Code Generators",
37
+ "Topic :: Software Development :: Compilers",
38
+ "Topic :: Software Development :: Embedded Systems",
39
+ ]
40
+
41
+ [project.urls]
42
+ homepage = "https://github.com/pymoca/pymoca"
43
+
44
+ [project.optional-dependencies]
45
+ # Note that we need setuptools for the distutils.ccompiler dependency
46
+ # in the CasADi backend.
47
+ casadi = ["casadi>=3.4.0", "setuptools>=60.0.0"]
48
+ lxml = ["lxml>=3.5.0", "scipy>=0.13.3"]
49
+ sympy = ["sympy>=0.7.6.1", "scipy>=0.13.3", "jinja2>=2.10.1"]
50
+ examples = ["jupyterlab", "matplotlib", "control>=0.9.3.post2,<=0.10.0"]
51
+ all = ["pymoca[casadi,lxml,sympy,examples]"]
52
+
53
+ [tool.setuptools.dynamic]
54
+ version = { attr = "pymoca.__version__" }
55
+
56
+ # See the docstring in versioneer.py for instructions. Note that after changing
57
+ # this section, run `versioneer install --no-vendor`, commit the results.
58
+
59
+ [tool.versioneer]
60
+ VCS = "git"
61
+ style = "pep440"
62
+ versionfile_source = "src/pymoca/_version.py"
63
+ versionfile_build = "pymoca/_version.py"
64
+ tag_prefix = ""
65
+ parentdir_prefix = "pymoca-"
66
+
67
+ [tool.black]
68
+ line-length = 100
69
+ target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
70
+ force-exclude = '''
71
+ (
72
+ src/pymoca/generated
73
+ | src/pymoca/_version.py
74
+ | test/generated
75
+ | test/libraries
76
+ )
77
+ '''
@@ -0,0 +1,19 @@
1
+ [metadata]
2
+ license_file = LICENSE
3
+
4
+ [flake8]
5
+ max-line-length = 100
6
+ exclude =
7
+ src/pymoca/generated,
8
+ src/pymoca/_version.py,
9
+ test/generated,
10
+ test/libraries,
11
+ ignore =
12
+ E203,
13
+ W503,
14
+ E501,
15
+
16
+ [egg_info]
17
+ tag_build =
18
+ tag_date = 0
19
+