Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
9fd88bc
1
Parent(s):
d821ca8
Test types on 3.7 as well
Browse files- .github/workflows/CI.yml +15 -5
- pysr/export_latex.py +1 -1
.github/workflows/CI.yml
CHANGED
@@ -162,7 +162,10 @@ jobs:
|
|
162 |
shell: bash -l {0}
|
163 |
strategy:
|
164 |
matrix:
|
165 |
-
python-version:
|
|
|
|
|
|
|
166 |
|
167 |
steps:
|
168 |
- uses: actions/checkout@v3
|
@@ -174,8 +177,15 @@ jobs:
|
|
174 |
- name: "Install PySR and all dependencies"
|
175 |
run: |
|
176 |
python -m pip install --upgrade pip
|
177 |
-
pip install -r requirements.txt
|
178 |
-
pip install mypy
|
179 |
-
python
|
|
|
|
|
|
|
180 |
- name: "Run mypy"
|
181 |
-
run: mypy --install-types --non-interactive pysr
|
|
|
|
|
|
|
|
|
|
162 |
shell: bash -l {0}
|
163 |
strategy:
|
164 |
matrix:
|
165 |
+
python-version:
|
166 |
+
- '3.11'
|
167 |
+
- '3.7'
|
168 |
+
os: ['ubuntu-latest']
|
169 |
|
170 |
steps:
|
171 |
- uses: actions/checkout@v3
|
|
|
177 |
- name: "Install PySR and all dependencies"
|
178 |
run: |
|
179 |
python -m pip install --upgrade pip
|
180 |
+
python -m pip install -r requirements.txt
|
181 |
+
python -m pip install mypy
|
182 |
+
python -m pip install .
|
183 |
+
- name: "Install additional dependencies"
|
184 |
+
run: python -m pip install jax jaxlib torch
|
185 |
+
if: ${{ matrix.python-version != '3.7' }}
|
186 |
- name: "Run mypy"
|
187 |
+
run: python -m mypy --install-types --non-interactive pysr
|
188 |
+
if: ${{ matrix.python-version != '3.7' }}
|
189 |
+
- name: "Run compatible mypy"
|
190 |
+
run: python -m mypy --ignore-missing-imports pysr
|
191 |
+
if: ${{ matrix.python-version == '3.7' }}
|
pysr/export_latex.py
CHANGED
@@ -23,7 +23,7 @@ def sympy2latex(expr, prec=3, full_prec=True, **settings) -> str:
|
|
23 |
"""Convert sympy expression to LaTeX with custom precision."""
|
24 |
settings["full_prec"] = full_prec
|
25 |
printer = PreciseLatexPrinter(settings=settings, prec=prec)
|
26 |
-
return printer.doprint(expr)
|
27 |
|
28 |
|
29 |
def generate_table_environment(
|
|
|
23 |
"""Convert sympy expression to LaTeX with custom precision."""
|
24 |
settings["full_prec"] = full_prec
|
25 |
printer = PreciseLatexPrinter(settings=settings, prec=prec)
|
26 |
+
return str(printer.doprint(expr))
|
27 |
|
28 |
|
29 |
def generate_table_environment(
|