Skip to content

Commit

Permalink
Print warning message instead of error when dPIE library are not avai…
Browse files Browse the repository at this point in the history
…lable
  • Loading branch information
aymgal committed Nov 6, 2024
1 parent a9643e9 commit 31def60
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions herculens/MassModel/Profiles/dpie.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@

from herculens.Util import util, param_util

try:
from herculens.MassModel.Profiles.glee.piemd_jax import Piemd_GPU
except ImportError:
raise ImportError("Please contact the author to use this dPIE profile "
"as it depends on non-public libraries.")


__all__ = [
'DPIE_GLEE',
'DPIE_GLEE_STATIC',
]

try:
from herculens.MassModel.Profiles.glee.piemd_jax import Piemd_GPU
except ImportError:
print("WARNING: dPIE profile class cannot be loaded. "
"If you wish to use this profile, "
"please contact the author to use this dPIE profile "
"as it depends on non-public libraries.")
class DPIE_GLEE(object):
pass
class DPIE_GLEE_STATIC(object):
pass


class DPIE_GLEE(object):
"""
Expand Down

0 comments on commit 31def60

Please sign in to comment.