Skip to content

Commit

Permalink
Merge b54efa5 into a907ef1
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Feb 22, 2023
2 parents a907ef1 + b54efa5 commit 33102ff
Show file tree
Hide file tree
Showing 2 changed files with 14 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
8 changes: 8 additions & 0 deletions pysr/julia_helpers.py
Expand Up @@ -169,6 +169,9 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None, return_aux=Fa
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 All @@ -192,6 +195,11 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None, return_aux=Fa
Julia(**julia_kwargs)
except UnsupportedPythonError:
# Static python binary, so we turn off pre-compiled modules.
warnings.warn(
"You are using a statically-linked Python binary. "
"The first run of PySR will be slower, as all dependencies need to be compiled. "
"Switch to a dynamically-linked version of Python (like pyenv) to have a faster startup time."
)
julia_kwargs = {**julia_kwargs, "compiled_modules": False}
Julia(**julia_kwargs)

Expand Down

0 comments on commit 33102ff

Please sign in to comment.