MilesCranmer commited on
Commit
3ffd1fe
1 Parent(s): 94dbab3

Add uuid to package loading

Browse files
Files changed (1) hide show
  1. pysr/julia_extensions.py +8 -6
pysr/julia_extensions.py CHANGED
@@ -3,16 +3,18 @@
3
  from .julia_import import jl
4
 
5
 
6
- def load_required_packages(*, turbo=False, enable_autodiff=False, cluster_manager=None):
 
 
7
  if turbo:
8
- load_package("LoopVectorization")
9
  if enable_autodiff:
10
- load_package("Zygote")
11
  if cluster_manager is not None:
12
- load_package("ClusterManagers")
13
 
14
 
15
- def load_package(package_name):
16
  jl.seval(
17
  f"""
18
  try
@@ -20,7 +22,7 @@ def load_package(package_name):
20
  catch e
21
  isa(e, ArgumentError) || throw(e)
22
  using Pkg: Pkg
23
- Pkg.add("{package_name}")
24
  using {package_name}
25
  end
26
  """
 
3
  from .julia_import import jl
4
 
5
 
6
+ def load_required_packages(
7
+ *, turbo=False, bumper=False, enable_autodiff=False, cluster_manager=None
8
+ ):
9
  if turbo:
10
+ load_package("LoopVectorization", "bdcacae8-1622-11e9-2a5c-532679323890")
11
  if enable_autodiff:
12
+ load_package("Zygote", "e88e6eb3-aa80-5325-afca-941959d7151f")
13
  if cluster_manager is not None:
14
+ load_package("ClusterManagers", "34f1f09b-3a8b-5176-ab39-66d58a4d544e")
15
 
16
 
17
+ def load_package(package_name, uuid):
18
  jl.seval(
19
  f"""
20
  try
 
22
  catch e
23
  isa(e, ArgumentError) || throw(e)
24
  using Pkg: Pkg
25
+ Pkg.add(name="{package_name}", uuid="{uuid}")
26
  using {package_name}
27
  end
28
  """