From 1e4cf5f1ae820d441e09d851faf301cb705c213a Mon Sep 17 00:00:00 2001 From: joshkamm Date: Wed, 30 Oct 2024 03:51:43 -0400 Subject: [PATCH 01/10] add pytest environment to pixi.toml add python file to start playing with pytest --- examples/geom_1/test_output.py | 2 + pixi.lock | 488 +++++++++++++++++++++++++++++++++ pixi.toml | 12 + 3 files changed, 502 insertions(+) create mode 100644 examples/geom_1/test_output.py diff --git a/examples/geom_1/test_output.py b/examples/geom_1/test_output.py new file mode 100644 index 0000000..ae2a896 --- /dev/null +++ b/examples/geom_1/test_output.py @@ -0,0 +1,2 @@ +def test_output(): + assert True \ No newline at end of file diff --git a/pixi.lock b/pixi.lock index 25ad1aa..b68a2d7 100644 --- a/pixi.lock +++ b/pixi.lock @@ -209,6 +209,55 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda + pytest: + channels: + - url: https://conda.anaconda.org/nvidia/ + - url: https://conda.anaconda.org/conda-forge/ + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.32.3-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cmake-3.30.5-hf9cb763_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.10.1-hbbe4b11_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.3-h5888daf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.64.0-h161d5f1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.49.2-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-8.3.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.13.0-h9ebbce0_100_cp313.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.13-5_cp313.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.5-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda packages: - kind: conda name: _libgcc_mutex @@ -418,6 +467,46 @@ packages: license_family: BSD size: 19707706 timestamp: 1727459501915 +- kind: conda + name: cmake + version: 3.30.5 + build: hf9cb763_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/cmake-3.30.5-hf9cb763_0.conda + sha256: 9b775bbdee337d67b180b6fbc6c93fa1ba73a18b167c242d792dee2797245148 + md5: b3b88a7ec6372b6f2c0ddb31ee009ebd + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - libcurl >=8.10.1,<9.0a0 + - libexpat >=2.6.3,<3.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libuv >=1.49.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - rhash >=1.4.4,<2.0a0 + - xz >=5.2.6,<6.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: BSD-3-Clause + license_family: BSD + size: 19606674 + timestamp: 1728416480376 +- kind: conda + name: colorama + version: 0.4.6 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_0.tar.bz2 + sha256: 2c1b2e9755ce3102bca8d69e8f26e4f087ece73f50418186aee7c74bef8e1698 + md5: 3faab06a954c2a04039983f2c4a50d99 + depends: + - python >=3.7 + license: BSD-3-Clause + license_family: BSD + size: 25170 + timestamp: 1666700778190 - kind: conda name: cuda version: 12.6.2 @@ -1205,6 +1294,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 16965 timestamp: 1726770278034 +- kind: conda + name: exceptiongroup + version: 1.2.2 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_0.conda + sha256: e0edd30c4b7144406bb4da975e6bb97d6bc9c0e999aa4efe66ae108cada5d5b5 + md5: d02ae936e42063ca46af6cdad2dbd1e0 + depends: + - python >=3.7 + license: MIT and PSF-2.0 + size: 20418 + timestamp: 1720869435725 - kind: conda name: gcc_impl_linux-64 version: 12.4.0 @@ -1311,6 +1414,21 @@ packages: license_family: BSD size: 30317 timestamp: 1727281506580 +- kind: conda + name: iniconfig + version: 2.0.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.0.0-pyhd8ed1ab_0.conda + sha256: 38740c939b668b36a50ef455b077e8015b8c9cf89860d421b3fff86048f49666 + md5: f800d2da156d08e289b14e87e43c1ae5 + depends: + - python >=3.7 + license: MIT + license_family: MIT + size: 11101 + timestamp: 1673103208955 - kind: conda name: kernel-headers_linux-64 version: 3.10.0 @@ -1408,6 +1526,23 @@ packages: license_family: GPL size: 669616 timestamp: 1727304687962 +- kind: conda + name: ld_impl_linux-64 + version: '2.43' + build: h712a8e2_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda + sha256: 7c91cea91b13f4314d125d1bedb9d03a29ebbd5080ccdea70260363424646dbe + md5: 048b02e3962f066da18efe3a21b77672 + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - binutils_impl_linux-64 2.43 + license: GPL-3.0-only + license_family: GPL + size: 669211 + timestamp: 1729655358674 - kind: conda name: libcublas version: 12.6.3.3 @@ -1760,6 +1895,21 @@ packages: license_family: MIT size: 72342 timestamp: 1725568840022 +- kind: conda + name: libffi + version: 3.4.2 + build: h7f98852_5 + build_number: 5 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 + sha256: ab6e9856c21709b7b517e940ae7028ae0737546122f83c2aa5d692860c3b149e + md5: d645c6d2ac96843a2bfaccd2d62b3ac3 + depends: + - libgcc-ng >=9.4.0 + license: MIT + license_family: MIT + size: 58292 + timestamp: 1636488182923 - kind: conda name: libgcc version: 14.1.0 @@ -1797,6 +1947,25 @@ packages: license_family: GPL size: 533503 timestamp: 1724802540921 +- kind: conda + name: libgcc + version: 14.2.0 + build: h77fa898_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda + sha256: 53eb8a79365e58849e7b1a068d31f4f9e718dc938d6f2c03e960345739a03569 + md5: 3cb76c3f10d3bc7f1105b2fc9db984df + depends: + - _libgcc_mutex 0.1 conda_forge + - _openmp_mutex >=4.5 + constrains: + - libgomp 14.2.0 h77fa898_1 + - libgcc-ng ==14.2.0=*_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 848745 + timestamp: 1729027721139 - kind: conda name: libgcc-devel_linux-64 version: 12.4.0 @@ -1843,6 +2012,21 @@ packages: license_family: GPL size: 52203 timestamp: 1724802545317 +- kind: conda + name: libgcc-ng + version: 14.2.0 + build: h69a702a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda + sha256: 3a76969c80e9af8b6e7a55090088bc41da4cffcde9e2c71b17f44d37b7cb87f7 + md5: e39480b9ca41323497b05492a63bc35b + depends: + - libgcc 14.2.0 h77fa898_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 54142 + timestamp: 1729027726517 - kind: conda name: libgfortran-ng version: 7.5.0 @@ -1901,6 +2085,36 @@ packages: license_family: GPL size: 461429 timestamp: 1724802428910 +- kind: conda + name: libgomp + version: 14.2.0 + build: h77fa898_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda + sha256: 1911c29975ec99b6b906904040c855772ccb265a1c79d5d75c8ceec4ed89cd63 + md5: cc3573974587f12dda90d96e3e55a702 + depends: + - _libgcc_mutex 0.1 conda_forge + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 460992 + timestamp: 1729027639220 +- kind: conda + name: libmpdec + version: 4.0.0 + build: h4bc722e_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-h4bc722e_0.conda + sha256: d02d1d3304ecaf5c728e515eb7416517a0b118200cd5eacbe829c432d1664070 + md5: aeb98fdeb2e8f25d43ef71fbacbeec80 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + size: 89991 + timestamp: 1723817448345 - kind: conda name: libnghttp2 version: 1.58.0 @@ -1943,6 +2157,27 @@ packages: license_family: MIT size: 677508 timestamp: 1702130071743 +- kind: conda + name: libnghttp2 + version: 1.64.0 + build: h161d5f1_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.64.0-h161d5f1_0.conda + sha256: b0f2b3695b13a989f75d8fd7f4778e1c7aabe3b36db83f0fe80b2cd812c0e975 + md5: 19e57602824042dfd0446292ef90488b + depends: + - __glibc >=2.17,<3.0.a0 + - c-ares >=1.32.3,<2.0a0 + - libev >=4.33,<4.34.0a0 + - libev >=4.33,<5.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + license_family: MIT + size: 647599 + timestamp: 1729571887612 - kind: conda name: libnpp version: 12.3.1.54 @@ -2097,6 +2332,22 @@ packages: license_family: GPL size: 3947704 timestamp: 1724801833649 +- kind: conda + name: libsqlite + version: 3.47.0 + build: hadc24fc_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda + sha256: 8a9aadf996a2399f65b679c6e7f29139d5059f699c63e6d7b50e20db10c00508 + md5: b6f02b52a174e612e89548f4663ce56a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib >=1.3.1,<2.0a0 + license: Unlicense + size: 875349 + timestamp: 1730208050020 - kind: conda name: libssh2 version: 1.11.0 @@ -2159,6 +2410,21 @@ packages: license_family: GPL size: 3892781 timestamp: 1724801863728 +- kind: conda + name: libstdcxx + version: 14.2.0 + build: hc0a3c3a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda + sha256: 4661af0eb9bdcbb5fb33e5d0023b001ad4be828fccdcc56500059d56f9869462 + md5: 234a5554c53625688d51062645337328 + depends: + - libgcc 14.2.0 h77fa898_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 3893695 + timestamp: 1729027746910 - kind: conda name: libstdcxx-devel_linux-64 version: 12.4.0 @@ -2205,6 +2471,35 @@ packages: license_family: GPL size: 52240 timestamp: 1724802596264 +- kind: conda + name: libstdcxx-ng + version: 14.2.0 + build: h4852527_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda + sha256: 25bb30b827d4f6d6f0522cc0579e431695503822f144043b93c50237017fffd8 + md5: 8371ac6457591af2cf6159439c1fd051 + depends: + - libstdcxx 14.2.0 hc0a3c3a_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 54105 + timestamp: 1729027780628 +- kind: conda + name: libuuid + version: 2.38.1 + build: h0b41bf4_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda + sha256: 787eb542f055a2b3de553614b25f09eefb0a0931b0c87dbcce6efdfd92f04f18 + md5: 40b61aab5c7ba9ff276c41cfffe6b80b + depends: + - libgcc-ng >=12 + license: BSD-3-Clause + license_family: BSD + size: 33601 + timestamp: 1680112270483 - kind: conda name: libuv version: 1.49.0 @@ -2234,6 +2529,21 @@ packages: license_family: MIT size: 878395 timestamp: 1727283212868 +- kind: conda + name: libuv + version: 1.49.2 + build: hb9d3cd8_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.49.2-hb9d3cd8_0.conda + sha256: a35cd81cd1a9add11024097da83cc06b0aae83186fe4124b77710876f37d8f31 + md5: 070e3c9ddab77e38799d5c30b109c633 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 884647 + timestamp: 1729322566955 - kind: conda name: libzlib version: 1.3.1 @@ -2268,6 +2578,24 @@ packages: license_family: Other size: 67199 timestamp: 1716874136348 +- kind: conda + name: libzlib + version: 1.3.1 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 + md5: edb0dca6bc32e4f4789199455a1dbeb8 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + constrains: + - zlib 1.3.1 *_2 + license: Zlib + license_family: Other + size: 60963 + timestamp: 1727963148474 - kind: conda name: mpi version: '1.0' @@ -2367,6 +2695,120 @@ packages: license_family: Apache size: 2891789 timestamp: 1725410790053 +- kind: conda + name: packaging + version: '24.1' + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + sha256: 36aca948219e2c9fdd6d80728bcc657519e02f06c2703d8db3446aec67f51d81 + md5: cbe1bb1f21567018ce595d9c2be0f0db + depends: + - python >=3.8 + license: Apache-2.0 + license_family: APACHE + size: 50290 + timestamp: 1718189540074 +- kind: conda + name: pluggy + version: 1.5.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.5.0-pyhd8ed1ab_0.conda + sha256: 33eaa3359948a260ebccf9cdc2fd862cea5a6029783289e13602d8e634cd9a26 + md5: d3483c8fc2dc2cc3f5cf43e26d60cabf + depends: + - python >=3.8 + license: MIT + license_family: MIT + size: 23815 + timestamp: 1713667175451 +- kind: conda + name: pytest + version: 8.3.3 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pytest-8.3.3-pyhd8ed1ab_0.conda + sha256: e99376d0068455712109d233f5790458ff861aeceb458bfda74e353338e4d815 + md5: c03d61f31f38fdb9facf70c29958bf7a + depends: + - colorama + - exceptiongroup >=1.0.0rc8 + - iniconfig + - packaging + - pluggy <2,>=1.5 + - python >=3.8 + - tomli >=1 + constrains: + - pytest-faulthandler >=2 + license: MIT + license_family: MIT + size: 258293 + timestamp: 1725977334143 +- kind: conda + name: python + version: 3.13.0 + build: h9ebbce0_100_cp313 + build_number: 100 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/python-3.13.0-h9ebbce0_100_cp313.conda + sha256: 6ab5179679f0909db828d8316f3b8b379014a82404807310fe7df5a6cf303646 + md5: 08e9aef080f33daeb192b2ddc7e4721f + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.6.3,<3.0a0 + - libffi >=3.4,<4.0a0 + - libgcc >=13 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.46.1,<4.0a0 + - libuuid >=2.38.1,<3.0a0 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - openssl >=3.3.2,<4.0a0 + - python_abi 3.13.* *_cp313 + - readline >=8.2,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - xz >=5.2.6,<6.0a0 + license: Python-2.0 + size: 33112481 + timestamp: 1728419573472 +- kind: conda + name: python_abi + version: '3.13' + build: 5_cp313 + build_number: 5 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.13-5_cp313.conda + sha256: 438225b241c5f9bddae6f0178a97f5870a89ecf927dfca54753e689907331442 + md5: 381bbd2a92c863f640a55b6ff3c35161 + constrains: + - python 3.13.* *_cp313 + license: BSD-3-Clause + license_family: BSD + size: 6217 + timestamp: 1723823393322 +- kind: conda + name: readline + version: '8.2' + build: h8228510_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda + sha256: 5435cf39d039387fbdc977b0a762357ea909a7694d9528ab40f005e9208744d7 + md5: 47d31b792659ce70f470b5c82fdfb7a4 + depends: + - libgcc-ng >=12 + - ncurses >=6.3,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 281456 + timestamp: 1679532220005 - kind: conda name: rhash version: 1.4.4 @@ -2395,6 +2837,21 @@ packages: license_family: MIT size: 185144 timestamp: 1693455923632 +- kind: conda + name: rhash + version: 1.4.5 + build: hb9d3cd8_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.5-hb9d3cd8_0.conda + sha256: 04677caac29ec64a5d41d0cca8dbec5f60fa166d5458ff5a4393e4dc08a4799e + md5: 9af0e7981755f09c81421946c4bcea04 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 186921 + timestamp: 1728886721623 - kind: conda name: sysroot_linux-64 version: '2.17' @@ -2412,6 +2869,37 @@ packages: license_family: GPL size: 15141219 timestamp: 1727437660028 +- kind: conda + name: tk + version: 8.6.13 + build: noxft_h4845f30_101 + build_number: 101 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda + sha256: e0569c9caa68bf476bead1bed3d79650bb080b532c64a4af7d8ca286c08dea4e + md5: d453b98d9c83e71da0741bb0ff4d76bc + depends: + - libgcc-ng >=12 + - libzlib >=1.2.13,<2.0.0a0 + license: TCL + license_family: BSD + size: 3318875 + timestamp: 1699202167581 +- kind: conda + name: tomli + version: 2.0.2 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda + sha256: 5e742ba856168b606ac3c814d247657b1c33b8042371f1a08000bdc5075bc0cc + md5: e977934e00b355ff55ed154904044727 + depends: + - python >=3.7 + license: MIT + license_family: MIT + size: 18203 + timestamp: 1727974767524 - kind: conda name: tzdata version: 2024b diff --git a/pixi.toml b/pixi.toml index 6221132..82e82f6 100644 --- a/pixi.toml +++ b/pixi.toml @@ -19,10 +19,18 @@ description = "Test SlaterGPU executable on a small molecular system" cwd = "build/examples/geom_1" cmd = "/export/SLURM/default/bin/srun -p zimA10 -N1 -n1 -c2 --gpus=1 ../sgpu.exe" +[feature.pytest.tasks.pytest] +description = "Invoke pytest to sanity check output from test task" +depends-on = ["test"] +cwd = "build/examples/geom_1" +cmd = "pytest" + [feature.athena] platforms = ["linux-64"] [feature.linux-64] platforms = ["linux-64"] +[feature.pytest] +platforms = ["linux-64"] [feature.athena.tasks] slurm-job = "/export/SLURM/default/bin/srun -p zimA10 -N1 -n16 --gpus=1 --pty /bin/bash" @@ -158,6 +166,10 @@ openmpi = "=3.1" # openmpi-mpicc = "=3.1" # openmpi-mpicxx = "=3.1" +[feature.pytest.dependencies] +pytest = ">=8.3.3,<9" + [environments] athena = {features = ["athena"]} linux-64 = {features = ["linux-64"]} +pytest = {features = ["pytest"]} From cf0f67cc15df190c0253490be401eb5a77cc2a2a Mon Sep 17 00:00:00 2001 From: joshkamm Date: Wed, 6 Nov 2024 02:32:01 -0500 Subject: [PATCH 02/10] #11 adding pytest to pixi start command --- pixi.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixi.toml b/pixi.toml index 82e82f6..1a97aad 100644 --- a/pixi.toml +++ b/pixi.toml @@ -6,13 +6,13 @@ platforms = ["linux-64", "linux-aarch64"] [tasks] clean = {cmd = "rm -rf build", description = "Delete build directory"} -build = {cmd = "cmake --build build -j 16", description = "Invoke cmake to compile and link the executable"} +build = {cmd = "cmake --build build -j 32", description = "Invoke cmake to compile and link the executable"} start-linux-64 = {depends-on = ["configure-linux-64", "build", "test"]} [tasks.start-athena] description = "Configure, build, and test on the Zimmerman group cluster" cmd = "echo 'Finished pixi start-athena!'" -depends-on = ["configure-athena", "build", "test"] +depends-on = ["configure-athena", "build", "pytest"] [tasks.test] description = "Test SlaterGPU executable on a small molecular system" From c2cf043b73a73f7401607d5699d1172191d92c9a Mon Sep 17 00:00:00 2001 From: joshkamm Date: Thu, 7 Nov 2024 03:27:20 -0500 Subject: [PATCH 03/10] #11 flesh out pytest for geom_1 example add numpy to pixi pytest environment --- examples/geom_1/test_output.py | 18 ++- pixi.lock | 222 ++++++++++++++++++++++++++++----- pixi.toml | 5 +- 3 files changed, 210 insertions(+), 35 deletions(-) diff --git a/examples/geom_1/test_output.py b/examples/geom_1/test_output.py index ae2a896..81643da 100644 --- a/examples/geom_1/test_output.py +++ b/examples/geom_1/test_output.py @@ -1,2 +1,18 @@ +import os +from pathlib import Path +import numpy as np +import pytest + + def test_output(): - assert True \ No newline at end of file + # convert from script location to corresponding location in build directory + script_dir = Path(os.path.abspath(__file__)).parent + script_dir_parts = list(script_dir.parts) + script_dir_parts.insert(-2, "build") + script_build_dir = Path(*script_dir_parts) + + assert script_build_dir.exists() + A = np.loadtxt(script_build_dir / "A", skiprows=1) + A_ref = np.loadtxt(script_build_dir / "A_ref", skiprows=1) + assert A.shape == A_ref.shape + assert A == pytest.approx(A_ref) diff --git a/pixi.lock b/pixi.lock index b68a2d7..faf0748 100644 --- a/pixi.lock +++ b/pixi.lock @@ -227,6 +227,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-25_linux64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-25_linux64_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.10.1-hbbe4b11_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda @@ -234,23 +236,29 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-14.2.0-h69a702a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.2.0-hd5240d6_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-25_linux64_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.64.0-h161d5f1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.28-pthreads_h94d23a6_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.49.2-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.1.3-py312h58c1407_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.5.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-8.3.3-pyhd8ed1ab_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.13.0-h9ebbce0_100_cp313.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.13-5_cp313.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.7-hc5c86c4_0_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.12-5_cp312.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.5-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda @@ -1543,6 +1551,46 @@ packages: license_family: GPL size: 669211 timestamp: 1729655358674 +- kind: conda + name: libblas + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-25_linux64_openblas.conda + sha256: d6d12dc437d060f838820e9e61bf73baab651f91935ac594cf10beb9ef1b4450 + md5: 8ea26d42ca88ec5258802715fe1ee10b + depends: + - libopenblas >=0.3.28,<0.3.29.0a0 + - libopenblas >=0.3.28,<1.0a0 + constrains: + - liblapack 3.9.0 25_linux64_openblas + - libcblas 3.9.0 25_linux64_openblas + - blas * openblas + - liblapacke 3.9.0 25_linux64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15677 + timestamp: 1729642900350 +- kind: conda + name: libcblas + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-25_linux64_openblas.conda + sha256: ab87b0477078837c91d9cda62a9faca18fba7c57cc77aa779ae24b3ac783b5dd + md5: 5dbd1b0fc0d01ec5e0e1fbe667281a11 + depends: + - libblas 3.9.0 25_linux64_openblas + constrains: + - liblapack 3.9.0 25_linux64_openblas + - blas * openblas + - liblapacke 3.9.0 25_linux64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15613 + timestamp: 1729642905619 - kind: conda name: libcublas version: 12.6.3.3 @@ -2027,6 +2075,23 @@ packages: license_family: GPL size: 54142 timestamp: 1729027726517 +- kind: conda + name: libgfortran + version: 14.2.0 + build: h69a702a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-14.2.0-h69a702a_1.conda + sha256: fc9e7f22a17faf74da904ebfc4d88699013d2992e55505e4aa0eb01770290977 + md5: f1fd30127802683586f768875127a987 + depends: + - libgfortran5 14.2.0 hd5240d6_1 + constrains: + - libgfortran-ng ==14.2.0=*_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 53997 + timestamp: 1729027752995 - kind: conda name: libgfortran-ng version: 7.5.0 @@ -2057,6 +2122,23 @@ packages: license_family: GPL size: 1309697 timestamp: 1644093800802 +- kind: conda + name: libgfortran5 + version: 14.2.0 + build: hd5240d6_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.2.0-hd5240d6_1.conda + sha256: d149a37ca73611e425041f33b9d8dbed6e52ec506fe8cc1fc0ee054bddeb6d5d + md5: 9822b874ea29af082e5d36098d25427d + depends: + - libgcc >=14.2.0 + constrains: + - libgfortran 14.2.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 1462645 + timestamp: 1729027735353 - kind: conda name: libgomp version: 14.1.0 @@ -2101,20 +2183,24 @@ packages: size: 460992 timestamp: 1729027639220 - kind: conda - name: libmpdec - version: 4.0.0 - build: h4bc722e_0 + name: liblapack + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-h4bc722e_0.conda - sha256: d02d1d3304ecaf5c728e515eb7416517a0b118200cd5eacbe829c432d1664070 - md5: aeb98fdeb2e8f25d43ef71fbacbeec80 + url: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-25_linux64_openblas.conda + sha256: 9d1ff017714edb2d84868f0f931a4a0e7c289a971062b2ac66cfc8145df7e20e + md5: 4dc03a53fc69371a6158d0ed37214cd3 depends: - - __glibc >=2.17,<3.0.a0 - - libgcc-ng >=12 - license: BSD-2-Clause + - libblas 3.9.0 25_linux64_openblas + constrains: + - liblapacke 3.9.0 25_linux64_openblas + - libcblas 3.9.0 25_linux64_openblas + - blas * openblas + license: BSD-3-Clause license_family: BSD - size: 89991 - timestamp: 1723817448345 + size: 15608 + timestamp: 1729642910812 - kind: conda name: libnghttp2 version: 1.58.0 @@ -2213,6 +2299,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 450976 timestamp: 1723660954045 +- kind: conda + name: libnsl + version: 2.0.1 + build: hd590300_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda + sha256: 26d77a3bb4dceeedc2a41bd688564fe71bf2d149fdcf117049970bc02ff1add6 + md5: 30fd6e37fe21f86f4bd26d6ee73eeec7 + depends: + - libgcc-ng >=12 + license: LGPL-2.1-only + license_family: GPL + size: 33408 + timestamp: 1697359010159 - kind: conda name: libnvfatbin version: 12.6.77 @@ -2316,6 +2416,26 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 27438 timestamp: 1723657907832 +- kind: conda + name: libopenblas + version: 0.3.28 + build: pthreads_h94d23a6_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.28-pthreads_h94d23a6_1.conda + sha256: 99ba271d8a80a1af2723f2e124ffd91d850074c0389c067e6d96d72a2dbfeabe + md5: 62857b389e42b36b686331bec0922050 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.2.0 + constrains: + - openblas >=0.3.28,<0.3.29.0a0 + license: BSD-3-Clause + license_family: BSD + size: 5578513 + timestamp: 1730772671118 - kind: conda name: libsanitizer version: 12.4.0 @@ -2544,6 +2664,20 @@ packages: license_family: MIT size: 884647 timestamp: 1729322566955 +- kind: conda + name: libxcrypt + version: 4.4.36 + build: hd590300_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + sha256: 6ae68e0b86423ef188196fff6207ed0c8195dd84273cb5623b85aa08033a410c + md5: 5aa797f8787fe7a17d1b0821485b5adc + depends: + - libgcc-ng >=12 + license: LGPL-2.1-or-later + size: 100393 + timestamp: 1702724383534 - kind: conda name: libzlib version: 1.3.1 @@ -2647,6 +2781,29 @@ packages: md5: 217ed2ff255f52cbef787aba3f9b9637 size: 699526661 timestamp: 1709778043113 +- kind: conda + name: numpy + version: 2.1.3 + build: py312h58c1407_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.1.3-py312h58c1407_0.conda + sha256: e4c14f71588a5627a6935d3e7d9ca78a8387229ec8ebc91616b0988ce57ba0dc + md5: dfdbc12e6d81889ba4c494a23f23eba8 + depends: + - __glibc >=2.17,<3.0.a0 + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - libgcc >=13 + - liblapack >=3.9.0,<4.0a0 + - libstdcxx >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + size: 8388631 + timestamp: 1730588649810 - kind: conda name: openmpi version: 3.1.4 @@ -2750,13 +2907,12 @@ packages: timestamp: 1725977334143 - kind: conda name: python - version: 3.13.0 - build: h9ebbce0_100_cp313 - build_number: 100 + version: 3.12.7 + build: hc5c86c4_0_cpython subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/python-3.13.0-h9ebbce0_100_cp313.conda - sha256: 6ab5179679f0909db828d8316f3b8b379014a82404807310fe7df5a6cf303646 - md5: 08e9aef080f33daeb192b2ddc7e4721f + url: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.7-hc5c86c4_0_cpython.conda + sha256: 674be31ff152d9f0e0fe16959a45e3803a730fc4f54d87df6a9ac4e6a698c41d + md5: 0515111a9cdf69f83278f7c197db9807 depends: - __glibc >=2.17,<3.0.a0 - bzip2 >=1.0.8,<2.0a0 @@ -2764,35 +2920,37 @@ packages: - libexpat >=2.6.3,<3.0a0 - libffi >=3.4,<4.0a0 - libgcc >=13 - - libmpdec >=4.0.0,<5.0a0 + - libnsl >=2.0.1,<2.1.0a0 - libsqlite >=3.46.1,<4.0a0 - libuuid >=2.38.1,<3.0a0 + - libxcrypt >=4.4.36 - libzlib >=1.3.1,<2.0a0 - ncurses >=6.5,<7.0a0 - openssl >=3.3.2,<4.0a0 - - python_abi 3.13.* *_cp313 - readline >=8.2,<9.0a0 - tk >=8.6.13,<8.7.0a0 - tzdata - xz >=5.2.6,<6.0a0 + constrains: + - python_abi 3.12.* *_cp312 license: Python-2.0 - size: 33112481 - timestamp: 1728419573472 + size: 31574780 + timestamp: 1728059777603 - kind: conda name: python_abi - version: '3.13' - build: 5_cp313 + version: '3.12' + build: 5_cp312 build_number: 5 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.13-5_cp313.conda - sha256: 438225b241c5f9bddae6f0178a97f5870a89ecf927dfca54753e689907331442 - md5: 381bbd2a92c863f640a55b6ff3c35161 + url: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.12-5_cp312.conda + sha256: d10e93d759931ffb6372b45d65ff34d95c6000c61a07e298d162a3bc2accebb0 + md5: 0424ae29b104430108f5218a66db7260 constrains: - - python 3.13.* *_cp313 + - python 3.12.* *_cpython license: BSD-3-Clause license_family: BSD - size: 6217 - timestamp: 1723823393322 + size: 6238 + timestamp: 1723823388266 - kind: conda name: readline version: '8.2' diff --git a/pixi.toml b/pixi.toml index 1a97aad..030db39 100644 --- a/pixi.toml +++ b/pixi.toml @@ -17,12 +17,12 @@ depends-on = ["configure-athena", "build", "pytest"] [tasks.test] description = "Test SlaterGPU executable on a small molecular system" cwd = "build/examples/geom_1" -cmd = "/export/SLURM/default/bin/srun -p zimA10 -N1 -n1 -c2 --gpus=1 ../sgpu.exe" +cmd = "/export/SLURM/default/bin/srun -p zim2080 -N1 -n1 -c2 --gpus=1 ../sgpu.exe" [feature.pytest.tasks.pytest] description = "Invoke pytest to sanity check output from test task" depends-on = ["test"] -cwd = "build/examples/geom_1" +cwd = "examples/geom_1" cmd = "pytest" [feature.athena] @@ -168,6 +168,7 @@ openmpi = "=3.1" [feature.pytest.dependencies] pytest = ">=8.3.3,<9" +numpy = ">=2.1.3,<3" [environments] athena = {features = ["athena"]} From ac429783d29d6ed697befe164f29fc3df0107eb5 Mon Sep 17 00:00:00 2001 From: joshkamm Date: Fri, 8 Nov 2024 02:57:25 -0500 Subject: [PATCH 04/10] #11 set relative and absolute tolerances when comparing output --- examples/geom_1/test_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/geom_1/test_output.py b/examples/geom_1/test_output.py index 81643da..0a748fc 100644 --- a/examples/geom_1/test_output.py +++ b/examples/geom_1/test_output.py @@ -15,4 +15,4 @@ def test_output(): A = np.loadtxt(script_build_dir / "A", skiprows=1) A_ref = np.loadtxt(script_build_dir / "A_ref", skiprows=1) assert A.shape == A_ref.shape - assert A == pytest.approx(A_ref) + assert A == pytest.approx(A_ref, rel=1e-3, abs=1e-6) From e59e15ceb93ca3f3e28a414c63621096bee6dd7a Mon Sep 17 00:00:00 2001 From: joshkamm Date: Fri, 8 Nov 2024 18:23:34 -0500 Subject: [PATCH 05/10] #11 update relative tolerance based on conversation with Paul --- examples/geom_1/test_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/geom_1/test_output.py b/examples/geom_1/test_output.py index 0a748fc..3da3ccb 100644 --- a/examples/geom_1/test_output.py +++ b/examples/geom_1/test_output.py @@ -15,4 +15,4 @@ def test_output(): A = np.loadtxt(script_build_dir / "A", skiprows=1) A_ref = np.loadtxt(script_build_dir / "A_ref", skiprows=1) assert A.shape == A_ref.shape - assert A == pytest.approx(A_ref, rel=1e-3, abs=1e-6) + assert A == pytest.approx(A_ref, rel=1e-6, abs=1e-6) From 339c8c62be78a32e08002a7662e5354319831ac9 Mon Sep 17 00:00:00 2001 From: joshkamm Date: Fri, 15 Nov 2024 02:22:51 -0500 Subject: [PATCH 06/10] #11 move file with pytests --- examples/{geom_1 => }/test_output.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{geom_1 => }/test_output.py (100%) diff --git a/examples/geom_1/test_output.py b/examples/test_output.py similarity index 100% rename from examples/geom_1/test_output.py rename to examples/test_output.py From 389fe020504c52dc468895f3dbf546f93df3adfa Mon Sep 17 00:00:00 2001 From: joshkamm Date: Fri, 15 Nov 2024 03:09:36 -0500 Subject: [PATCH 07/10] #11 parametrize pytest to check multiple integral files move location of pytest file from specific example to examples folder add pycache to gitignore --- .gitignore | 1 + examples/test_output.py | 20 +++++++++----------- pixi.toml | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 33b0354..1ea1673 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ compile_commands.json CTestTestfile.cmake _deps build* +/examples/__pycache__ # pixi environments .pixi *.egg-info diff --git a/examples/test_output.py b/examples/test_output.py index 3da3ccb..4cca058 100644 --- a/examples/test_output.py +++ b/examples/test_output.py @@ -3,16 +3,14 @@ import numpy as np import pytest - -def test_output(): - # convert from script location to corresponding location in build directory +@pytest.mark.parametrize("filename", ["A", "Ciap", "pVp"]) +def test_output(filename): + # convert from script location to where the output files should be located script_dir = Path(os.path.abspath(__file__)).parent - script_dir_parts = list(script_dir.parts) - script_dir_parts.insert(-2, "build") - script_build_dir = Path(*script_dir_parts) + example_output_dir = script_dir.parent / "build" / "examples" / "geom_1" - assert script_build_dir.exists() - A = np.loadtxt(script_build_dir / "A", skiprows=1) - A_ref = np.loadtxt(script_build_dir / "A_ref", skiprows=1) - assert A.shape == A_ref.shape - assert A == pytest.approx(A_ref, rel=1e-6, abs=1e-6) + assert example_output_dir.exists() + output = np.loadtxt(example_output_dir / filename, skiprows=1) + reference_output = np.loadtxt(example_output_dir / f"{filename}_ref", skiprows=1) + assert output.shape == reference_output.shape + assert output == pytest.approx(reference_output, rel=1e-6, abs=1e-6) diff --git a/pixi.toml b/pixi.toml index 030db39..b12de8e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -22,7 +22,7 @@ cmd = "/export/SLURM/default/bin/srun -p zim2080 -N1 -n1 -c2 --gpus=1 ../sgpu.ex [feature.pytest.tasks.pytest] description = "Invoke pytest to sanity check output from test task" depends-on = ["test"] -cwd = "examples/geom_1" +cwd = "examples" cmd = "pytest" [feature.athena] From 472d48f646558441a6c9819b66f4d3bdadb69736 Mon Sep 17 00:00:00 2001 From: joshkamm Date: Sat, 16 Nov 2024 20:27:07 -0500 Subject: [PATCH 08/10] #11 wip allowing for comparing multiple matrices as in SENT --- examples/test_output.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/examples/test_output.py b/examples/test_output.py index 4cca058..703d510 100644 --- a/examples/test_output.py +++ b/examples/test_output.py @@ -10,7 +10,21 @@ def test_output(filename): example_output_dir = script_dir.parent / "build" / "examples" / "geom_1" assert example_output_dir.exists() - output = np.loadtxt(example_output_dir / filename, skiprows=1) - reference_output = np.loadtxt(example_output_dir / f"{filename}_ref", skiprows=1) - assert output.shape == reference_output.shape - assert output == pytest.approx(reference_output, rel=1e-6, abs=1e-6) + + with open(example_output_dir / filename) as output, open( + example_output_dir / f"{filename}_ref" + ) as reference_output: + output = list(output) + for i, line in enumerate(reference_output): + if line.endswith(":"): + continue + assert np.fromstring(output[i], sep=" ") == pytest.approx( + np.fromstring(line, sep=" "), rel=1e-6, abs=1e-6 + ) + # matrix_boundaries = [line for line in file if line.endswith(':')] + [-1] + # for idx in range(len(matrix_boundaries)-1): + + # output = np.loadtxt(example_output_dir / filename, skiprows=matrix_boundaries[idx]) + # reference_output = np.loadtxt(example_output_dir / f"{filename}_ref", skiprows=matrix_boundaries[idx]+1, max_rows=matrix_boundaries[idx+1]-matrix_boundaries[idx]) + # assert output.shape == reference_output.shape + # assert output == pytest.approx(reference_output, rel=1e-6, abs=1e-6) From 4bfea6dad162d1739026a349d79d03a1d22d9a99 Mon Sep 17 00:00:00 2001 From: joshkamm Date: Tue, 19 Nov 2024 02:40:11 -0500 Subject: [PATCH 09/10] #11 wip reading multiple matrices from same file --- examples/test_output.py | 51 ++++++++++++++++++++++++++--------------- pixi.toml | 2 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/examples/test_output.py b/examples/test_output.py index 703d510..a8326b1 100644 --- a/examples/test_output.py +++ b/examples/test_output.py @@ -1,3 +1,4 @@ +from itertools import pairwise import os from pathlib import Path import numpy as np @@ -5,26 +6,40 @@ @pytest.mark.parametrize("filename", ["A", "Ciap", "pVp"]) def test_output(filename): - # convert from script location to where the output files should be located + # Convert from the script location to where the output files should be located. script_dir = Path(os.path.abspath(__file__)).parent example_output_dir = script_dir.parent / "build" / "examples" / "geom_1" assert example_output_dir.exists() - with open(example_output_dir / filename) as output, open( - example_output_dir / f"{filename}_ref" - ) as reference_output: - output = list(output) - for i, line in enumerate(reference_output): - if line.endswith(":"): - continue - assert np.fromstring(output[i], sep=" ") == pytest.approx( - np.fromstring(line, sep=" "), rel=1e-6, abs=1e-6 - ) - # matrix_boundaries = [line for line in file if line.endswith(':')] + [-1] - # for idx in range(len(matrix_boundaries)-1): - - # output = np.loadtxt(example_output_dir / filename, skiprows=matrix_boundaries[idx]) - # reference_output = np.loadtxt(example_output_dir / f"{filename}_ref", skiprows=matrix_boundaries[idx]+1, max_rows=matrix_boundaries[idx+1]-matrix_boundaries[idx]) - # assert output.shape == reference_output.shape - # assert output == pytest.approx(reference_output, rel=1e-6, abs=1e-6) + with open(example_output_dir / f"{filename}_ref") as reference_output: + # output = list(output) + # for i, line in enumerate(reference_output): + # if line.endswith(":"): + # continue + # assert np.fromstring(output[i], sep=" ") == pytest.approx( + # np.fromstring(line, sep=" "), rel=1e-6, abs=1e-6 + # ) + matrix_boundaries = [ + line_num + for line_num, line in enumerate(reference_output) + # Get header lines for matrices and blank last line. + if line.strip().endswith(":") + ] + [len(reference_output)] # JOSH - RESUME HERE + print(f"{matrix_boundaries = }") + for header_row, end_row in pairwise(matrix_boundaries): + start_row = header_row + 1 + num_rows = end_row - start_row + output = np.loadtxt( + example_output_dir / filename, + skiprows=start_row, + max_rows=num_rows, + ) + reference_output = np.loadtxt( + example_output_dir / f"{filename}_ref", + skiprows=start_row, + max_rows=num_rows, + ) + assert output.shape == reference_output.shape + assert output + 1 == pytest.approx(reference_output, rel=1e-6, abs=1e-6) + assert False diff --git a/pixi.toml b/pixi.toml index b12de8e..ccb72e9 100644 --- a/pixi.toml +++ b/pixi.toml @@ -173,4 +173,4 @@ numpy = ">=2.1.3,<3" [environments] athena = {features = ["athena"]} linux-64 = {features = ["linux-64"]} -pytest = {features = ["pytest"]} +pytest = {features = ["pytest", "athena"]} From 6dc5a88072ffa661b24af0ceb329b3850ce9511a Mon Sep 17 00:00:00 2001 From: joshkamm Date: Wed, 20 Nov 2024 04:09:01 -0500 Subject: [PATCH 10/10] #11 comparing multiple matrices in same file --- examples/test_output.py | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/examples/test_output.py b/examples/test_output.py index a8326b1..3908ac7 100644 --- a/examples/test_output.py +++ b/examples/test_output.py @@ -4,42 +4,34 @@ import numpy as np import pytest -@pytest.mark.parametrize("filename", ["A", "Ciap", "pVp"]) +@pytest.mark.parametrize("filename", ["A", "Ciap", "pVp", "SENT"]) def test_output(filename): # Convert from the script location to where the output files should be located. script_dir = Path(os.path.abspath(__file__)).parent example_output_dir = script_dir.parent / "build" / "examples" / "geom_1" - assert example_output_dir.exists() - with open(example_output_dir / f"{filename}_ref") as reference_output: - # output = list(output) - # for i, line in enumerate(reference_output): - # if line.endswith(":"): - # continue - # assert np.fromstring(output[i], sep=" ") == pytest.approx( - # np.fromstring(line, sep=" "), rel=1e-6, abs=1e-6 - # ) - matrix_boundaries = [ - line_num - for line_num, line in enumerate(reference_output) - # Get header lines for matrices and blank last line. - if line.strip().endswith(":") - ] + [len(reference_output)] # JOSH - RESUME HERE - print(f"{matrix_boundaries = }") + reference_output_lines = reference_output.readlines() + + matrix_boundaries = [ + line_num + for line_num, line in enumerate(reference_output_lines) + # Get header lines for matrices and blank last line. + if line.strip().endswith(":") + ] + [len(reference_output_lines)] + + # Loop over each matrix in the file and compare to the reference. for header_row, end_row in pairwise(matrix_boundaries): start_row = header_row + 1 num_rows = end_row - start_row - output = np.loadtxt( + matrix = np.loadtxt( example_output_dir / filename, skiprows=start_row, max_rows=num_rows, ) - reference_output = np.loadtxt( + reference_matrix = np.loadtxt( example_output_dir / f"{filename}_ref", skiprows=start_row, max_rows=num_rows, ) - assert output.shape == reference_output.shape - assert output + 1 == pytest.approx(reference_output, rel=1e-6, abs=1e-6) - assert False + assert matrix == pytest.approx(reference_matrix, rel=1e-6, abs=1e-6)