"""Print out Py-ART version information.This file can also be run as a script to report on dependencies before abuild: python pyart/_debug_info.py"""importosimportsys
[docs]def_debug_info(stream=None):""" Print out version and status information for debugging. This file can be run as a script from the source directory to report on dependecies before a build using: **python pyart/_debug_info.py**. Parameters ---------- stream : file-like object Stream to print the information to, None prints to sys.stdout. """ifstreamisNone:stream=sys.stdout# remove the current path from the import search path# if this is not done ./io is found and not the std library io module.current_dir=os.path.dirname(os.path.abspath(__file__))ifcurrent_dirinsys.path:sys.path.remove(current_dir)try:importpyartpyart_version=pyart.__version__except:pyart_version="MISSING"try:importplatformpython_version=platform.python_version()except:python_version="MISSING"try:importnumpynumpy_version=numpy.__version__except:numpy_version="MISSING"try:importnumpynumpy_version=numpy.__version__except:numpy_version="MISSING"try:importscipyscipy_version=scipy.__version__except:scipy_version="MISSING"try:importmatplotlibmatplotlib_version=matplotlib.__version__except:matplotlib_version="MISSING"try:importnetCDF4netCDF4_version=netCDF4.__version__except:netCDF4_version="MISSING"try:rsl_version=pyart.io._rsl_interface._RSL_VERSION_STRexcept:rsl_version="MISSING"try:importcylpcylp_available="Available"except:cylp_available="MISSING"try:importglpkglpk_version="%i.%i"%(glpk.env.version)except:glpk_version="MISSING"try:importcvxopt.infocvxopt_version=cvxopt.info.versionexcept:cvxopt_version="MISSING"try:importcartopycartopy_version=cartopy.__version__except:cartopy_version="MISSING"try:importpytestpytest_version=pytest.__version__except:pytest_version="MISSING"print("Py-ART version:",pyart_version,file=stream)print("",file=stream)print("---- Dependencies ----",file=stream)print("Python version:",python_version,file=stream)print("NumPy version:",numpy_version,file=stream)print("SciPy version:",scipy_version,file=stream)print("matplotlib version:",matplotlib_version,file=stream)print("netCDF4 version:",netCDF4_version,file=stream)print("",file=stream)print("---- Optional dependencies ----",file=stream)print("TRMM RSL version:",rsl_version,file=stream)print("CyLP:",cylp_available,file=stream)print("PyGLPK version:",glpk_version,file=stream)print("CVXOPT version:",cvxopt_version,file=stream)print("Cartopy version:",cartopy_version,file=stream)print("pytest version:",pytest_version,file=stream)