Skip to content

Commit fe5bf84

Browse files
authored
Merge pull request #1045 from mathics/SymbolNull
Add SymbolNull and try speeding up Workflows testing
2 parents 15d9bfc + 85d9864 commit fe5bf84

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
- name: Test Mathics
3030
run: |
3131
pip install pytest pexpect
32-
make check
32+
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
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

mathics/core/expression.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ def to_python(self, *args, **kwargs):
17781778
return True
17791779
if self == SymbolFalse:
17801780
return False
1781-
if self.name == 'System`Null':
1781+
if self == SymbolNull:
17821782
return None
17831783
n_evaluation = kwargs.get('n_evaluation')
17841784
if n_evaluation is not None:
@@ -1846,8 +1846,10 @@ def user_hash(self, update) -> None:
18461846
def __getnewargs__(self):
18471847
return (self.name, self.sympy_dummy)
18481848

1849+
# Some common Symbols
18491850
SymbolTrue = Symbol("True")
18501851
SymbolFalse = Symbol("False")
1852+
SymbolNull = Symbol("Null")
18511853

18521854
class Number(Atom):
18531855
def __str__(self) -> str:

mathics/core/numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def _get_float_inf(value, evaluation) -> typing.Optional[float]:
5151

5252

5353
def get_precision(value, evaluation) -> typing.Optional[int]:
54-
from mathics.core.expression import Symbol, MachineReal
5554
if value.get_name() == 'System`MachinePrecision':
5655
return None
5756
else:
57+
from mathics.core.expression import Symbol, MachineReal
5858
dmin = _get_float_inf(Symbol('$MinPrecision'), evaluation)
5959
dmax = _get_float_inf(Symbol('$MaxPrecision'), evaluation)
6060
d = value.round_to_float(evaluation)

0 commit comments

Comments
 (0)