Skip to content

Commit d1f9e68

Browse files
committed
add Maven exec example to readme
1 parent 0c83b57 commit d1f9e68

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
Very experimental prototype for transpiling [SymPy math expressions (Python)](https://github.com/sympy/sympy) into [Symja math expressions (Java)](https://github.com/axkr/symja_android_library).
2+
3+
With the following Maven command you can run the **SymPy2Symja console** from the command line
4+
5+
```
6+
mvn exec:java@sympy2symja
7+
```
8+
9+
<img src="https://raw.githubusercontent.com/axkr/sympy2symja/master/sympy2symja.png" width="100%"></img>

SympyToSymja/pom.xml

+24-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
</properties>
4949
<dependencies>
5050
<dependency>
51-
<groupId>org.matheclipse</groupId>
51+
<groupId>org.matheclipse</groupId>
5252
<artifactId>matheclipse-core</artifactId>
5353
<version>3.1.0-SNAPSHOT</version>
5454
</dependency>
@@ -76,4 +76,27 @@
7676
<version>4.7.1</version>
7777
</dependency>
7878
</dependencies>
79+
<build>
80+
<pluginManagement>
81+
<plugins>
82+
<plugin>
83+
<groupId>org.codehaus.mojo</groupId>
84+
<artifactId>exec-maven-plugin</artifactId>
85+
<version>3.2.0</version>
86+
<executions>
87+
<execution>
88+
<id>sympy2symja</id>
89+
<goals>
90+
<goal>java</goal>
91+
</goals>
92+
<configuration>
93+
<mainClass>
94+
org.matheclipse.core.sympy2symja.SympyToSymjaExpr</mainClass>
95+
</configuration>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
</plugins>
100+
</pluginManagement>
101+
</build>
79102
</project>

SympyToSymja/src/main/java/org/matheclipse/core/sympy2symja/SympyToSymjaExpr.java

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.matheclipse.core.sympy2symja;
22

33
import java.io.BufferedReader;
4-
import java.io.File;
54
import java.io.IOException;
65
import java.io.InputStreamReader;
76
import java.nio.charset.StandardCharsets;
@@ -47,9 +46,6 @@ public static void main(String[] args) throws Exception {
4746
System.out.println(
4847
"Create a Symja Java string from the SymPy expression input");
4948
F.initSymbols();
50-
String userHome = System.getProperty("user.home");
51-
File sourceLocation =
52-
new File(userHome + "/git/symja_android_library/symja_android_library/doc/functions");
5349
String inputExpression;
5450
String trimmedInput;
5551
while (true) {

sympy2symja.png

136 KB
Loading

0 commit comments

Comments
 (0)