Skip to content

Commit 64bb368

Browse files
committed
Merge branch 'master' into addCatchThrow
2 parents f4686d0 + 7e9519e commit 64bb368

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+14320
-2249
lines changed

.github/workflows/basic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Mathics (basic)
1+
name: Mathics (ubuntu)
22

33
on:
44
push:
@@ -29,4 +29,4 @@ jobs:
2929
- name: Test Mathics
3030
run: |
3131
pip install pytest pexpect
32-
make check
32+
make -j3 check

.github/workflows/osx.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Mathics (OSX)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
os: [macOS]
15+
python-version: [3.6, 3.7, 3.8]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
# brew install liblapack-dev llvm-dev
25+
python -m pip install --upgrade pip
26+
- name: Install Mathics
27+
run: |
28+
sed -i "s/'sympy==[0-9]\.[0-9]\.[0-9]', //" setup.py
29+
make
30+
- name: Test Mathics
31+
run: |
32+
pip install pytest pexpect
33+
make -j3 check

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: bionic
22
language: python
33
python:
44
- 3.8
5-
- pypy3.6-7.3.1
5+
# - pypy3.6-7.3.1
66
matrix:
77
fast_finish: true
88
include:
@@ -14,18 +14,16 @@ services:
1414
- xvfb
1515
before_install:
1616
- sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-10 llvm-10-dev
17-
- sudo apt-get install -qq gfortran
18-
- sudo apt-get install -qq texlive-font-utils latexmk texlive-xetex lmodern inkscape
19-
- sudo apt-get install -qq texlive-latex-extra texlive-fonts-recommended asymptote
17+
- sudo apt-get install -qq gfortran texlive-font-utils latexmk texlive-xetex lmodern inkscape texlive-latex-extra texlive-fonts-recommended asymptote
2018
- LLVM_CONFIG=/usr/bin/llvm-config-10 CXXFLAGS=-fPIC python -m pip install llvmlite
21-
- pip install ipywidgets ipykernel requests IPython==5.0.0 langid pycountry pyenchant lxml matplotlib
19+
- pip install ipywidgets ipykernel requests IPython==5.0.0 langid pycountry pyenchant lxml matplotlib unittest2 pexpect
2220
- python travis.py
23-
- pip install cython unittest2 pexpect scikit-image
21+
- pip install cython
2422
install:
2523
- sed -i "s/'sympy==[0-9]\.[0-9]\.[0-9]', //" setup.py
2624
- make develop
2725
script:
28-
- make doc
26+
- make -j3 doc
2927
notifications:
3028
email: false
3129
slack: mathics:VIjdkcZPlA79sOtVOtyjdOcT

CHANGES.rst

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
11
CHANGES
22
=======
33

4-
So we can get onto PyPI, the PyPI install name has changed from Mathics to Mathics3.
4+
1.1.1
5+
-----
6+
7+
This is the last update before some major refactoring and interface changing occurs.
8+
9+
After this relase, Django will no longer be bundled here. See `mathics-django <https://github.com/Mathics3/mathics-django>` for the unbundled replacement.
10+
11+
Some changes were made to support `Pymathics Graph <https://github.com/Mathics3/pymathics-graph>`_, a new graph package bundled separately,
12+
and to support the ability for front-ends to handle rendering on their own.
13+
14+
15+
Package Updates
16+
++++++++++++++++
17+
18+
- sympy 1.7.1
19+
20+
Mathics Packages added:
21+
22+
- ``DiscreteMath`CombinatoricaV0.9`` and
23+
``DiscreteMath`CombinatoricaV0.6``. V0.9 covers Steven Skiena's older "Implementing Discrete Mathematics: Combinatorics and Graph Theory" book.
24+
25+
If you have a package that you would like included in the distribution, and it works with Mathics, please contact us.
26+
27+
28+
29+
New builtins:
30+
++++++++++++++++++++++++++++
31+
32+
- ``StirlingS1``, ``StirlingS2`` (not all WL variations handled)
33+
- ``MapAt`` (not all WL variations handled)
34+
- ``PythonForm``, ``SympyForm`` these is not in WL. It simply will show a crude translation to ``sympy`` or ``python``. Expect more and better translation later
35+
- ``Throw`` and ``Catch``
36+
- ``With``
37+
- Start ``FileNameTake``
38+
39+
Enhancements and Bug fixes:
40+
+++++++++++++++++++++++++++
541

42+
- Workaround for ``Compile`` so it accepts functions ##1026
43+
- Add ``Trace`` option to ``Get``. ``Get["fn", Trace->True]`` will show lines as they are read.
44+
- Add bool for ``from_python``
45+
- Extend ``DeleteCases`` to accept a levelspec parameter.
46+
- Set Evaluation#exc_result to capture ``Aborted``, ``Timeout``, ``Overflow1``, etc.
47+
- ``ImageData`` changed to get bits {0,1} not bools.
48+
- add tokenizer symbols for <-> and -> and the unicode versions of those.
49+
- fix ``Needs``
50+
- ``System`$InputFileName`` is now set inside ``Needs`` and ``Get``
651

752
1.1.0
853
-----

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Welcome to Mathics!
33

44
|Pypi Installs| |Latest Version| |Supported Python Versions| |Travis|_ |SlackStatus|_
55

6+
|Packaging status|
7+
8+
69
Mathics is a general-purpose computer algebra system (CAS). It is an open-source alternative to Mathematica. It is free both as in "free beer" and as in "freedom".
710

811
The home page of Mathics is https://mathics.org.
@@ -49,3 +52,5 @@ Mathics is released under the GNU General Public License Version 3 (GPL3).
4952
:target: https://badge.fury.io/py/Mathics3
5053
.. |Pypi Installs| image:: https://pepy.tech/badge/Mathics3
5154
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/Mathics3.svg
55+
.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/mathics.svg
56+
:target: https://repology.org/project/mathics/versions

docker/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-buster
1+
FROM python:3.8-buster
22

33
ENV MATHICS_HOME=/usr/src/app
44
ENV ENTRYPOINT_COMMAND="docker run -it {MATHICS_IMAGE}"
@@ -10,12 +10,13 @@ RUN chmod +x /entrypoint.sh
1010

1111
COPY requirements.txt ./
1212
RUN apt-get update
13-
RUN apt-get install -qq liblapack-dev llvm-dev gfortran
13+
RUN apt-get install -qq liblapack-dev llvm-dev gfortran maria
1414
RUN pip install --no-cache-dir -r requirements.txt
1515
COPY requirements-mathicsscript.txt ./
1616
RUN pip install --no-cache-dir -r requirements-mathicsscript.txt
1717

1818
RUN pip install pymathics-natlang
19+
RUN pip install mathicsscript
1920
RUN python -m nltk.downloader wordnet omw
2021
RUN python -m spacy download en
2122

docker/entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Arg:
1717
mathics src = /usr/src/app/mathics
1818
--pythonpaht /usr/src/app
1919
20-
-m | --mode {cli|ui} Start mathics in web-ui mode (ui), or in cli mode (cli). Default is cli.
20+
-m | --mode {cli|ui|gui|minimal} Start mathics in web-ui mode (ui or gui), cli mode (cli) or minimal. Default is cli.
2121
See: https://github.com/mathics/Mathics/wiki/Installing#running-mathics
2222
2323
Params:
@@ -48,7 +48,8 @@ echo
4848

4949
case $mathics_mode in
5050
cli) mathicsscript $@ ;;
51-
ui) mathicsserver -e $@ ;;
51+
minimal) mathics $@ ;;
52+
ui | gui) mathicsserver -e $@ ;;
5253
shell) /bin/bash ;;
5354
*) echo "unknown mathics_mode=$mathics_mode. See '$script_cmd --help'" ; exit 2 ;;
5455
esac
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
mathics
1+
click
22
colorama
3+
columnize
4+
networkx
35
pygments
4-
mathicsscript
6+
term-background >= 1.0.1

docker/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sympy>=1.6, < 1.7
1+
sympy>=1.6, <= 1.8dev
22
django >= 3.1.2, < 3.2
33
mpmath>=1.1.0
44
numpy

mathics/builtin/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def is_builtin(var):
6161

6262
# builtins = dict(builtins)
6363

64-
mathics_to_sympy = {}
64+
mathics_to_sympy = {} # here we have: name -> sympy object
65+
mathics_to_python = {} # here we have: name -> string
6566
sympy_to_mathics = {}
6667

6768
box_constructs = {}
@@ -72,6 +73,10 @@ def is_builtin(var):
7273
def add_builtins(new_builtins):
7374
for var_name, builtin in new_builtins:
7475
name = builtin.get_name()
76+
if hasattr(builtin, "python_equivalent"):
77+
# print("XXX", builtin.python_equivalent)
78+
mathics_to_python[name] = builtin.python_equivalent
79+
7580
if isinstance(builtin, SympyObject):
7681
mathics_to_sympy[name] = builtin
7782
for sympy_name in builtin.get_sympy_names():

0 commit comments

Comments
 (0)