usnistgov / fipy

FiPy is a Finite Volume PDE solver written in Python
http://pages.nist.gov/fipy/en/latest
Other
505 stars 148 forks source link

Log much more information about FiPy environment #990

Closed guyer closed 8 months ago

guyer commented 9 months ago

Remove obsolete vitals module (svn, really???)

guyer commented 9 months ago

Based on discussion with @wd15 last night, I realized I hadn't made clear the point of this PR. When DEBUG logging is on, this PR results in output like (although not formatted for readability)

2024-01-10 08:36:09,640 - DEBUG - fipy - <module> - {
    'argv': ['-m'],
    'platform': {
        'architecture': ['64bit', ''],
        'machine': 'arm64',
        'node': 'DEADBEEF',
        'platform': 'macOS-13.6.2-arm64-arm-64bit',
        'processor': 'arm',
        'release': '22.6.0',
        'system': 'Darwin',
        'version': 'Darwin Kernel Version 22.6.0: Thu Nov  2 07:43:57 PDT 2023; root:xnu-8796.141.3.701.17~6/RELEASE_ARM64_T6000'
    },
    'package': {
        'python': '3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:41) [Clang 15.0.7 ]',
        'fipy': '3.4.4+294.gdf9e2f4d7',
        'numpy': '1.24.3',
        'pysparse': 'not installed',
        'scipy': '1.10.1',
        'matplotlib': '3.7.1',
        'mpi4py': '3.1.4',
        'petsc4py': '3.18.4',
        'pyamgx': 'not installed',
        'PyTrilinos': 'not installed',
        'mayavi': '4.8.1',
        'gmsh': '4.11.1',
        'solver': 'petsc'
    },
    'conda': {
        'conda_info': {
            'GID': 36677,
            'UID': 17723,
            'active_prefix': '/Users/guyer/mambaforge-arm/envs/fipy311',
            'active_prefix_name': 'fipy311',
            'av_data_dir': '/Users/guyer/mambaforge-arm/etc/conda',
            'av_metadata_url_base': None,
            'channels': ['https://conda.anaconda.org/conda-forge/osx-arm64',
                'https://conda.anaconda.org/conda-forge/noarch',
                'https://repo.anaconda.com/pkgs/main/osx-arm64',
                'https://repo.anaconda.com/pkgs/main/noarch',
                'https://repo.anaconda.com/pkgs/r/osx-arm64',
                'https://repo.anaconda.com/pkgs/r/noarch'
            ],
            'conda_build_version': 'not installed',
            'conda_env_version': '23.7.4',
            'conda_location': '/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda',
            'conda_prefix': '/Users/guyer/mambaforge-arm',
            'conda_shlvl': 2,
            'conda_version': '23.7.4',
            'config_files': ['/Users/guyer/mambaforge-arm/.condarc',
                '/Users/guyer/.condarc'
            ],
            'default_prefix': '/Users/guyer/mambaforge-arm/envs/fipy311',
            'env_vars': {
                'CIO_TEST': '<not set>',
                'CONDA_DEFAULT_ENV': 'fipy311',
                'CONDA_EXE': '/Users/guyer/mambaforge-arm/bin/conda',
                'CONDA_PREFIX': '/Users/guyer/mambaforge-arm/envs/fipy311',
                'CONDA_PREFIX_1': '/Users/guyer/mambaforge-arm',
                'CONDA_PROMPT_MODIFIER': '(fipy311) ',
                'CONDA_PYTHONBREAKPOINT': '',
                'CONDA_PYTHON_EXE': '/Users/guyer/mambaforge-arm/bin/python',
                'CONDA_ROOT': '/Users/guyer/mambaforge-arm',
                'CONDA_SHLVL': '2',
                'CURL_CA_BUNDLE': '<not set>',
                'DYLD_LIBRARY_PATH': '/Users/guyer/anaconda/envs/fipy_petsc/lib/python2.7/site-packages/petsc/lib:/usr/local/lib/SMESH-5.1.2.2:/usr/local/lib/GEOM-5.1.2.7:/Library/OpenCASCADE/6.3.0/lib:',
                'LD_LIBRARY_PATH': '/Users/guyer/anaconda/envs/fipy_petsc/lib:',
                'LD_PRELOAD': '<not set>',
                'MANPATH': ':/usr/local/man',
                'PATH': '/Users/guyer/mambaforge-arm/envs/fipy311/bin:/Users/guyer/mambaforge-arm/condabin:/Users/guyer/anaconda/bin:/Applications/Postgres.app/Contents/Versions/9.3/bin:/Users/guyer/bin:/usr/local/share/python:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/guyer/.local/bin',
                'PYTHONBREAKPOINT': 'ipdb.set_trace',
                'REQUESTS_CA_BUNDLE': '<not set>',
                'SSL_CERT_FILE': '<not set>'
            },
            'envs': ['/Users/guyer/.condax/conda-lock',
                '/Users/guyer/conda-smithy-sucks/envs/gmsh',
                '/Users/guyer/mambaforge',
                '/Users/guyer/mambaforge-arm',
                '/Users/guyer/mambaforge-arm/envs/caleb',
                '/Users/guyer/mambaforge-arm/envs/cantera',
                '/Users/guyer/mambaforge-arm/envs/cantera-trilinos',
                '/Users/guyer/mambaforge-arm/envs/finances',
                '/Users/guyer/mambaforge-arm/envs/fipy27',
                '/Users/guyer/mambaforge-arm/envs/fipy311',
                '/Users/guyer/mambaforge-arm/envs/fipy3116',
                '/Users/guyer/mambaforge-arm/envs/fipy_numpy_125',
                '/Users/guyer/mambaforge-arm/envs/fipy_solver_benchmarking_310',
                '/Users/guyer/mambaforge-arm/envs/fipy_solver_benchmarking_311',
                '/Users/guyer/mambaforge-arm/envs/icmed',
                '/Users/guyer/mambaforge-arm/envs/ntd2d',
                '/Users/guyer/mambaforge-arm/envs/petsc-osx-64',
                '/Users/guyer/mambaforge-arm/envs/petsc27',
                '/Users/guyer/mambaforge-arm/envs/radhe',
                '/Users/guyer/mambaforge-arm/envs/sphinx',
                '/Users/guyer/mambaforge-arm/envs/sphinx53',
                '/Users/guyer/mambaforge-arm/envs/sphinx712',
                '/Users/guyer/mambaforge-arm/envs/teqpdocs',
                '/Users/guyer/mambaforge/envs/binky',
                '/Users/guyer/mambaforge/envs/finances',
                '/Users/guyer/mambaforge/envs/fipy27',
                '/Users/guyer/mambaforge/envs/fipy37',
                '/Users/guyer/mambaforge/envs/fipy38',
                '/Users/guyer/mambaforge/envs/fipy38b',
                '/Users/guyer/mambaforge/envs/fipy3k',
                '/Users/guyer/mambaforge/envs/fipy3k_again',
                '/Users/guyer/mambaforge/envs/fipy3k_mayavi',
                '/Users/guyer/mambaforge/envs/linting',
                '/Users/guyer/mambaforge/envs/linting27',
                '/Users/guyer/mambaforge/envs/pipfipy',
                '/Users/guyer/mambaforge/envs/swc'
            ],
            'envs_dirs': ['/Users/guyer/mambaforge-arm/envs',
                '/Users/guyer/.conda/envs'
            ],
            'netrc_file': None,
            'offline': False,
            'pkgs_dirs': ['/Users/guyer/mambaforge-arm/pkgs',
                '/Users/guyer/.conda/pkgs'
            ],
            'platform': 'osx-arm64',
            'python_version': '3.10.10.final.0',
            'rc_path': '/Users/guyer/.condarc',
            'requests_version': '2.31.0',
            'root_prefix': '/Users/guyer/mambaforge-arm',
            'root_writable': True,
            'site_dirs': [],
            'sys.executable': '/Users/guyer/mambaforge-arm/bin/python',
            'sys.prefix': '/Users/guyer/mambaforge-arm',
            'sys.version': '3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:12:31) [Clang 14.0.6 ]',
            'sys_rc_path': '/Users/guyer/mambaforge-arm/.condarc',
            'user_agent': 'conda/23.7.4 requests/2.31.0 CPython/3.10.10 Darwin/22.6.0 OSX/13.6.2 solver/libmamba conda-libmamba-solver/23.3.0 libmambapy/1.5.1',
            'user_rc_path': '/Users/guyer/.condarc',
            'virtual_pkgs': [
                ['__archspec', '1', 'arm64'],
                ['__osx', '13.6.2', '0'],
                ['__unix', '0', '0']
            ]
        },
        'conda_env': {
            'channels': ['conda-forge', 'defaults'],
            'dependencies': ['aiohttp=3.8.4=py311heffc1b2_1',
                'aiosignal=1.3.1=pyhd8ed1ab_0',
                'alabaster=0.7.13=pyhd8ed1ab_0',
                'anyio=3.7.0=pyhd8ed1ab_1',
                'aom=3.5.0=h7ea286d_0',
                'appnope=0.1.3=pyhd8ed1ab_0',
                'apptools=5.1.0=pyh44b312d_0',
                'argon2-cffi=21.3.0=pyhd8ed1ab_0',
                'argon2-cffi-bindings=21.2.0=py311he2be06e_3',
                'asttokens=2.2.1=pyhd8ed1ab_0',
                'async-lru=2.0.2=pyhd8ed1ab_0',
                'async-timeout=4.0.2=pyhd8ed1ab_0',
                'atk-1.0=2.38.0=hcb7b3dd_1',
                'attrs=23.1.0=pyh71513ae_1',
                'babel=2.12.1=pyhd8ed1ab_1',
                'backcall=0.2.0=pyh9f0ad1d_0',
                'backports=1.0=pyhd8ed1ab_3',
                'backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0',
                'beautifulsoup4=4.12.2=pyha770c72_0',
                'bleach=6.0.0=pyhd8ed1ab_0',
                'brotli=1.0.9=h1a8c8d9_8',
                'brotli-bin=1.0.9=h1a8c8d9_8',
                'bzip2=1.0.8=h3422bc3_4',
                'c-ares=1.19.1=hb547adb_0',
                'ca-certificates=2023.11.17=hf0a4a13_0',
                'cairo=1.16.0=h73a0509_1014',
                'certifi=2023.11.17=pyhd8ed1ab_0',
                'cffi=1.15.1=py311hae827db_3',
                'charset-normalizer=3.1.0=pyhd8ed1ab_0',
                'click=8.1.3=unix_pyhd8ed1ab_2',
                'cmarkgfm=0.8.0=py311he2be06e_2',
                'colorama=0.4.6=pyhd8ed1ab_0',
                'comm=0.1.3=pyhd8ed1ab_0',
                'configobj=5.0.8=pyhd8ed1ab_0',
                'contourpy=1.1.0=py311he4fd1f5_0',
                'curl=8.1.2=h912dcd9_0',
                'cycler=0.11.0=pyhd8ed1ab_0',
                'dataclasses=0.8=pyhc8e2a94_3',
                'debugpy=1.6.7=py311ha397e9f_0',
                'decorator=5.1.1=pyhd8ed1ab_0',
                'defusedxml=0.7.1=pyhd8ed1ab_0',
                'deprecated=1.2.14=pyh1a96a4e_0',
                'double-conversion=3.2.0=hb7217d7_1',
                'eigen=3.4.0=hc021e02_0',
                'entrypoints=0.4=pyhd8ed1ab_0',
                'envisage=6.0.1=pyhd8ed1ab_0',
                'exceptiongroup=1.1.1=pyhd8ed1ab_0',
                'executing=1.2.0=pyhd8ed1ab_0',
                'expat=2.5.0=hb7217d7_1',
                'ffmpeg=5.1.2=gpl_hf318d42_106',
                'fftw=3.3.10=mpi_mpich_h0cb5807_7',
                'flit-core=3.9.0=pyhd8ed1ab_0',
                'fltk=1.3.8=h38c865a_0',
                'font-ttf-dejavu-sans-mono=2.37=hab24e00_0',
                'font-ttf-inconsolata=3.000=h77eed37_0',
                'font-ttf-source-code-pro=2.038=h77eed37_0',
                'font-ttf-ubuntu=0.83=hab24e00_0',
                'fontconfig=2.14.2=h82840c6_0',
                'fonts-conda-ecosystem=1=0',
                'fonts-conda-forge=1=0',
                'fonttools=4.40.0=py311heffc1b2_0',
                'freeimage=3.18.0=ha6e172d_12',
                'freetype=2.12.1=hd633e50_1',
                'fribidi=1.0.10=h27ca646_0',
                'frozenlist=1.3.3=py311he2be06e_0',
                'furo=2023.5.20=pyhd8ed1ab_1',
                'future=0.18.3=pyhd8ed1ab_0',
                'gdk-pixbuf=2.42.10=h9bcf4fe_0',
                'gettext=0.21.1=h0186832_0',
                'ghostscript=9.54.0=h6b3803e_2',
                'giflib=5.2.1=h1a8c8d9_3',
                'gl2ps=1.4.2=h17b34a0_0',
                'glew=2.1.0=h9f76cd9_2',
                'glib=2.76.3=ha614eb4_0',
                'glib-tools=2.76.3=ha614eb4_0',
                'gmp=6.2.1=h9f76cd9_0',
                'gmsh=4.11.1=h6e0c8fd_2',
                'gnutls=3.7.8=h9f1a10d_0',
                'graphite2=1.3.13=h9f76cd9_1001',
                'graphviz=7.1.0=h4f8fbd6_0',
                'gst-plugins-base=1.22.3=h27255cc_1',
                'gstreamer=1.22.3=he42f4ea_1',
                'gtk2=2.24.33=h57013de_2',
                'gts=0.7.6=he42f4ea_4',
                'harfbuzz=6.0.0=hddbc195_0',
                'hdf4=4.2.15=h1a38d6a_5',
                'hdf5=1.12.2=mpi_mpich_h4e1c725_1',
                'hunspell=1.7.2=h90ac8d3_1',
                'hypre=2.27.0=mpi_mpich_hd226f01_0',
                'icu=70.1=h6b3803e_0',
                'idna=3.4=pyhd8ed1ab_0',
                'imagemagick=7.1.1_5=pl5321h017a68b_1',
                'imagesize=1.4.1=pyhd8ed1ab_0',
                'imath=3.1.6=hb5ab8b9_1',
                'importlib-metadata=6.6.0=pyha770c72_0',
                'importlib_metadata=6.6.0=hd8ed1ab_0',
                'importlib_resources=5.12.0=pyhd8ed1ab_0',
                'ipdb=0.13.13=pyhd8ed1ab_0',
                'ipykernel=6.23.1=pyh736e0ef_0',
                'ipympl=0.9.3=pyhd8ed1ab_0',
                'ipython=8.14.0=pyhd1c38e8_0',
                'ipython_genutils=0.2.0=py_1',
                'ipywidgets=8.0.6=pyhd8ed1ab_0',
                'jaraco.classes=3.2.3=pyhd8ed1ab_0',
                'jbig=2.1=h3422bc3_2003',
                'jedi=0.18.2=pyhd8ed1ab_0',
                'jinja2=3.1.2=pyhd8ed1ab_1',
                'jpeg=9e=h1a8c8d9_3',
                'json5=0.9.5=pyh9f0ad1d_0',
                'jsoncpp=1.9.5=hc021e02_1',
                'jsonschema=4.17.3=pyhd8ed1ab_0',
                'jupyter=1.0.0=py311h267d04e_8',
                'jupyter-lsp=2.2.0=pyhd8ed1ab_0',
                'jupyter_client=8.2.0=pyhd8ed1ab_0',
                'jupyter_console=6.6.3=pyhd8ed1ab_0',
                'jupyter_core=5.3.0=py311h267d04e_0',
                'jupyter_events=0.6.3=pyhd8ed1ab_0',
                'jupyter_server=2.6.0=pyhd8ed1ab_0',
                'jupyter_server_terminals=0.4.4=pyhd8ed1ab_1',
                'jupyterlab=4.0.2=pyhd8ed1ab_0',
                'jupyterlab_pygments=0.2.2=pyhd8ed1ab_0',
                'jupyterlab_server=2.23.0=pyhd8ed1ab_0',
                'jupyterlab_widgets=3.0.7=pyhd8ed1ab_1',
                'jxrlib=1.1=h27ca646_2',
                'keyring=24.2.0=py311h267d04e_0',
                'kiwisolver=1.4.4=py311hd6ee22a_1',
                'krb5=1.20.1=h69eda48_0',
                'lame=3.100=h1a8c8d9_1003',
                'latexcodec=2.0.1=pyh9f0ad1d_0',
                'lcms2=2.15=h481adae_0',
                'lerc=4.0.0=h9a09cb3_0',
                'libaec=1.0.6=hb7217d7_1',
                'libblas=3.9.0=17_osxarm64_openblas',
                'libbrotlicommon=1.0.9=h1a8c8d9_8',
                'libbrotlidec=1.0.9=h1a8c8d9_8',
                'libbrotlienc=1.0.9=h1a8c8d9_8',
                'libcblas=3.9.0=17_osxarm64_openblas',
                'libclang=14.0.6=default_h5dc8d65_1',
                'libclang13=14.0.6=default_hc7183e1_1',
                'libcurl=8.1.2=h912dcd9_0',
                'libcxx=16.0.6=h4653b0c_0',
                'libdeflate=1.17=h1a8c8d9_0',
                'libedit=3.1.20191231=hc8eb9b7_2',
                'libev=4.33=h642e427_1',
                'libexpat=2.5.0=hb7217d7_1',
                'libffi=3.4.2=h3422bc3_5',
                'libgd=2.3.3=h90fb8ed_4',
                'libgfortran=5.0.0=12_2_0_hd922786_31',
                'libgfortran5=12.2.0=h0eea778_31',
                'libglib=2.76.3=h24e9cb9_0',
                'libiconv=1.17=he4db4b2_0',
                'libidn2=2.3.4=h1a8c8d9_0',
                'liblapack=3.9.0=17_osxarm64_openblas',
                'libllvm14=14.0.6=hd1a9a77_3',
                'libnetcdf=4.9.1=mpi_mpich_h3098116_1',
                'libnghttp2=1.52.0=hae82a92_0',
                'libogg=1.3.4=h27ca646_1',
                'libopenblas=0.3.23=openmp_hc731615_0',
                'libopus=1.3.1=h27ca646_1',
                'libpng=1.6.39=h76d750c_0',
                'libpq=15.3=h7126958_1',
                'libraw=0.21.1=h1a38d6a_0',
                'librsvg=2.54.4=ha2634a2_0',
                'libsodium=1.0.18=h27ca646_1',
                'libsqlite=3.42.0=hb31c410_0',
                'libssh2=1.11.0=h7a5bd25_0',
                'libtasn1=4.19.0=h1a8c8d9_0',
                'libtheora=1.1.1=h3422bc3_1005',
                'libtiff=4.5.0=h5dffbdd_2',
                'libtool=2.4.7=hb7217d7_0',
                'libunistring=0.9.10=h3422bc3_0',
                'libvorbis=1.3.7=h9f76cd9_0',
                'libvpx=1.11.0=hc470f4d_3',
                'libwebp=1.2.4=h999c80f_1',
                'libwebp-base=1.2.4=h1a8c8d9_0',
                'libxcb=1.13=h9b22ae9_1004',
                'libxml2=2.10.3=h67585b2_4',
                'libzip=1.9.2=h76ab92c_1',
                'libzlib=1.2.13=h53f4e23_5',
                'llvm-openmp=16.0.5=h1c12783_0',
                'loguru=0.7.0=py311h267d04e_0',
                'lz4-c=1.9.4=hb7217d7_0',
                'markdown-it-py=3.0.0=pyhd8ed1ab_0',
                'markupsafe=2.1.3=py311heffc1b2_0',
                'matplotlib-base=3.7.1=py311h99a5f44_0',
                'matplotlib-inline=0.1.6=pyhd8ed1ab_0',
                'mayavi=4.8.1=py311hc35ce93_5',
                'mdurl=0.1.0=pyhd8ed1ab_0',
                'metis=5.1.0=h9f76cd9_1006',
                'mistune=2.0.5=pyhd8ed1ab_0',
                'more-itertools=9.1.0=pyhd8ed1ab_0',
                'mpfr=4.2.0=he09a6ba_0',
                'mpi=1.0=mpich',
                'mpi4py=3.1.4=py311hc051084_0',
                'mpich=4.0.3=hd4b5bf3_100',
                'multidict=6.0.4=py311he2be06e_0',
                'mumps-include=5.2.1=hce30654_11',
                'mumps-mpi=5.2.1=hfd295ca_11',
                'munkres=1.1.4=pyh9f0ad1d_0',
                'mysql-common=8.0.32=h7b5afe1_2',
                'mysql-libs=8.0.32=hb292caa_2',
                'nbclassic=1.0.0=pyhb4ecaf3_1',
                'nbclient=0.8.0=pyhd8ed1ab_0',
                'nbconvert=7.5.0=pyhd8ed1ab_0',
                'nbconvert-core=7.5.0=pyhd8ed1ab_0',
                'nbconvert-pandoc=7.5.0=pyhd8ed1ab_0',
                'nbformat=5.9.0=pyhd8ed1ab_0',
                'ncurses=6.4=h7ea286d_0',
                'nest-asyncio=1.5.6=pyhd8ed1ab_0',
                'nettle=3.8.1=h63371fa_1',
                'nlohmann_json=3.11.2=h2e04ded_0',
                'notebook=6.5.4=pyha770c72_0',
                'notebook-shim=0.2.3=pyhd8ed1ab_0',
                'nspr=4.35=hb7217d7_0',
                'nss=3.89=h789eff7_0',
                'numpy=1.24.3=py311hb8f3215_0',
                'numpydoc=1.5.0=pyhd8ed1ab_0',
                'occt=7.7.1=novtk_h5f4376a_101',
                'openexr=3.1.5=h25aad90_2',
                'openh264=2.3.1=hb7217d7_2',
                'openjpeg=2.5.0=hbc2ba62_2',
                'openssl=3.2.0=h0d3ecfb_1',
                'overrides=7.3.1=pyhd8ed1ab_0',
                'p11-kit=0.24.1=h29577a5_0',
                'packaging=23.1=pyhd8ed1ab_0',
                'pandas=2.0.2=py311h9e438b8_0',
                'pandoc=3.1.3=hce30654_0',
                'pandocfilters=1.5.0=pyhd8ed1ab_0',
                'pango=1.50.14=h6c112b8_0',
                'parmetis=4.0.3=hefa2a9d_1005',
                'parso=0.8.3=pyhd8ed1ab_0',
                'pcre2=10.40=hb34f9b4_0',
                'perl=5.32.1=2_h9b22ae9_perl5',
                'petsc=3.18.4=real_hce0f69b_100',
                'petsc4py=3.18.4=real_h3ea83cd_100',
                'pexpect=4.8.0=pyh1a96a4e_2',
                'pickleshare=0.7.5=py_1003',
                'pillow=9.4.0=py311h627eb56_1',
                'pip=23.1.2=pyhd8ed1ab_0',
                'pixman=0.40.0=h27ca646_0',
                'pkg-config=0.29.2=hab62308_1008',
                'pkginfo=1.9.6=pyhd8ed1ab_0',
                'pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0',
                'platformdirs=3.5.3=pyhd8ed1ab_0',
                'ply=3.11=py_1',
                'pooch=1.7.0=pyha770c72_3',
                'proj=9.1.1=h13f728c_2',
                'prometheus_client=0.17.0=pyhd8ed1ab_0',
                'prompt-toolkit=3.0.38=pyha770c72_0',
                'prompt_toolkit=3.0.38=hd8ed1ab_0',
                'psutil=5.9.5=py311he2be06e_0',
                'pthread-stubs=0.4=h27ca646_1001',
                'ptscotch=6.0.9=hd02db47_2',
                'ptyprocess=0.7.0=pyhd3deb0d_0',
                'pugixml=1.11.4=h13dd4ca_1',
                'pure_eval=0.2.2=pyhd8ed1ab_0',
                'pybtex=0.24.0=pyhd8ed1ab_2',
                'pybtex-docutils=1.0.2=py311h267d04e_2',
                'pycparser=2.21=pyhd8ed1ab_0',
                'pyface=8.0.0=pyhd8ed1ab_0',
                'pygithub=1.58.0=pyh1a96a4e_0',
                'pygments=2.15.1=pyhd8ed1ab_0',
                'pyjwt=2.7.0=pyhd8ed1ab_0',
                'pynacl=1.5.0=py311he2be06e_2',
                'pyobjc-core=9.2=py311hb702dc4_0',
                'pyobjc-framework-cocoa=9.2=py311hb702dc4_0',
                'pyparsing=3.0.9=pyhd8ed1ab_0',
                'pyqt=5.15.7=py311h7203e35_3',
                'pyqt5-sip=12.11.0=py311ha397e9f_3',
                'pyrsistent=0.19.3=py311he2be06e_0',
                'pysocks=1.7.1=pyha2e5f31_6',
                'python=3.11.4=h47c9636_0_cpython',
                'python-dateutil=2.8.2=pyhd8ed1ab_0',
                'python-fastjsonschema=2.17.1=pyhd8ed1ab_0',
                'python-json-logger=2.0.7=pyhd8ed1ab_0',
                'python-tzdata=2023.3=pyhd8ed1ab_0',
                'python_abi=3.11=3_cp311',
                'pytz=2023.3=pyhd8ed1ab_0',
                'pyyaml=6.0=py311he2be06e_5',
                'pyzmq=25.1.0=py311hb1af645_0',
                'qt-main=5.15.8=hfe8d25c_6',
                'rapidjson=1.1.0=hc88da5d_1002',
                'readline=8.2=h92ec313_1',
                'readme_renderer=40.0=pyhd8ed1ab_0',
                'requests=2.31.0=pyhd8ed1ab_0',
                'requests-toolbelt=1.0.0=pyhd8ed1ab_0',
                'rfc3339-validator=0.1.4=pyhd8ed1ab_0',
                'rfc3986=2.0.0=pyhd8ed1ab_0',
                'rfc3986-validator=0.1.1=pyh9f0ad1d_0',
                'rich=13.4.2=pyhd8ed1ab_0',
                'scalapack=2.2.0=hb170938_1',
                'scipy=1.10.1=py311h93d07a4_3',
                'scotch=6.0.9=h7537618_2',
                'send2trash=1.8.2=pyhd1c38e8_0',
                'setuptools=67.7.2=pyhd8ed1ab_0',
                'sip=6.7.9=py311ha891d26_0',
                'six=1.16.0=pyh6c4a22f_0',
                'sniffio=1.3.0=pyhd8ed1ab_0',
                'snowballstemmer=2.2.0=pyhd8ed1ab_0',
                'soupsieve=2.3.2.post1=pyhd8ed1ab_0',
                'sphinx-basic-ng=1.0.0b1=pyhd8ed1ab_1',
                'sphinxcontrib-applehelp=1.0.4=pyhd8ed1ab_0',
                'sphinxcontrib-bibtex=2.5.0=pyhd8ed1ab_0',
                'sphinxcontrib-devhelp=1.0.2=py_0',
                'sphinxcontrib-htmlhelp=2.0.1=pyhd8ed1ab_0',
                'sphinxcontrib-jsmath=1.0.1=py_0',
                'sphinxcontrib-qthelp=1.0.3=py_0',
                'sqlite=3.42.0=h203b68d_0',
                'stack_data=0.6.2=pyhd8ed1ab_0',
                'suitesparse=5.10.1=h7cd81ec_1',
                'superlu=5.2.2=hc615359_0',
                'superlu_dist=7.2.0=h7df07b8_0',
                'svgwrite=1.4.3=pyhd8ed1ab_0',
                'svt-av1=1.4.1=h7ea286d_0',
                'tbb=2021.9.0=hffc8910_0',
                'tbb-devel=2021.9.0=h4f9cb39_0',
                'terminado=0.17.1=pyhd1c38e8_0',
                'tinycss2=1.2.1=pyhd8ed1ab_0',
                'tk=8.6.12=he1e0b03_0',
                'toml=0.10.2=pyhd8ed1ab_0',
                'tomli=2.0.1=pyhd8ed1ab_0',
                'tornado=6.3.2=py311heffc1b2_0',
                'traitlets=5.9.0=pyhd8ed1ab_0',
                'traits=6.4.1=py311he2be06e_1',
                'traitsui=8.0.0=pyhd8ed1ab_0',
                'tree=2.1.1=hb547adb_0',
                'twine=4.0.2=pyhd8ed1ab_0',
                'typing-extensions=4.6.3=hd8ed1ab_0',
                'typing_extensions=4.6.3=pyha770c72_0',
                'typing_utils=0.1.0=pyhd8ed1ab_0',
                'tzdata=2023c=h71feb2d_0',
                'urllib3=2.0.3=pyhd8ed1ab_0',
                'utfcpp=3.2.3=hce30654_0',
                'vtk=9.2.6=qt_py311h6b3d012_200',
                'wcwidth=0.2.6=pyhd8ed1ab_0',
                'webencodings=0.5.1=py_1',
                'websocket-client=1.5.3=pyhd8ed1ab_0',
                'wheel=0.40.0=pyhd8ed1ab_0',
                'widgetsnbextension=4.0.7=pyhd8ed1ab_0',
                'wrapt=1.15.0=py311he2be06e_0',
                'wslink=1.11.0=pyhd8ed1ab_0',
                'x264=1!164.3095=h57fd34a_2',
                'x265=3.5=hbc6ce65_3',
                'xorg-fixesproto=5.0=h3422bc3_1002',
                'xorg-kbproto=1.0.7=h27ca646_1002',
                'xorg-libice=1.0.10=h27ca646_0',
                'xorg-libsm=1.2.3=h27ca646_1000',
                'xorg-libx11=1.8.4=h1a8c8d9_0',
                'xorg-libxau=1.0.11=hb547adb_0',
                'xorg-libxdmcp=1.1.3=h27ca646_0',
                'xorg-libxext=1.3.4=h1a8c8d9_2',
                'xorg-libxfixes=5.0.3=h3422bc3_1004',
                'xorg-libxrender=0.9.10=h27ca646_1003',
                'xorg-libxt=1.3.0=hb547adb_0',
                'xorg-renderproto=0.11.1=h27ca646_1002',
                'xorg-xextproto=7.3.0=h1a8c8d9_1003',
                'xorg-xproto=7.0.31=h27ca646_1007',
                'xz=5.2.6=h57fd34a_0',
                'yaml=0.2.5=h3422bc3_2',
                'yarl=1.9.2=py311heffc1b2_0',
                'zeromq=4.3.4=hbdafb3b_1',
                'zipp=3.15.0=pyhd8ed1ab_0',
                'zlib=1.2.13=h53f4e23_5',
                'zstd=1.5.2=hf913c23_6',
                {
                    'pip': ['accessible-pygments==0.0.4',
                        'annotated-types==0.6.0',
                        'appdirs==1.4.4',
                        'bracex==2.4',
                        'docutils==0.18.1',
                        'ensureconda==1.4.3',
                        'filelock==3.13.1',
                        'git-filter-repo==2.38.0',
                        'gitdb==4.0.10',
                        'github-action-utils==1.1.0',
                        'gitpython==3.1.32',
                        'html5lib==1.1',
                        'line-profiler==4.1.2',
                        'lxml==4.9.3',
                        'markdown==3.5.1',
                        'memory-profiler==0.61.0',
                        'pydantic==2.5.2',
                        'pydantic-core==2.14.5',
                        'pydantic-settings==2.1.0',
                        'pydata-sphinx-theme==0.14.1',
                        'pyspelling==2.9',
                        'python-dotenv==1.0.0',
                        'smmap==5.0.0',
                        'snakeviz==2.2.0',
                        'sphinx==7.2.6',
                        'sphinx-rtd-theme==1.3.0',
                        'sphinxcontrib-jquery==4.1',
                        'sphinxcontrib-serializinghtml==1.1.9',
                        'typer==0.9.0',
                        'userpath==1.9.1',
                        'wcmatch==8.5'
                    ]
                }
            ],
            'name': 'fipy311',
            'prefix': '/Users/guyer/mambaforge-arm/envs/fipy311'
        }
    }
}
guyer commented 9 months ago

The same mechanism is then leveraged to generate the simple table output by the tests, using the packages entry in the JSON:


python      3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:41) [Clang 15.0.7 ]
fipy        3.4.4+294.gdf9e2f4d7
numpy       1.24.3
pysparse    not installed
scipy       1.10.1
matplotlib  3.7.1
mpi4py      3.1.4
petsc4py    3.18.4
pyamgx      not installed
PyTrilinos  not installed
mayavi      4.8.1
gmsh        4.11.1
solver      petsc
guyer commented 9 months ago

Should log environment variables

wd15 commented 9 months ago

How do I switch on the logging? For example if I run python examples/diffusion/mesh1d.py.

wd15 commented 9 months ago

I tried this

>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)

at the beginning of the example, but nothing happened.

guyer commented 9 months ago

I tried this

>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)

at the beginning of the example, but nothing happened.

The problem is that fipy has already been imported by the time you do that, so its loggers don't realize they should be doing DEBUG logging. Two options:

  1. Move that to the very end, in the test harness, before the first fipy import:

    @@ -856,5 +856,8 @@ from __future__ import unicode_literals
     __docformat__ = 'restructuredtext'
    
    if __name__ == '__main__':
    +    import logging
    +    logging.basicConfig(level=logging.DEBUG)
    +
         import fipy.tests.doctestPlus
         exec(fipy.tests.doctestPlus._getScript())
  2. Add a logger environment variable:
    FIPY_LOG_CONFIG=fipy/tools/logging/serial_config.json python examples/diffusion/mesh1D.py
guyer commented 9 months ago

2. Add a logger environment variable:

    FIPY_LOG_CONFIG=fipy/tools/logging/serial_config.json python examples/diffusion/mesh1D.py

note: that will only dump debug info into a file called fipy.log, but not to the console. You can get it to go to the console, too, by editing the config file:

--- a/fipy/tools/logging/serial_config.json
+++ b/fipy/tools/logging/serial_config.json
@@ -8,7 +8,8 @@
     "handlers": {
         "console": {
             "class": "logging.StreamHandler",
-            "level": "INFO"
+            "formatter": "default",
+            "level": "DEBUG"
         },
         "serialfile": {
             "class": "logging.FileHandler",
tkphd commented 9 months ago

I ran examples.phase.simple with FIPY_LOG_CONFIG=fipy/tools/logging/serial_config.json and get the following output. This looks right, yeah?

examples.phase.simple output, beautified ```json { "Argv": [ "phase.simple.py" ], "platform": { "architecture": [ "64bit", "ELF" ], "machine": "x86_64", "node": "redacted", "platform": "Linux-5.10.0-26-amd64-x86_64-with-glibc2.31", "processor": "", "release": "5.10.0-26-amd64", "system": "Linux", "version": "#1 SMP Debian 5.10.197-1 (2023-09-29)" }, "package": { "python": "3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0]", "fipy": "3.4.4+9.g9db4ae960", "numpy": "1.26.3", "pysparse": "not installed", "scipy": "1.11.4", "matplotlib": "3.8.2", "mpi4py": "not installed", "petsc4py": "not installed", "pyamgx": "not installed", "PyTrilinos": "not installed", "mayavi": "not installed", "gmsh": "4.7.1", "solver": "scipy" }, "conda": { "conda_info": { "GID": 100, "UID": 54620, "active_prefix": "/opt/anaconda/envs/fipy", "active_prefix_name": "fipy", "av_data_dir": "/opt/anaconda/etc/conda", "av_metadata_url_base": null, "channels": [ "https://conda.anaconda.org/conda-forge/linux-64", "https://conda.anaconda.org/conda-forge/noarch" ], "conda_build_version": "not installed", "conda_env_version": "23.11.0", "conda_location": "/opt/anaconda/lib/python3.11/site-packages/conda", "conda_prefix": "/opt/anaconda", "conda_shlvl": 1, "conda_version": "23.11.0", "config_files": [ "~/.condarc" ], "default_prefix": "/opt/anaconda/envs/fipy", "env_vars": { "CIO_TEST": "", "CONDAPATH": "/opt/anaconda", "CONDA_DEFAULT_ENV": "fipy", "CONDA_EXE": "/opt/anaconda/bin/conda", "CONDA_PREFIX": "/opt/anaconda/envs/fipy", "CONDA_PROMPT_MODIFIER": "(fipy) ", "CONDA_PYTHON_EXE": "/opt/anaconda/bin/python", "CONDA_ROOT": "/opt/anaconda", "CONDA_SHLVL": "1", "CURL_CA_BUNDLE": "", "GEM_PATH": "~/.rvm/gems/ruby-2.7.2:~/.rvm/gems/ruby-2.7.2@global", "LD_PRELOAD": "", "LMOD_DEFAULT_MODULEPATH": "~/research/modules/modulefiles:/etc/lmod/modules:/usr/share/lmod/lmod/modulefiles", "MANPATH": "~/.nvm/versions/node/v18.9.0/share/man:/usr/share/lmod/lmod/share/man::", "MMSP_PATH": "~/research/projects/mmsp", "MODULEPATH": "~/research/modules/modulefiles:/etc/lmod/modules:/usr/share/lmod/lmod/modulefiles", "PATH": "/opt/anaconda/bin:/opt/anaconda/envs/fipy/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/opt/anaconda/bin:~/.rvm/gems/ruby-2.7.2/bin:~/.rvm/gems/ruby-2.7.2@global/bin:~/.rvm/rubies/ruby-2.7.2/bin:~/.cargo/bin:~/.nvm/versions/node/v18.9.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:~/bin:~/.local/bin:/usr/local/tnk10/bin:/usr/sbin:~/research/projects/mmsp/utility:~/.rvm/bin", "PYTHONPYCACHEPREFIX": "/tmp/tnk10/pycache", "QT_QPA_PLATFORM_PLUGIN_PATH": "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms", "REQUESTS_CA_BUNDLE": "", "SSL_CERT_FILE": "", "SUDO_PROMPT": "\u001b[0;34m[Enter \u001b[0;36mtnk10's\u001b[0;34m password to \u001b[0;35msudo\u001b[0;34m]:\u001b[0;39m ", "SUDO_PS1": "\\[\\e[1;31m\\]\\U@\\H:\\w$", "rvm_bin_path": "~/.rvm/bin", "rvm_path": "~/.rvm" }, "envs": [ "/opt/anaconda", "/opt/anaconda/envs/dft", "/opt/anaconda/envs/fipy", "/opt/anaconda/envs/py3" ], "envs_dirs": [ "/opt/anaconda/envs", "~/.conda/envs" ], "netrc_file": "~/.netrc", "offline": false, "pkgs_dirs": [ "/opt/anaconda/pkgs", "~/.conda/pkgs" ], "platform": "linux-64", "python_version": "3.11.5.final.0", "rc_path": "~/.condarc", "requests_version": "2.31.0", "root_prefix": "/opt/anaconda", "root_writable": true, "site_dirs": [ "~/.local/lib/python3.9", "~/.local/lib/python3.5" ], "solver": { "default": true, "name": "libmamba", "user_agent": "solver/libmamba conda-libmamba-solver/23.12.0 libmambapy/1.5.3" }, "sys.executable": "/opt/anaconda/bin/python", "sys.prefix": "/opt/anaconda", "sys.version": "3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0]", "sys_rc_path": "/opt/anaconda/.condarc", "user_agent": "conda/23.11.0 requests/2.31.0 CPython/3.11.5 Linux/5.10.0-26-amd64 debian/11.8 glibc/2.31 solver/libmamba conda-libmamba-solver/23.12.0 libmambapy/1.5.3", "user_rc_path": "~/.condarc", "virtual_pkgs": [ [ "__archspec", "1", "zen3" ], [ "__conda", "23.11.0", "0" ], [ "__cuda", "11.4", "0" ], [ "__glibc", "2.31", "0" ], [ "__linux", "5.10.0", "0" ], [ "__unix", "0", "0" ] ] }, "conda_env": { "channels": [ "conda-forge" ], "dependencies": [ "_libgcc_mutex=0.1=conda_forge", "_openmp_mutex=4.5=2_gnu", "aiohttp=3.9.1=py310h2372a71_0", "aiosignal=1.3.1=pyhd8ed1ab_0", "alsa-lib=1.2.10=hd590300_0", "aom=3.7.1=h59595ed_0", "apptools=5.1.0=pyh44b312d_0", "async-timeout=4.0.3=pyhd8ed1ab_0", "attr=2.5.1=h166bdaf_1", "attrs=23.2.0=pyh71513ae_0", "blosc=1.21.5=h0f2a231_0", "brotli=1.1.0=hd590300_1", "brotli-bin=1.1.0=hd590300_1", "bzip2=1.0.8=hd590300_5", "c-ares=1.25.0=hd590300_0", "ca-certificates=2023.11.17=hbcca054_0", "cairo=1.18.0=h3faef2a_0", "certifi=2023.11.17=pyhd8ed1ab_0", "configobj=5.0.8=pyhd8ed1ab_0", "contourpy=1.2.0=py310hd41b1e2_0", "cycler=0.12.1=pyhd8ed1ab_0", "dav1d=1.2.1=hd590300_0", "dbus=1.13.6=h5008d03_3", "double-conversion=3.3.0=h59595ed_0", "eigen=3.4.0=h00ab1b0_0", "envisage=6.0.1=pyhd8ed1ab_0", "expat=2.5.0=hcb278e6_1", "ffmpeg=6.1.0=gpl_ha330e6d_102", "fftw=3.3.10=mpi_mpich_h5537406_8", "font-ttf-dejavu-sans-mono=2.37=hab24e00_0", "font-ttf-inconsolata=3.000=h77eed37_0", "font-ttf-source-code-pro=2.038=h77eed37_0", "font-ttf-ubuntu=0.83=h77eed37_1", "fontconfig=2.14.2=h14ed4e7_0", "fonts-conda-ecosystem=1=0", "fonts-conda-forge=1=0", "fonttools=4.47.0=py310h2372a71_0", "freetype=2.12.1=h267a509_2", "fribidi=1.0.10=h36c2ea0_0", "frozenlist=1.4.1=py310h2372a71_0", "future=0.18.3=pyhd8ed1ab_0", "gettext=0.21.1=h27087fc_0", "gl2ps=1.4.2=h0708190_0", "glew=2.1.0=h9c3ff4c_2", "glib=2.78.3=hfc55251_0", "glib-tools=2.78.3=hfc55251_0", "gmp=6.3.0=h59595ed_0", "gnutls=3.7.9=hb077bed_0", "graphite2=1.3.13=h58526e2_1001", "gst-plugins-base=1.22.8=h8e1006c_1", "gstreamer=1.22.8=h98fc4e7_1", "harfbuzz=8.3.0=h3d44ed6_0", "hdf4=4.2.15=h2a13503_7", "hdf5=1.14.3=mpi_mpich_ha2c2bf8_0", "hypre=2.28.0=mpi_mpich_h716cb5e_0", "icu=73.2=h59595ed_0", "idna=3.6=pyhd8ed1ab_0", "importlib-metadata=7.0.1=pyha770c72_0", "importlib_metadata=7.0.1=hd8ed1ab_0", "importlib_resources=6.1.1=pyhd8ed1ab_0", "jsoncpp=1.9.5=h4bd325d_1", "keyutils=1.6.1=h166bdaf_0", "kiwisolver=1.4.5=py310hd41b1e2_1", "krb5=1.21.2=h659d440_0", "lame=3.100=h166bdaf_1003", "lcms2=2.16=hb7c19ff_0", "ld_impl_linux-64=2.40=h41732ed_0", "lerc=4.0.0=h27087fc_0", "libaec=1.1.2=h59595ed_1", "libass=0.17.1=h8fe9dca_1", "libblas=3.9.0=20_linux64_openblas", "libbrotlicommon=1.1.0=hd590300_1", "libbrotlidec=1.1.0=hd590300_1", "libbrotlienc=1.1.0=hd590300_1", "libcap=2.69=h0f662aa_0", "libcblas=3.9.0=20_linux64_openblas", "libclang=15.0.7=default_hb11cfb5_4", "libclang13=15.0.7=default_ha2b6cf4_4", "libcups=2.3.3=h4637d8d_4", "libcurl=8.5.0=hca28451_0", "libdeflate=1.19=hd590300_0", "libdrm=2.4.114=h166bdaf_0", "libedit=3.1.20191231=he28a2e2_2", "libev=4.33=hd590300_2", "libevent=2.1.12=hf998b51_1", "libexpat=2.5.0=hcb278e6_1", "libffi=3.4.2=h7f98852_5", "libflac=1.4.3=h59595ed_0", "libgcc-ng=13.2.0=h807b86a_3", "libgcrypt=1.10.3=hd590300_0", "libgfortran-ng=13.2.0=h69a702a_3", "libgfortran5=13.2.0=ha4646dd_3", "libglib=2.78.3=h783c2da_0", "libglu=9.0.0=hac7e632_1003", "libgomp=13.2.0=h807b86a_3", "libgpg-error=1.47=h71f35ed_0", "libhwloc=2.9.3=default_h554bfaf_1009", "libiconv=1.17=hd590300_2", "libidn2=2.3.4=h166bdaf_0", "libjpeg-turbo=3.0.0=hd590300_1", "liblapack=3.9.0=20_linux64_openblas", "libllvm15=15.0.7=h5cf9203_3", "libnetcdf=4.9.2=nompi_h80fb2b6_112", "libnghttp2=1.58.0=h47da74e_1", "libnsl=2.0.1=hd590300_0", "libogg=1.3.4=h7f98852_1", "libopenblas=0.3.25=pthreads_h413a1c8_0", "libopus=1.3.1=h7f98852_1", "libpciaccess=0.17=h166bdaf_0", "libpng=1.6.39=h753d276_0", "libpq=16.1=h33b98f1_7", "libptscotch=7.0.4=h2376d02_1", "libscotch=7.0.4=h91e35bf_1", "libsndfile=1.2.2=hc60ed4a_1", "libsqlite=3.44.2=h2797004_0", "libssh2=1.11.0=h0841786_0", "libstdcxx-ng=13.2.0=h7e041cc_3", "libsystemd0=255=h3516f8a_0", "libtasn1=4.19.0=h166bdaf_0", "libtheora=1.1.1=h7f98852_1005", "libtiff=4.6.0=ha9c0a0a_2", "libunistring=0.9.10=h7f98852_0", "libuuid=2.38.1=h0b41bf4_0", "libva=2.20.0=hd590300_0", "libvorbis=1.3.7=h9c3ff4c_0", "libvpx=1.13.1=h59595ed_0", "libwebp-base=1.3.2=hd590300_0", "libxcb=1.15=h0b41bf4_0", "libxcrypt=4.4.36=hd590300_1", "libxkbcommon=1.6.0=h5d7e998_0", "libxml2=2.11.6=h232c23b_0", "libzip=1.10.1=h2629f0a_3", "libzlib=1.2.13=hd590300_5", "loguru=0.7.2=py310hff52083_1", "lz4-c=1.9.4=hcb278e6_0", "matplotlib-base=3.8.2=py310h62c0568_0", "mayavi=4.8.1=py310he4a938c_7", "metis=5.1.1=h59595ed_2", "mpfr=4.2.1=h9458935_0", "mpg123=1.32.3=h59595ed_0", "mpi=1.0=mpich", "mpi4py=3.1.5=py310h30280a6_0", "mpich=4.1.2=h846660c_101", "multidict=6.0.4=py310h2372a71_1", "mumps-include=5.2.1=ha770c72_14", "mumps-mpi=5.2.1=h5b51c9e_14", "munkres=1.1.4=pyh9f0ad1d_0", "mysql-common=8.0.33=hf1915f5_6", "mysql-libs=8.0.33=hca2cd23_6", "ncurses=6.4=h59595ed_2", "nettle=3.9.1=h7ab15ed_0", "nlohmann_json=3.11.2=h27087fc_0", "nspr=4.35=h27087fc_0", "nss=3.96=h1d7d5a4_0", "numpy=1.26.3=py310hb13e2d6_0", "openh264=2.4.0=h59595ed_0", "openjpeg=2.5.0=h488ebb8_3", "openssl=3.2.0=hd590300_1", "p11-kit=0.24.1=hc5aa10d_0", "packaging=23.2=pyhd8ed1ab_0", "parmetis=4.0.3=h2a9763c_1005", "pcre2=10.42=hcad00b1_0", "petsc=3.20.3=real_h3d2a624_100", "petsc4py=3.20.3=real_hbd52a53_100", "pillow=10.2.0=py310h01dd4db_0", "pip=23.3.2=pyhd8ed1ab_0", "pixman=0.43.0=h59595ed_0", "ply=3.11=py_1", "proj=9.3.1=h1d62c97_0", "pthread-stubs=0.4=h36c2ea0_1001", "ptscotch=7.0.4=h23d43cc_1", "pugixml=1.14=h59595ed_0", "pulseaudio-client=16.1=hb77b528_5", "pyface=8.0.0=pyhd8ed1ab_0", "pygments=2.17.2=pyhd8ed1ab_0", "pyparsing=3.1.1=pyhd8ed1ab_0", "pyqt=5.15.9=py310h04931ad_5", "pyqt5-sip=12.12.2=py310hc6cd4ac_5", "python=3.10.13=hd12c33a_1_cpython", "python-dateutil=2.8.2=pyhd8ed1ab_0", "python_abi=3.10=4_cp310", "qt-main=5.15.8=h82b777d_17", "readline=8.2=h8228510_1", "scalapack=2.2.0=hd931219_1", "scipy=1.11.4=py310hb13e2d6_0", "scotch=7.0.4=h23d43cc_1", "setuptools=69.0.3=pyhd8ed1ab_0", "sip=6.7.12=py310hc6cd4ac_0", "six=1.16.0=pyh6c4a22f_0", "snappy=1.1.10=h9fff704_0", "sqlite=3.44.2=h2c6b66d_0", "suitesparse=5.10.1=h3ec001c_2", "superlu=5.2.2=h00795ac_0", "superlu_dist=8.2.1=h5902e8c_0", "svt-av1=1.7.0=h59595ed_0", "tbb=2021.11.0=h00ab1b0_0", "tbb-devel=2021.11.0=h00ab1b0_0", "tk=8.6.13=noxft_h4845f30_101", "toml=0.10.2=pyhd8ed1ab_0", "tomli=2.0.1=pyhd8ed1ab_0", "traits=6.4.3=py310h2372a71_0", "traitsui=8.0.0=pyhd8ed1ab_0", "typing-extensions=4.9.0=hd8ed1ab_0", "typing_extensions=4.9.0=pyha770c72_0", "tzdata=2023d=h0c530f3_0", "unicodedata2=15.1.0=py310h2372a71_0", "utfcpp=4.0.5=ha770c72_0", "vtk=9.2.6=qt_py310h1234567_220", "vtk-base=9.2.6=qt_py310h1234567_220", "vtk-io-ffmpeg=9.2.6=qt_py310h1234567_220", "wheel=0.42.0=pyhd8ed1ab_0", "wslink=1.12.4=pyhd8ed1ab_0", "x264=1!164.3095=h166bdaf_2", "x265=3.5=h924138e_3", "xcb-util=0.4.0=hd590300_1", "xcb-util-image=0.4.0=h8ee46fc_1", "xcb-util-keysyms=0.4.0=h8ee46fc_1", "xcb-util-renderutil=0.3.9=hd590300_1", "xcb-util-wm=0.4.1=h8ee46fc_1", "xkeyboard-config=2.40=hd590300_0", "xorg-fixesproto=5.0=h7f98852_1002", "xorg-kbproto=1.0.7=h7f98852_1002", "xorg-libice=1.1.1=hd590300_0", "xorg-libsm=1.2.4=h7391055_0", "xorg-libx11=1.8.7=h8ee46fc_0", "xorg-libxau=1.0.11=hd590300_0", "xorg-libxdmcp=1.1.3=h7f98852_0", "xorg-libxext=1.3.4=h0b41bf4_2", "xorg-libxfixes=5.0.3=h7f98852_1004", "xorg-libxrender=0.9.11=hd590300_0", "xorg-libxt=1.3.0=hd590300_1", "xorg-renderproto=0.11.1=h7f98852_1002", "xorg-xextproto=7.3.0=h0b41bf4_1003", "xorg-xf86vidmodeproto=2.3.1=h7f98852_1002", "xorg-xproto=7.0.31=h7f98852_1007", "xz=5.2.6=h166bdaf_0", "yaml=0.2.5=h7f98852_2", "yarl=1.9.3=py310h2372a71_0", "zipp=3.17.0=pyhd8ed1ab_0", "zlib=1.2.13=hd590300_5", "zstd=1.5.5=hfc55251_0", { "pip": [ "scikit-fmm==2023.4.2" ] } ], "name": "fipy", "prefix": "/opt/anaconda/envs/fipy" } } } ```
wd15 commented 8 months ago

With FIPY_LOG_CONFIG=fipy/tools/logging/serial_config.json python examples/diffusion/mesh1D.py it's giving

Solver suite is scipy
Uncaught exception:
Traceback (most recent call last):
  File "/home/wd15/git/fipy/examples/diffusion/mesh1D.py", line 859, in <module>
    import fipy.tests.doctestPlus
  File "/home/wd15/git/fipy/fipy/__init__.py", line 77, in <module>
    _fipy_environment["conda"] = environment.conda_info()
  File "/home/wd15/git/fipy/fipy/tools/logging/environment.py", line 23, in conda_info
    p = subprocess.Popen([conda, "info", "--json"], stdout=subprocess.PIPE)
  File "/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'conda'
guyer commented 8 months ago
FileNotFoundError: [Errno 2] No such file or directory: 'conda'

Definitely needs a try-except, at a minimum. Also should log other installation modes, as appropriate (pip, nix, ...).

wd15 commented 8 months ago
FileNotFoundError: [Errno 2] No such file or directory: 'conda'

Definitely needs a try-except, at a minimum. Also should log other installation modes, as appropriate (pip, nix, ...).

Ok, I can help with that. Once you've implemented I'll test and add Nix or whatever else there is. Would all the conda variants be covered by just conda?

guyer commented 8 months ago

Would all the conda variants be covered by just conda?

They should be. I'm pretty sure there's always a 'conda' command even if you started with 'mamba', and the subprocess should be launched within the environment you're running in, regardless of how many different conda/mamba/micromamba/miniconda environments you have installed (cough cough don't look at my hard drive!).

guyer commented 8 months ago

OK, I've try-excepted conda and I've added pip and the environment variables.

@wd15, please add a clause for nix

wd15 commented 8 months ago

Ok, it runs for me now. I get the following, fipy.log. Not seeing anything nice like Trevor's output, but I suppose that's what I'm supposed to see? I'll add the Nix clause in the later Nix PR, #992.

tkphd commented 8 months ago
  1. emacs' json-mode-beautify
  2. Your log ends with
    2024-01-22 15:48:01,017 - ERROR - fipy - _excepthook - Uncaught exception:
    Traceback (most recent call last):
    File "/home/wd15/git/fipy/examples/diffusion/mesh1D.py", line 860, in <module>
    exec(fipy.tests.doctestPlus._getScript())
    File "<string>", line 731, in <module>
    File "/home/wd15/git/fipy/fipy/terms/term.py", line 178, in solve
    solver._solve()
    File "/home/wd15/git/fipy/fipy/solvers/scipy/scipySolver.py", line 26, in _solve
    self.var[:] = numerix.reshape(self._solve_(self.matrix, self.var.ravel(), 
    numerix.array(self.RHSvector)), self.var.shape)
    File "/home/wd15/git/fipy/fipy/solvers/scipy/linearLUSolver.py", line 29, in _solve_
    LU = splu(L.matrix.asformat("csc"), diag_pivot_thresh=1.,
    File "/nix/store/36py479ab6q1gywrvqmhx1kxcbsg7js0-python3.10-scipy-1.9.1/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/linsolve.py", line 366, in splu
    return _superlu.gstrf(N, A.nnz, A.data, A.indices, A.indptr,
    RuntimeError: Factor is exactly singular

    That's not the preferred outcome.

wd15 commented 8 months ago

@guyer, merge this one and I can merge it into #992 to add the Nix info clause