https://github.com/allofphysicsgraph/sympy-in-docker
sympy in Ubuntu
https://github.com/allofphysicsgraph/sympy-in-docker
Last synced: over 1 year ago
JSON representation
sympy in Ubuntu
- Host: GitHub
- URL: https://github.com/allofphysicsgraph/sympy-in-docker
- Owner: allofphysicsgraph
- Created: 2023-06-19T00:48:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T03:14:16.000Z (almost 2 years ago)
- Last Synced: 2025-01-13T14:52:46.703Z (over 1 year ago)
- Language: Python
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SymPy in Docker
Assuming your have `docker` (or, after some editing, `podman`) and `make` installed, to build this container run
```bash
make
```
Once the container exists, Python3 and SymPy are available
```bash
$ docker run -it --rm sympyonubuntu python3 -c 'import sympy; print(sympy.__version__)'
1.12
$ docker run -it --rm sympyonubuntu python3 -c 'import sys; print(sys.version)'
3.8.10 (default, Nov 22 2023, 10:22:35)
```
Run a script
```bash
$ docker run -it --rm -v `pwd`:/scratch --workdir /scratch sympyonubuntu python3 sympy_works.py
sympy: 1.12
x + 2*y
```
```bash
docker run -it --rm sympyonubuntu python3 -c 'import sys; print(sys.version); import sympy; print("sympy:",sympy.__version__); from sympy.parsing.latex import parse_latex; x = parse_latex("a = b"); print(type(x)); print(x)'
3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]
sympy: 1.12
Eq(a, b)
```
Assuming you've copied `examples_of_valid_latex` into the local directory,
```bash
for filename in examples_of_valid_latex/expr*.tex; do
docker run -it --rm -v `pwd`:/scratch --workdir /scratch sympyonubuntu python3 eval_latex.py $filename
done
```
That folder is found in