Skip to content

Commit

Permalink
Force bounds checking in Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Dec 10, 2022
1 parent b4238b4 commit c428709
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CI_Windows.yml
Expand Up @@ -57,9 +57,15 @@ jobs:
python -c 'import pysr; pysr.install()'
- name: "Run tests"
run: python -m pysr.test main
env:
JULIA_CHECK_BOUNDS: yes
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m pysr.test torch
env:
JULIA_CHECK_BOUNDS: yes
- name: "Run custom env tests"
run: python -m pysr.test env
env:
JULIA_CHECK_BOUNDS: yes
3 changes: 3 additions & 0 deletions pysr/julia_helpers.py
Expand Up @@ -157,6 +157,9 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None):
if julia_kwargs is None:
julia_kwargs = {"optimize": 3}

if "check_bounds" not in julia_kwargs and "JULIA_CHECK_BOUNDS" in os.environ:
julia_kwargs["check_bounds"] = os.environ["JULIA_CHECK_BOUNDS"]

from julia.core import JuliaInfo, UnsupportedPythonError

_julia_version_assertion()
Expand Down

0 comments on commit c428709

Please sign in to comment.