Spaces:
Sleeping
Sleeping
File size: 1,138 Bytes
6d6b8af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
"""
Verify dependencies before building
"""
import sys
import importlib
def check_import(module_name):
"""Try to import a module and report status."""
try:
importlib.import_module(module_name)
print(f"✓ {module_name} successfully imported")
return True
except ImportError as e:
print(f"✗ Error importing {module_name}: {e}")
return False
# Core dependencies
REQUIRED = [
'arviz',
'pymc',
'pytensor',
'numpy',
'scipy',
'pandas',
'xarray'
]
# Optional dependencies
OPTIONAL = [
'numba',
'dask'
]
def main():
"""Check all dependencies."""
print("Checking required dependencies...")
required_ok = all(check_import(mod) for mod in REQUIRED)
print("\nChecking optional dependencies...")
for mod in OPTIONAL:
check_import(mod)
if not required_ok:
print("\n❌ Some required dependencies are missing!")
sys.exit(1)
print("\n✓ All required dependencies are available")
return 0
if __name__ == '__main__':
sys.exit(main())
|