Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Jan 21, 2025
2 parents 8ae1e98 + b6eac71 commit c4a373d
Show file tree
Hide file tree
Showing 240 changed files with 14,699 additions and 14,437 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ jobs:
python -m pip install --upgrade pip
- name: Install Mathics3 with full Python dependencies
run: |
# We can comment out after next Mathics-Scanner release
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone https://github.com/Mathics3/mathics-scanner.git
# We can comment out after next Mathics-Scanner release
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
cd ..
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
run: |
sudo apt update -qq && sudo apt install llvm-dev remake
python -m pip install --upgrade pip
# We can comment out after next Mathics-Scanner release
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone https://github.com/Mathics3/mathics-scanner.git
# We can comment out after next Mathics-Scanner release
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
cd ..
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Mathics3 Packages (ubuntu)

on:
push:
branches: [ master ]
pull_request:
branches: '**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install OS dependencies
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev tesseract-ocr remake
- name: Install Mathics3 with full dependencies
run: |
python -m pip install --upgrade pip
# We can comment out after next Mathics-Scanner release
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd src/mathics-scanner/
pip install -e .
python -m mathics_scanner.generate.build_tables
cd ../..
- name: Run Mathics3 Combinatorica tests
run: |
git submodule init
git submodule update
remake -x develop
cd mathics/Packages/Combinatorica-repo
# If Combinatorica repo changes, we may need the below altered
# with a branch name, (not HEAD) for testing.
git pull origin HEAD
pip install -e .[dev]
remake -x check
4 changes: 3 additions & 1 deletion .github/workflows/pyodide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ jobs:
pip install "setuptools>=70.0.0" PyYAML click packaging pytest
git clone https://github.com/Mathics3/mathics-scanner.git
# We can comment out after next Mathics-Scanner release
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install --no-build-isolation -e .
cd ..
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ubuntu-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ jobs:
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev tesseract-ocr
python -m pip install --upgrade pip
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone https://github.com/Mathics3/mathics-scanner.git
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
cd ..
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ jobs:
- name: Install Mathics3 with full dependencies
run: |
python -m pip install --upgrade pip
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone https://github.com/Mathics3/mathics-scanner.git
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
python -m mathics_scanner.generate.build_tables
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ jobs:
set LLVM_DIR="C:\Program Files\LLVM"
- name: Install Mathics3 with Python dependencies
run: |
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone https://github.com/Mathics3/mathics-scanner.git
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner
pip install -e .
python -m mathics_scanner.generate.build_tables
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "mathics/Packages/Combinatorica-repo"]
path = mathics/Packages/Combinatorica-repo
url = https://github.com/Mathics3/Mathics3-Combinatorica.git
[submodule "mathics/Packages/Rubi"]
path = mathics/Packages/Rubi
url = https://github.com/Mathics3/Mathics3-Rubi.git
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ repos:
hooks:
- id: check-merge-conflict
- id: debug-statements
stages: [commit]
stages: [pre-commit]
- id: end-of-file-fixer
stages: [commit]
stages: [pre-commit]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
stages: [commit]
stages: [pre-commit]
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3
stages: [commit]
stages: [pre-commit]
89 changes: 77 additions & 12 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,52 @@
CHANGES
=======

This release is to get out some of the major changes that have gone on
already in advance of redoing Boxing and Formatting.

Operators are now controlled from a new operators YAML table from the
``mathics-scanner`` repository. A pass was made over the Mathics parser
to handle box operators more properly. More work is needed here.

We started adding more debugging capabilites:

* ``Breakpoint[]``
* ``Stack[]``, and
* ``Trace[]``

And in the ``Mathics3-Trepan`` repository:

* ``DebugActivate[]``
* ``Debugger[]``, and
* ``TraceActivate[]``

This code is very much alpha quality, but it greatly improves the
ability to debug problems in loading existing packages written from
Mathematica. So packages ``BoolEval`` and ``CleanSlate`` were added to
the repostiory.

Also as a result of the improved ability to debug Mathics3, we now
provide a version of Rubi 4.17 using git submodules . To use this you
will need a patched version of ``stopit``. Aravindh Krishnamoorthy
led the initial port of Rubi.

David A. Roberts worked on ensuring Mathics3 runs on pyodide and
contributed a number of new Built-in Functions that are found in `The
On-Line Encyclopedia of Integer Sequences (OEIS) <https://oeis.org/>`_


New Builtins
++++++++++++

* ``Between``
* ``Breakpoint`` - forces a Python ``breakpoint()``
* ``CheckAbort``
* ``FileNameDrop``
* ``FormatValues``
* ``SetEnvironment``
* ``SequenceForm``
* ``Stack``
* ``Trace``

By `@davidar <https://github.com/davidar>`_:

Expand Down Expand Up @@ -40,16 +79,18 @@ By `@davidar <https://github.com/davidar>`_:

* ``--post-mortem`` option added which will go into the `trepan3k debugger <https https://pypi.org/project/trepan3k/>`_ on an unrecoverable error.

Compatibility
-------------
WMA Compatibility
-----------------

* ``GetEnvironment`` expanded to handle ``[]`` and ``{var1, var2,...}`` forms
* The system ``packages`` directory has been renamed ``Packages`` to conformance with WMA.
* ``$Path`` now includes a ``Packages`` directory under ``$HOME``.

Internals
---------

Operator precedence has been gone over and is picked up in tables from the Mathics Scanner project.

* Operator information has been gone over and is picked up from JSON
tables produced from the Mathics Scanner project.

Performance
-----------
Expand All @@ -60,17 +101,41 @@ API incompatibility
-------------------

* ``Matcher`` now requires an additional ``evaluation`` parameter
* ``Romberg`` removed as an ``NIntegrate[]`` method. It is depcrecated in SciPy and is to be removed by SciPy 1.15.
* ``Romberg`` removed as an ``NIntegrate[]`` method. It is deprecated in SciPy and is to be removed by SciPy 1.15.
* The signature of the ``Definition.__init__`` now receives a single dict parameter instead of the several `*values` parameters.
* Rule positions in ``Definition.{get|set}_values`` now includes the word ``values``. For example ``pos="up"`` now is ``pos="upvalues"``.
* ``Definitions.get_ownvalue`` now returns a ``BaseElement`` instead of a ``BaseRule`` object.
* Patterns in ``eval_`` and ``format_`` methods of builtin classes
parses patterns in docstrings of the form
``Symbol: Expr`` as ``Pattern[Symbol, Expr]``.
To specify associated format in ``format_`` methods the
docstring, the list of format must be wrapped in parenthesis, like
``(InputForm,): Definitions[...]`` instead of just ``InputForm: Definitions[...]``.



Bugs
----

* Fix infinite recursion when formatting ``Sequence[...]``

Mathics3 Packages
+++++++++++++++++

* Added ``BoolEval``
* Added ``CleanSlate``
* ``Combinatorica`` moved to a separate repository and v.9 renamed to 0.9.1.
More code v0.9.1 works. v2.0 renamed v2.0.1 and some code now works.
* ``Rubi`` version 4.17 (work in progress; algebraic integrations work)

Package updates
+++++++++++++++

Mathics3 Modules
++++++++++++++++

* Added preliminary Mathics3 debugger ("pymathics.trepan")

Python Package Updates
+++++++++++++++++++++++

#. Python 3.12 is now supported
#. SymPy 1.13 is now supported
Expand Down Expand Up @@ -785,13 +850,13 @@ New variables and builtins
Enhancements
++++++++++++

#. a function `evaluate_predicate` allows for a basic predicate evaluation using `$Assumptions`.
#. a function ``evaluate_predicate`` allows for a basic predicate evaluation using ``$Assumptions``.
#. ``Attributes`` accepts a string parameter.
#. ``Cases`` accepts Heads option. Issue #1302.
#. ``ColorNegate`` for colors is supported.
#. ``D`` and ``Derivative`` improvements.
#. ``Expand`` and ``ExpandAll`` now support a second parameter ``patt`` Issue #1301.
#. ``Expand`` and ``ExpandAll`` works with hyperbolic functions (`Sinh`, `Cosh`, `Tanh`, `Coth`).
#. ``Expand`` and ``ExpandAll`` works with hyperbolic functions (``Sinh``, ``Cosh``, ``Tanh``, ``Coth``).
#. ``FileNames`` returns a sorted list. Issue #1250.
#. ``FindRoot`` now accepts several optional parameters like ``Method`` and ``MaxIterations``. See Issue #1235.
#. ``FixedPoint`` now supports the ``SameTest`` option.
Expand Down Expand Up @@ -876,10 +941,10 @@ Bug fixes
``TeXForm[]`` for integrals are now properly formatted.


Pymathics Modules
+++++++++++++++++
Mathics3 Modules
++++++++++++++++

#. Pymathics modules now can run initialization code when are loaded.
#. Mathics3 modules now can run initialization code when are loaded.
#. The ``builtins`` list is not hard-linked to the library anymore. This simplifies the loading and reloading of pymathics modules.
#. Decoupling of BoxConstructors from the library. Now are defined at the level of the definition objects. This is useful for customizing the Graphics output if it is available.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ latexdoc texdoc doc:

#: Build JSON ASCII to unicode opcode table and operator table
mathics/data/operator-tables.json mathics/data/op-tables.json mathics/data/operators.json:
$(BASH) ./admin-tools/make-op-tables.sh
$(BASH) ./admin-tools/make-JSON-tables.sh

#: Remove ChangeLog
rmChangeLog:
Expand Down
24 changes: 13 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
Welcome to Mathics Core!
========================

|Pypi Installs| |Latest Version| |Supported Python Versions|
|PyPI Installs| |Latest Version| |Supported Python Versions|

|Packaging status|


Mathics3 is a general-purpose computer algebra system (CAS).

However this repository contains just the Python modules for WL Built-in functions, variables, core primitives, e.g. Symbol, a parser to create Expressions, and an evaluator to execute them.
However this repository contains just the Mathics3 Kernel: Python
modules for WL Built-in functions, variables, core primitives,
e.g. Symbol, a parser to create Expressions, and an evaluator to
execute them.

The home page for Mathics is https://mathics.org where you will find a list of screenshots and components making up the system.
The home page for Mathics is https://mathics.org where you will find a
list of screenshots and components making up the system.

Installing
----------
Expand All @@ -22,15 +26,15 @@ See the `Installing Mathics3 <https://mathics-development-guide.readthedocs.io/e
Running:
--------

Mathics3, the core library comes with a very simple command-line program called ``mathics``::
Mathics3 Kernel comes with a very simple command-line program called ``mathics``::

$ mathics

Mathics 5.0.3dev0
on CPython 3.8.12 (heads/v2.3.4.1_release:4a6b4d3504, Jun 3 2022, 15:46:12)
using SymPy 1.10.1, mpmath 1.2.1, numpy 1.23.1, cython 0.29.30
Mathics 8.0.0
on CPython 3.12.8 (main, Dec 9 2024, 11:38:23) [GCC 13.2.0]
using SymPy 1.13.3, mpmath 1.3.0, numpy 1.26.4, cython Not installed

Copyright (C) 2011-2022 The Mathics Team.
Copyright (C) 2011-2025 The Mathics3 Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Expand Down Expand Up @@ -60,14 +64,12 @@ License

Mathics is released under the GNU General Public License Version 3 (GPL3).

.. |Travis| image:: https://secure.travis-ci.org/Mathics3/mathics-core.svg?branch=master
.. _Travis: https://travis-ci.org/Mathics3/mathics-core
.. _PyPI: https://pypi.org/project/Mathics/
.. |mathicsscript| image:: https://github.com/Mathics3/mathicsscript/blob/master/screenshots/mathicsscript1.gif
.. |mathicssserver| image:: https://mathics.org/images/mathicsserver.png
.. |Latest Version| image:: https://badge.fury.io/py/Mathics3.svg
:target: https://badge.fury.io/py/Mathics3
.. |Pypi Installs| image:: https://pepy.tech/badge/Mathics3
.. |PyPI Installs| image:: https://pepy.tech/badge/Mathics3
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/Mathics3.svg
.. |Packaging status| image:: https://repology.org/badge/vertical-allrepos/mathics.svg
:target: https://repology.org/project/mathics/versions
Loading

0 comments on commit c4a373d

Please sign in to comment.