Skip to content

Commit 61f9f74

Browse files
warn of scipy 1.16
1 parent 8d54323 commit 61f9f74

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

smodels/base/runtime.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,25 @@
2121

2222
_deltas_rel_default = .2 ## the default relative error on the signal strength
2323

24+
def checkForIncompatibleModuleVersions():
25+
""" for 3.1.0, at release time, we have the problem that scipy 1.16
26+
does not work with pyhf 0.7.6. we warn about such situations.
27+
"""
28+
from importlib.metadata import version
29+
if version("scipy")[:4] in [ "1.16", "1.17" ]:
30+
print ( f"SModelS warning: scipy v{version('scipy')} is installed, but it seems " \
31+
"this version does not work with pyhf 0.7.6. We recommend scipy 1.15.x " \
32+
"and pyhf 0.7.6. You have been warned." )
33+
34+
checkForIncompatibleModuleVersions()
35+
2436
def printEnvironmentInfo( args : Dict ):
2537
""" very simple method that prints out info relevant to debugging
26-
machine-dependent problems """
38+
machine-dependent problems
39+
:param args: a dictionary with options, currently only a "colors" option
40+
is available
41+
:returns: true if all depenendencies are met
42+
"""
2743
from smodels.base.smodelsLogging import colors
2844
colors.on = True if "colors" in args and args["colors"] == True else False
2945
import importlib, platform
@@ -38,13 +54,16 @@ def printEnvironmentInfo( args : Dict ):
3854
print(f"Processor: {colors.green}{platform.processor()}{colors.reset}")
3955
print("\nModule Versions:")
4056

57+
depsMet = True
4158
for module_name in modules:
4259
try:
4360
module = importlib.import_module(module_name)
4461
version = getattr(module, '__version__', 'Unknown version attribute')
4562
print(f"{module_name:<12}: {colors.green}{version}{colors.reset}")
4663
except ImportError:
4764
print(f"{module_name:<12}: Not installed")
65+
depsMet = False
66+
return depsMet
4867

4968
def filetype ( filename : os.PathLike ) -> Union[Text,None]:
5069
""" obtain information about the filetype of an input file,

0 commit comments

Comments
 (0)