-
Notifications
You must be signed in to change notification settings - Fork 3
/
env_checkup.py
93 lines (69 loc) · 2.21 KB
/
env_checkup.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
"""
This script is intended to test the correct setup of the python environment
On the USM this script can be run with the following conda environment
conda activate /home/moon/vargatn/anaconda3/envs/galsim
"""
def test_basic():
print('testing basic packages')
import math
import os
import time
import multiprocessing as mp
import copy
import glob
import healpy
import pickle
import subprocess
import scipy
import numpy as np
print('\tnumpy version:', np.__version__)
import pandas as pd
print('\tpandas version:', pd.__version__)
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import fitsio as fio
print('\tfitsio version:', fio.__version__)
print('\tall imported successfully')
def test_sklearn():
print('testing basic packages')
import sklearn
print('\tsklearn version:', sklearn.__version__)
import sklearn.neighbors as neighbors
import sklearn.decomposition as decomp
print('\tall imported successfully')
def test_render():
print('testing galsim & rendering packages')
import galsim
print('\tgalsim version:', galsim.__version__)
import scipy.special
import scipy.optimize as optimize
import astropy.cosmology as cosmology
import astropy.units as u
import images
import ngmix
print('\tngmix version:', ngmix.__version__)
from ngmix.gmix import GMixBDF
print('galaxy writer object imported from ngmix')
print('\tall imported successfully')
def test_metacal():
print('testing metacal & ngmix packages')
import ngmix
print('\tngmix version:', ngmix.__version__)
from ngmix.medsreaders import NGMixMEDS
import astropy
print('\tastropy version:', astropy.__version__)
from astropy.table import Table, vstack, hstack
print('\tall imported successfully')
packages = (
test_basic,
)
if __name__ == "__main__":
print('\nOn the USM this script can be run with the following conda environment:')
print('\tconda activate /home/moon/vargatn/anaconda3/envs/galsim\n')
print("starting environment checkup")
test_basic()
test_sklearn()
test_render()
test_metacal()