Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/pkgs/mathics: Reduce to a pip package #37395

Merged
merged 16 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions build/pkgs/mathics/checksums.ini

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/mathics/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) pint palettable mathics_scanner $(PYTHON)
numpy pillow mpmath dateutil requests sympy pyyaml charset_normalizer typing_extensions | $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
1 change: 0 additions & 1 deletion build/pkgs/mathics/package-version.txt

This file was deleted.

2 changes: 2 additions & 0 deletions build/pkgs/mathics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Mathics3 @ git+https://github.com/Mathics3/mathics-core
-c ${SAGE_VENV}/var/lib/sage/scripts/numpy/spkg-requirements.txt
2 changes: 0 additions & 2 deletions build/pkgs/mathics/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/mathics/version_requirements.txt

This file was deleted.

18 changes: 0 additions & 18 deletions build/pkgs/mathics_scanner/SPKG.rst

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/mathics_scanner/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/mathics_scanner/dependencies

This file was deleted.

Empty file removed build/pkgs/mathics_scanner/math
Empty file.
1 change: 0 additions & 1 deletion build/pkgs/mathics_scanner/package-version.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/mathics_scanner/spkg-configure.m4

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/mathics_scanner/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/mathics_scanner/type

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/mathics_scanner/version_requirements.txt

This file was deleted.

16 changes: 0 additions & 16 deletions build/pkgs/palettable/SPKG.rst

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/palettable/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/palettable/dependencies

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/palettable/distros/conda.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/palettable/package-version.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/palettable/spkg-configure.m4

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/palettable/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/palettable/type

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/palettable/version_requirements.txt

This file was deleted.

18 changes: 0 additions & 18 deletions build/pkgs/pint/SPKG.rst

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/pint/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/pint/dependencies

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/pint/distros/conda.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/pint/package-version.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/pint/spkg-configure.m4

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/pint/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/pint/type

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/pint/version_requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions src/sage/doctest/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ class AvailableSoftware():
'magma',
'maple',
'mathematica',
'mathics',
mkoeppe marked this conversation as resolved.
Show resolved Hide resolved
'matlab',
'octave',
'pdflatex',
Expand Down
19 changes: 19 additions & 0 deletions src/sage/features/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ def _is_present(self):
reason=f"Interface {interface} is not functional: {exception}")


class Mathics(InterfaceFeature):
r"""
A :class:`~sage.features.Feature` describing whether :class:`sage.interfaces.mathics.Mathics`
is present and functional.

EXAMPLES::

sage: from sage.features.interfaces import Mathics
sage: Mathics().is_present() # not tested
FeatureTestResult('mathics', False)
"""

@staticmethod
def __classcall__(cls):
return InterfaceFeature.__classcall__(cls, 'mathics', 'sage.interfaces.mathics')


# The following are provided by external software only (no SPKG)

class Magma(InterfaceFeature):
Expand Down Expand Up @@ -223,6 +240,7 @@ def all_features():
[Feature('magma'),
Feature('matlab'),
Feature('mathematica'),
Feature('mathics'),
Feature('maple'),
Feature('macaulay2'),
Feature('octave'),
Expand All @@ -231,6 +249,7 @@ def all_features():
return [Magma(),
Matlab(),
Mathematica(),
Mathics(),
Maple(),
Macaulay2(),
Octave(),
Expand Down
2 changes: 2 additions & 0 deletions src/sage/interfaces/mathics.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@
"""
if not self._session:
from mathics.session import MathicsSession
from mathics.core.load_builtin import import_and_load_builtins
import_and_load_builtins()

Check warning on line 516 in src/sage/interfaces/mathics.py

View check run for this annotation

Codecov / codecov/patch

src/sage/interfaces/mathics.py#L515-L516

Added lines #L515 - L516 were not covered by tests
self._session = MathicsSession()
from sage.interfaces.sympy import sympy_init
sympy_init()
Expand Down
5 changes: 4 additions & 1 deletion src/sage/libs/mpmath/ext_main.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ cdef class mpf_base(mpnumber):
sage: X().to_fixed(30)
3489660928
"""
return libmp.to_fixed(self._mpf_, prec)
return libmp.to_fixed(self._mpf_, prec)
mkoeppe marked this conversation as resolved.
Show resolved Hide resolved

def __getstate__(self):
return libmp.to_pickable(self._mpf_)
Expand Down Expand Up @@ -2135,6 +2135,9 @@ cdef class mpf(mpf_base):
MPF_sqrt(&r.value, &s.value, global_opts)
return r

def __round__(self, *args):
return round(float(self), *args)
mkoeppe marked this conversation as resolved.
Show resolved Hide resolved

mkoeppe marked this conversation as resolved.
Show resolved Hide resolved
def __richcmp__(self, other, int op):
"""
Compares numbers ::
Expand Down
Loading