From d9fdad100b86a3ae6b5b4669883b9215845ffdf0 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 10:03:46 +0100 Subject: [PATCH 01/10] bump and add MDAnalysis --- poetry.lock | 144 +++++++++++++++++++++++++++++++++++++++++++------ pyproject.toml | 3 +- 2 files changed, 129 insertions(+), 18 deletions(-) diff --git a/poetry.lock b/poetry.lock index 82fd606..2604767 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "ase" @@ -21,6 +21,17 @@ docs = ["pillow", "sphinx", "sphinx-rtd-theme"] spglib = ["spglib (>=1.9)"] test = ["pytest (>=7.0.0)", "pytest-xdist (>=2.1.0)"] +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + [[package]] name = "cfgv" version = "3.4.0" @@ -32,6 +43,57 @@ files = [ {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, ] +[[package]] +name = "cftime" +version = "1.6.4.post1" +description = "Time-handling functionality from netcdf4-python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "cftime-1.6.4.post1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0baa9bc4850929da9f92c25329aa1f651e2d6f23e237504f337ee9e12a769f5d"}, + {file = "cftime-1.6.4.post1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6bb6b087f4b2513c37670bccd457e2a666ca489c5f2aad6e2c0e94604dc1b5b9"}, + {file = "cftime-1.6.4.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7d9bdeb9174962c9ca00015190bfd693de6b0ec3ec0b3dbc35c693a4f48efdcc"}, + {file = "cftime-1.6.4.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e735cfd544878eb94d0108ff5a093bd1a332dba90f979a31a357756d609a90d5"}, + {file = "cftime-1.6.4.post1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1dcd1b140bf50da6775c56bd7ca179e84bd258b2f159b53eefd5c514b341f2bf"}, + {file = "cftime-1.6.4.post1-cp310-cp310-win_amd64.whl", hash = "sha256:e60b8f24b20753f7548f410f7510e28b941f336f84bd34e3cfd7874af6e70281"}, + {file = "cftime-1.6.4.post1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1bf7be0a0afc87628cb8c8483412aac6e48e83877004faa0936afb5bf8a877ba"}, + {file = "cftime-1.6.4.post1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0f64ca83acc4e3029f737bf3a32530ffa1fbf53124f5bee70b47548bc58671a7"}, + {file = "cftime-1.6.4.post1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7ebdfd81726b0cfb8b524309224fa952898dfa177c13d5f6af5b18cefbf497d"}, + {file = "cftime-1.6.4.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9ea0965a4c87739aebd84fe8eed966e5809d10065eeffd35c99c274b6f8da15"}, + {file = "cftime-1.6.4.post1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:800a18aea4e8cb2b206450397cb8a53b154798738af3cdd3c922ce1ca198b0e6"}, + {file = "cftime-1.6.4.post1-cp311-cp311-win_amd64.whl", hash = "sha256:5dcfc872f455db1f12eabe3c3ba98e93757cd60ed3526a53246e966ccde46c8a"}, + {file = "cftime-1.6.4.post1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a590f73506f4704ba5e154ef55bfbaed5e1b4ac170f3caeb8c58e4f2c619ee4e"}, + {file = "cftime-1.6.4.post1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:933cb10e1af4e362e77f513e3eb92b34a688729ddbf938bbdfa5ac20a7f44ba0"}, + {file = "cftime-1.6.4.post1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf17a1b36f62e9e73c4c9363dd811e1bbf1170f5ac26d343fb26012ccf482908"}, + {file = "cftime-1.6.4.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e18021f421aa26527bad8688c1acf0c85fa72730beb6efce969c316743294f2"}, + {file = "cftime-1.6.4.post1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5835b9d622f9304d1c23a35603a0f068739f428d902860f25e6e7e5a1b7cd8ea"}, + {file = "cftime-1.6.4.post1-cp312-cp312-win_amd64.whl", hash = "sha256:7f50bf0d1b664924aaee636eb2933746b942417d1f8b82ab6c1f6e8ba0da6885"}, + {file = "cftime-1.6.4.post1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5c89766ebf088c097832ea618c24ed5075331f0b7bf8e9c2d4144aefbf2f1850"}, + {file = "cftime-1.6.4.post1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7f27113f7ccd1ca32881fdcb9a4bec806a5f54ae621fc1c374f1171f3ed98ef2"}, + {file = "cftime-1.6.4.post1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da367b23eea7cf4df071c88e014a1600d6c5bbf22e3393a4af409903fa397e28"}, + {file = "cftime-1.6.4.post1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6579c5c83cdf09d73aa94c7bc34925edd93c5f2c7dd28e074f568f7e376271a0"}, + {file = "cftime-1.6.4.post1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6b731c7133d17b479ca0c3c46a7a04f96197f0a4d753f4c2284c3ff0447279b4"}, + {file = "cftime-1.6.4.post1-cp313-cp313-win_amd64.whl", hash = "sha256:d2a8c223faea7f1248ab469cc0d7795dd46f2a423789038f439fee7190bae259"}, + {file = "cftime-1.6.4.post1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9df3e2d49e548c62d1939e923800b08d2ab732d3ac8d75b857edd7982c878552"}, + {file = "cftime-1.6.4.post1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2892b7e7654142d825655f60eb66c3e1af745901890316907071d44cf9a18d8a"}, + {file = "cftime-1.6.4.post1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a4ab54e6c04e68395d454cd4001188fc4ade2fe48035589ed65af80c4527ef08"}, + {file = "cftime-1.6.4.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:568b69fc52f406e361db62a4d7a219c6fb0ced138937144c3b3a511648dd6c50"}, + {file = "cftime-1.6.4.post1-cp38-cp38-win_amd64.whl", hash = "sha256:640911d2629f4a8f81f6bc0163a983b6b94f86d1007449b8cbfd926136cda253"}, + {file = "cftime-1.6.4.post1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:44e9f8052600803b55f8cb6bcac2be49405c21efa900ec77a9fb7f692db2f7a6"}, + {file = "cftime-1.6.4.post1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a90b6ef4a3fc65322c212a2c99cec75d1886f1ebaf0ff6189f7b327566762222"}, + {file = "cftime-1.6.4.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652700130dbcca3ae36dbb5b61ff360e62aa09fabcabc42ec521091a14389901"}, + {file = "cftime-1.6.4.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24a7fb6cc541a027dab37fdeb695f8a2b21cd7d200be606f81b5abc38f2391e2"}, + {file = "cftime-1.6.4.post1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:fc2c0abe2dbd147e1b1e6d0f3de19a5ea8b04956acc204830fd8418066090989"}, + {file = "cftime-1.6.4.post1-cp39-cp39-win_amd64.whl", hash = "sha256:0ee2f5af8643aa1b47b7e388763a1a6e0dc05558cd2902cffb9cbcf954397648"}, + {file = "cftime-1.6.4.post1.tar.gz", hash = "sha256:50ac76cc9f10ab7bd46e44a71c51a6927051b499b4407df4f29ab13d741b942f"}, +] + +[package.dependencies] +numpy = [ + {version = ">1.13.3", markers = "python_version < \"3.12.0.rc1\""}, + {version = ">=1.26.0b1", markers = "python_version >= \"3.12.0.rc1\""}, +] + [[package]] name = "chemfiles" version = "0.10.4" @@ -768,28 +830,29 @@ parallel = ["dask"] [[package]] name = "mdtraj" -version = "1.10.1" +version = "1.10.2" description = "MDTraj: A modern, open library for the analysis of molecular dynamics trajectories" optional = false python-versions = ">=3.9" files = [ - {file = "mdtraj-1.10.1-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:f857a9547cdd0cfdb84c97997fc5388708942a5fd37aca2615954e631120c25c"}, - {file = "mdtraj-1.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dc2535d00e7731ca0afa248496c752c3a54cfcf02c14b78972f6c1b702e5cffc"}, - {file = "mdtraj-1.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0a53b0c4e341f96b9171c10a441e703a23f0e983b791b11736cfbd2aae7669b"}, - {file = "mdtraj-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ccde745034c9de2ae34c8d2b627e86486e4968a34e55b68004fb4fd20f7121d"}, - {file = "mdtraj-1.10.1-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:fa1c7889a03befde44eacaf4f9e55dcc2796d072d6d4dbbf6c1400d8c96ce5da"}, - {file = "mdtraj-1.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3f8a8aca9e45bdb50eb4e08a36940b7b4fbd1af30b8101827b0b0384334e2dc3"}, - {file = "mdtraj-1.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49db6ff648520bcffedd1640de1b2ea473fa1105a0ccae266d36a6bf153771e3"}, - {file = "mdtraj-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ea6517cc1fe860af46499c18631822c6b1fb757fb8e311f2bcb8ed7494247e5"}, - {file = "mdtraj-1.10.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aa463d4c0bbddfcb2eabbfca13e50b141091eaf5e8dc3a1b5e39961dd5cb9293"}, - {file = "mdtraj-1.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aa84830cb47bdcb42b5a435cefd2295e11342aa9425d2c6e635af4910d7e59fc"}, - {file = "mdtraj-1.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23d87782689de621548a8c670b590fe5ffb4f815d56b745835c950f01a11045f"}, - {file = "mdtraj-1.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e1db887f63cdb5271cd8c06ab5869d5b0f5fa3356dfdd8ebe639463bc9dae0a7"}, - {file = "mdtraj-1.10.1.tar.gz", hash = "sha256:2e427d007194a64cf2ac92e1e10572d975ba914ab63e315b747738d71cf148da"}, + {file = "mdtraj-1.10.2-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:1ca5e9b4a06d2eaa109e9afbb1640e80862940e354ad8b925df7eb4dd49ab06c"}, + {file = "mdtraj-1.10.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4bc209df2c0bf9e87b51f1f5a63e05e9008f88d9d6d9c6c3bc43d02cf22f397f"}, + {file = "mdtraj-1.10.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:056985b50427f0991e8f7b7eeb462c9520b6d677a6a428e561d86291a212cb91"}, + {file = "mdtraj-1.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f501d11487be69a1ea2759f6127f065137046f4027b3933877599bb4c3b34ffd"}, + {file = "mdtraj-1.10.2-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:070608a08c69ae451044900fca8cb5bbbb501cc03b10d7bd4b36f6af6d2324e9"}, + {file = "mdtraj-1.10.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9926545a79ba5891dcbf270d7f6628f56ccfbacee822f0f147118506bf8190a7"}, + {file = "mdtraj-1.10.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9f0cf129dd34b6f23fc215e0014f9e14b352689dc4d3ce0d41eeaef92b2ab04"}, + {file = "mdtraj-1.10.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01a08cd23d172ac14bd27a587675cb24f3f16f3d272396bedc66fe4895727d28"}, + {file = "mdtraj-1.10.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3ec4842bc244c213917bf49c663d038ea7a9b5babcd2c08ceef0e3c65cce2472"}, + {file = "mdtraj-1.10.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:966f1ab35e7965ae305941d6404b54f67b1544deb56f212d03694b6ead1e326e"}, + {file = "mdtraj-1.10.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fbb774291e330c2640502007c894ca3066e99aba091a1433075a3a61764d0302"}, + {file = "mdtraj-1.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de76f061a6f4148227734c1ccab51d5dc6865078167bce478acd5f73d965b498"}, + {file = "mdtraj-1.10.2.tar.gz", hash = "sha256:8108bd42792b653f96c9352956f1100ccebbe21b0fe598b05a7a85c39704136f"}, ] [package.dependencies] -numpy = ">=1.23,<2.0.0a0" +netCDF4 = "*" +numpy = "<3" packaging = "*" pyparsing = "*" scipy = "*" @@ -910,6 +973,53 @@ files = [ {file = "msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"}, ] +[[package]] +name = "netcdf4" +version = "1.7.2" +description = "Provides an object-oriented python interface to the netCDF version 4 library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "netCDF4-1.7.2-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:5e9b485e3bd9294d25ff7dc9addefce42b3d23c1ee7e3627605277d159819392"}, + {file = "netCDF4-1.7.2-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:118b476fd00d7e3ab9aa7771186d547da645ae3b49c0c7bdab866793ebf22f07"}, + {file = "netCDF4-1.7.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abe5b1837ff209185ecfe50bd71884c866b3ee69691051833e410e57f177e059"}, + {file = "netCDF4-1.7.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28021c7e886e5bccf9a8ce504c032d1d7f98d86f67495fb7cf2c9564eba04510"}, + {file = "netCDF4-1.7.2-cp310-cp310-win_amd64.whl", hash = "sha256:7460b638e41c8ce4179d082a81cb6456f0ce083d4d959f4d9e87a95cd86f64cb"}, + {file = "netCDF4-1.7.2-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:09d61c2ddb6011afb51e77ea0f25cd0bdc28887fb426ffbbc661d920f20c9749"}, + {file = "netCDF4-1.7.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:fd2a16dbddeb8fa7cf48c37bfc1967290332f2862bb82f984eec2007bb120aeb"}, + {file = "netCDF4-1.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f54f5d39ffbcf1726a1e6fd90cb5fa74277ecea739a5fa0f424636d71beafe24"}, + {file = "netCDF4-1.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:902aa50d70f49d002d896212a171d344c38f7b8ca520837c56c922ac1535c4a3"}, + {file = "netCDF4-1.7.2-cp311-cp311-win_amd64.whl", hash = "sha256:3291f9ad0c98c49a4dd16aefad1a9abd3a1b884171db6c81bdcee94671cfabe3"}, + {file = "netCDF4-1.7.2-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:e73e3baa0b74afc414e53ff5095748fdbec7fb346eda351e567c23f2f0d247f1"}, + {file = "netCDF4-1.7.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a51da09258b31776f474c1d47e484fc7214914cdc59edf4cee789ba632184591"}, + {file = "netCDF4-1.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb95b11804fe051897d1f2044b05d82a1847bc2549631cdd2f655dde7de77a9c"}, + {file = "netCDF4-1.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9d8a848373723f41ef662590b4f5e1832227501c9fd4513e8ad8da58c269977"}, + {file = "netCDF4-1.7.2-cp312-cp312-win_amd64.whl", hash = "sha256:568ea369e00b581302d77fc5fd0b8f78e520c7e08d0b5af5219ba51f3f1cd694"}, + {file = "netCDF4-1.7.2-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:205a5f1de3ddb993c7c97fb204a923a22408cc2e5facf08d75a8eb89b3e7e1a8"}, + {file = "netCDF4-1.7.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:96653fc75057df196010818367c63ba6d7e9af603df0a7fe43fcdad3fe0e9e56"}, + {file = "netCDF4-1.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30d20e56b9ba2c48884eb89c91b63e6c0612b4927881707e34402719153ef17f"}, + {file = "netCDF4-1.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d6bfd38ba0bde04d56f06c1554714a2ea9dab75811c89450dc3ec57a9d36b80"}, + {file = "netCDF4-1.7.2-cp313-cp313-win_amd64.whl", hash = "sha256:5c5fbee6134ee1246c397e1508e5297d825aa19221fdf3fa8dc9727ad824d7a5"}, + {file = "netCDF4-1.7.2-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:6bf402c2c7c063474576e5cf89af877d0b0cd097d9316d5bc4fcb22b62f12567"}, + {file = "netCDF4-1.7.2-cp38-cp38-macosx_14_0_arm64.whl", hash = "sha256:5bdf3b34e6fd4210e34fdc5d1a669a22c4863d96f8a20a3928366acae7b3cbbb"}, + {file = "netCDF4-1.7.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:657774404b9f78a5e4d26506ac9bfe106e4a37238282a70803cc7ce679c5a6cc"}, + {file = "netCDF4-1.7.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e896d92f01fbf365e33e2513d5a8c4cfe16ff406aae9b6034e5ba1538c8c7a8"}, + {file = "netCDF4-1.7.2-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:eb87c08d1700fe67c301898cf5ba3a3e1f8f2fbb417fcd0e2ac784846b60b058"}, + {file = "netCDF4-1.7.2-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:59b403032774c723ee749d7f2135be311bad7d00d1db284bebfab58b9d5cdb92"}, + {file = "netCDF4-1.7.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:572f71459ef4b30e8554dcc4e1e6f55de515acc82a50968b48fe622244a64548"}, + {file = "netCDF4-1.7.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f77e72281acc5f331f82271e5f7f014d46f5ca9bcaa5aafe3e46d66cee21320"}, + {file = "netCDF4-1.7.2-cp39-cp39-win_amd64.whl", hash = "sha256:d0fa7a9674fae8ae4877e813173c3ff7a6beee166b8730bdc847f517b282ed31"}, + {file = "netcdf4-1.7.2.tar.gz", hash = "sha256:a4c6375540b19989896136943abb6d44850ff6f1fa7d3f063253b1ad3f8b7fce"}, +] + +[package.dependencies] +certifi = "*" +cftime = "*" +numpy = "*" + +[package.extras] +tests = ["Cython", "packaging", "pytest"] + [[package]] name = "networkx" version = "3.4.2" @@ -1796,4 +1906,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "8dca69fd7831598e6770d951f8de3eca59b10ee652133e66c9d576ed1630617e" +content-hash = "821d5220da7c2f347e2b9b47ff9a3e4a2f97dbaf652d101b0937322444e7e8b2" diff --git a/pyproject.toml b/pyproject.toml index a6959af..a74fe55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,8 @@ rdkit2ase = "^0.1.4" [tool.poetry.group.benchmark.dependencies] pandas = "^2.2.2" chemfiles = "^0.10.4" -mdtraj = "^1.10.0" +mdtraj = "^1.10.2" +mdanalysis = "^2.8.0" [tool.poetry.scripts] From 48d06548980d35db84a56a977c1a64e230972a16 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 10:03:55 +0100 Subject: [PATCH 02/10] draft run comparison in CI --- tests/comparison.py | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/comparison.py diff --git a/tests/comparison.py b/tests/comparison.py new file mode 100644 index 0000000..bc8721f --- /dev/null +++ b/tests/comparison.py @@ -0,0 +1,50 @@ +import mdtraj +import pandas as pd +import numpy as np +import chemfiles +import pytest +import ase +import uuid + +def create_topology(n_atoms): + """Create an MDTraj topology for a given number of atoms.""" + data = pd.DataFrame( + { + "serial": np.arange(n_atoms), + "name": ["C"] * n_atoms, + "resSeq": [1] * n_atoms, + "resName": ["UNK"] * n_atoms, + "element": ["C"] * n_atoms, + "chainID": ["A"] * n_atoms, + } + ) + return mdtraj.Topology().from_dataframe(data) + +def generate_frames(n_steps, n_atoms): + """Generate a list of Chemfiles frames with random atomic positions.""" + frames = [] + for _ in range(n_steps): + atoms = ase.Atoms("H" * n_atoms, positions=np.random.rand(n_atoms, 3)) + frame = chemfiles.Frame() + frame.resize(n_atoms) + frame.positions[:] = atoms.positions + frames.append(frame) + return frames + +@pytest.fixture +def frames(request): + """Fixture to create frames based on n_steps and n_atoms from the request.""" + n_steps, n_atoms = request.param + return generate_frames(n_steps, n_atoms) + +@pytest.mark.parametrize("frames", [(100, 10), (50, 20), (200, 5)], indirect=True) +def test_write_chemfiles_pdb(tmp_path, frames, benchmark): + """Benchmark the PDB writing process.""" + def write_chemfiles_pdb(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.pdb" + with chemfiles.Trajectory(filename.as_posix(), "w") as traj: + for frame in frames: + traj.write(frame) + + benchmark(write_chemfiles_pdb) \ No newline at end of file From c1b6d018d0790b86f9e2f77fbdb75dde5ced914c Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 10:23:15 +0100 Subject: [PATCH 03/10] update `comparison` tests --- .gitignore | 2 + tests/comparison.py | 92 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 84 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 0aa2a3c..3e2f089 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,5 @@ cython_debug/ .vscode/ *.h5 +output.json + diff --git a/tests/comparison.py b/tests/comparison.py index bc8721f..7be5c53 100644 --- a/tests/comparison.py +++ b/tests/comparison.py @@ -3,8 +3,25 @@ import numpy as np import chemfiles import pytest -import ase +import ase.io import uuid +import znh5md +import warnings + + +# n_steps, n_atoms + +# N_ATOMS = np.logspace(1, 3, 20, dtype=int) +# N_STEPS = 1000 +WRITE = [(1000, 1000)] + +def collect_file_sizes(tmp_path) -> str: + # compute the mean and standard deviation of the file sizes in the given directory + sizes = [] + for file in tmp_path.iterdir(): + sizes.append(file.stat().st_size) + # print mean and standard deviation in megabytes + return f"Mean: {np.mean(sizes) / 1e6:.2f} MB, Std: {np.std(sizes) / 1e6:.2f} MB" def create_topology(n_atoms): """Create an MDTraj topology for a given number of atoms.""" @@ -20,31 +37,86 @@ def create_topology(n_atoms): ) return mdtraj.Topology().from_dataframe(data) -def generate_frames(n_steps, n_atoms): +def generate_frames(n_steps, n_atoms) -> list[ase.Atoms]: """Generate a list of Chemfiles frames with random atomic positions.""" frames = [] for _ in range(n_steps): atoms = ase.Atoms("H" * n_atoms, positions=np.random.rand(n_atoms, 3)) - frame = chemfiles.Frame() - frame.resize(n_atoms) - frame.positions[:] = atoms.positions - frames.append(frame) + frames.append(atoms) return frames +def convert_atoms_to_chemfiles(atoms: ase.Atoms) -> chemfiles.Frame: + """Convert an ASE atoms object to a Chemfiles frame.""" + frame = chemfiles.Frame() + frame.resize(len(atoms)) + frame.positions[:] = atoms.positions + return frame + @pytest.fixture def frames(request): """Fixture to create frames based on n_steps and n_atoms from the request.""" n_steps, n_atoms = request.param - return generate_frames(n_steps, n_atoms) + return list(generate_frames(n_steps, n_atoms)) -@pytest.mark.parametrize("frames", [(100, 10), (50, 20), (200, 5)], indirect=True) +@pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_chemfiles_pdb(tmp_path, frames, benchmark): """Benchmark the PDB writing process.""" + chemfiles_frames = [convert_atoms_to_chemfiles(frame) for frame in frames] + def write_chemfiles_pdb(): """Inner function for benchmarking.""" filename = tmp_path / f"{uuid.uuid4()}.pdb" with chemfiles.Trajectory(filename.as_posix(), "w") as traj: - for frame in frames: + for frame in chemfiles_frames: traj.write(frame) - benchmark(write_chemfiles_pdb) \ No newline at end of file + benchmark(write_chemfiles_pdb) + warnings.warn(collect_file_sizes(tmp_path)) + +@pytest.mark.parametrize("frames", WRITE, indirect=True) +def test_write_znh5md(tmp_path, frames, benchmark): + def write_znh5md(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.h5" + znh5md.write(filename, frames, compression=None) + + benchmark(write_znh5md) + warnings.warn(collect_file_sizes(tmp_path)) + + +@pytest.mark.parametrize("frames", WRITE, indirect=True) +def test_write_znh5md_compressed(tmp_path, frames, benchmark): + def write_znh5md(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.h5" + znh5md.write(filename, frames) + + benchmark(write_znh5md) + warnings.warn(collect_file_sizes(tmp_path)) + + +@pytest.mark.parametrize("frames", WRITE, indirect=True) +def test_write_xtc(tmp_path, frames, benchmark): + topology = create_topology(len(frames[0])) + positions = np.array([frame.positions for frame in frames]) + + def write_xtc(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.xtc" + traj = mdtraj.Trajectory( + positions, topology + ) + traj.save_xtc(filename.as_posix()) + + benchmark(write_xtc) + warnings.warn(collect_file_sizes(tmp_path)) + +@pytest.mark.parametrize("frames", WRITE, indirect=True) +def test_ase_traj(tmp_path, frames, benchmark): + def write_ase_traj(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.traj" + ase.io.write(filename.as_posix(), frames) + + benchmark(write_ase_traj) + warnings.warn(collect_file_sizes(tmp_path)) \ No newline at end of file From 6f5a05bd95eddaa49f7fcf25e5476220fbe8fa5a Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 10:32:08 +0100 Subject: [PATCH 04/10] test read group --- tests/comparison.py | 49 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/tests/comparison.py b/tests/comparison.py index 7be5c53..a573855 100644 --- a/tests/comparison.py +++ b/tests/comparison.py @@ -14,6 +14,7 @@ # N_ATOMS = np.logspace(1, 3, 20, dtype=int) # N_STEPS = 1000 WRITE = [(1000, 1000)] +READ = [(1000, 1000)] def collect_file_sizes(tmp_path) -> str: # compute the mean and standard deviation of the file sizes in the given directory @@ -58,6 +59,7 @@ def frames(request): n_steps, n_atoms = request.param return list(generate_frames(n_steps, n_atoms)) +@pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_chemfiles_pdb(tmp_path, frames, benchmark): """Benchmark the PDB writing process.""" @@ -73,6 +75,7 @@ def write_chemfiles_pdb(): benchmark(write_chemfiles_pdb) warnings.warn(collect_file_sizes(tmp_path)) +@pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_znh5md(tmp_path, frames, benchmark): def write_znh5md(): @@ -83,7 +86,7 @@ def write_znh5md(): benchmark(write_znh5md) warnings.warn(collect_file_sizes(tmp_path)) - +@pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_znh5md_compressed(tmp_path, frames, benchmark): def write_znh5md(): @@ -94,7 +97,7 @@ def write_znh5md(): benchmark(write_znh5md) warnings.warn(collect_file_sizes(tmp_path)) - +@pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_xtc(tmp_path, frames, benchmark): topology = create_topology(len(frames[0])) @@ -111,12 +114,50 @@ def write_xtc(): benchmark(write_xtc) warnings.warn(collect_file_sizes(tmp_path)) +@pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) -def test_ase_traj(tmp_path, frames, benchmark): +def test_write_ase_traj(tmp_path, frames, benchmark): def write_ase_traj(): """Inner function for benchmarking.""" filename = tmp_path / f"{uuid.uuid4()}.traj" ase.io.write(filename.as_posix(), frames) benchmark(write_ase_traj) - warnings.warn(collect_file_sizes(tmp_path)) \ No newline at end of file + warnings.warn(collect_file_sizes(tmp_path)) + +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_ase_traj(tmp_path, frames, benchmark): + filename = tmp_path / f"{uuid.uuid4()}.traj" + ase.io.write(filename.as_posix(), frames) + + def read_ase_traj(): + """Inner function for benchmarking.""" + ase.io.read(filename.as_posix(), index=":") + + benchmark(read_ase_traj) + + +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_znh5md(tmp_path, frames, benchmark): + filename = tmp_path / f"{uuid.uuid4()}.h5" + znh5md.write(filename, frames, compression=None) + + def read_znh5md(): + """Inner function for benchmarking.""" + _ = znh5md.IO(filename)[:] + + benchmark(read_znh5md) + +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_znh5md_compressed(tmp_path, frames, benchmark): + filename = tmp_path / f"{uuid.uuid4()}.h5" + znh5md.write(filename, frames) + + def read_znh5md(): + """Inner function for benchmarking.""" + _ = znh5md.IO(filename)[:] + + benchmark(read_znh5md) \ No newline at end of file From 8cc8b25a44771d69bc78cb891bfc60db05120fde Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 11:02:36 +0100 Subject: [PATCH 05/10] add chemfiles `xyz` --- tests/comparison.py | 109 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 15 deletions(-) diff --git a/tests/comparison.py b/tests/comparison.py index a573855..d6d5020 100644 --- a/tests/comparison.py +++ b/tests/comparison.py @@ -75,24 +75,32 @@ def write_chemfiles_pdb(): benchmark(write_chemfiles_pdb) warnings.warn(collect_file_sizes(tmp_path)) + @pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) -def test_write_znh5md(tmp_path, frames, benchmark): - def write_znh5md(): +def test_write_chemfiles_xyz(tmp_path, frames, benchmark): + """Benchmark the XYZ writing process.""" + chemfiles_frames = [convert_atoms_to_chemfiles(frame) for frame in frames] + + def write_chemfiles_xyz(): """Inner function for benchmarking.""" - filename = tmp_path / f"{uuid.uuid4()}.h5" - znh5md.write(filename, frames, compression=None) + filename = tmp_path / f"{uuid.uuid4()}.xyz" + with chemfiles.Trajectory(filename.as_posix(), "w") as traj: + for frame in chemfiles_frames: + traj.write(frame) - benchmark(write_znh5md) + benchmark(write_chemfiles_xyz) warnings.warn(collect_file_sizes(tmp_path)) + +@pytest.mark.parametrize("compression", ["lzf", "gzip", None]) @pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) -def test_write_znh5md_compressed(tmp_path, frames, benchmark): +def test_write_znh5md(tmp_path, frames, benchmark, compression): def write_znh5md(): """Inner function for benchmarking.""" filename = tmp_path / f"{uuid.uuid4()}.h5" - znh5md.write(filename, frames) + znh5md.write(filename, frames, compression=compression) benchmark(write_znh5md) warnings.warn(collect_file_sizes(tmp_path)) @@ -125,6 +133,18 @@ def write_ase_traj(): benchmark(write_ase_traj) warnings.warn(collect_file_sizes(tmp_path)) + +@pytest.mark.benchmark(group="write") +@pytest.mark.parametrize("frames", WRITE, indirect=True) +def test_write_ase_xyz(tmp_path, frames, benchmark): + def write_ase_xyz(): + """Inner function for benchmarking.""" + filename = tmp_path / f"{uuid.uuid4()}.xyz" + ase.io.write(filename.as_posix(), frames) + + benchmark(write_ase_xyz) + warnings.warn(collect_file_sizes(tmp_path)) + @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) def test_read_ase_traj(tmp_path, frames, benchmark): @@ -140,9 +160,22 @@ def read_ase_traj(): @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) -def test_read_znh5md(tmp_path, frames, benchmark): +def test_read_ase_xyz(tmp_path, frames, benchmark): + filename = tmp_path / f"{uuid.uuid4()}.xyz" + ase.io.write(filename.as_posix(), frames) + + def read_ase_traj(): + """Inner function for benchmarking.""" + ase.io.read(filename.as_posix(), index=":") + + benchmark(read_ase_traj) + +@pytest.mark.parametrize("compression", ["lzf", "gzip", None]) +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_znh5md(tmp_path, frames, benchmark, compression): filename = tmp_path / f"{uuid.uuid4()}.h5" - znh5md.write(filename, frames, compression=None) + znh5md.write(filename, frames, compression=compression) def read_znh5md(): """Inner function for benchmarking.""" @@ -150,14 +183,60 @@ def read_znh5md(): benchmark(read_znh5md) + @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) -def test_read_znh5md_compressed(tmp_path, frames, benchmark): - filename = tmp_path / f"{uuid.uuid4()}.h5" - znh5md.write(filename, frames) +def test_read_xtc(tmp_path, frames, benchmark): + topology = create_topology(len(frames[0])) + positions = np.array([frame.positions for frame in frames]) + filename = tmp_path / f"{uuid.uuid4()}.xtc" + traj = mdtraj.Trajectory( + positions, topology + ) + traj.save_xtc(filename.as_posix()) - def read_znh5md(): + def read_xtc(): """Inner function for benchmarking.""" - _ = znh5md.IO(filename)[:] + traj = mdtraj.load_xtc(filename.as_posix(), top=topology) + for frame in traj: + # access to actually read the data? + _ = frame.xyz + + benchmark(read_xtc) + + +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_chemfiles_pdb(tmp_path, frames, benchmark): + chemfiles_frames = [convert_atoms_to_chemfiles(frame) for frame in frames] + filename = tmp_path / f"{uuid.uuid4()}.pdb" + with chemfiles.Trajectory(filename.as_posix(), "w") as traj: + for frame in chemfiles_frames: + traj.write(frame) + + def read_chemfiles_pdb(): + """Inner function for benchmarking.""" + with chemfiles.Trajectory(filename.as_posix(), "r") as traj: + for frame in traj: + _ = frame.positions + + benchmark(read_chemfiles_pdb) + + + +@pytest.mark.benchmark(group="read") +@pytest.mark.parametrize("frames", READ, indirect=True) +def test_read_chemfiles_xyz(tmp_path, frames, benchmark): + chemfiles_frames = [convert_atoms_to_chemfiles(frame) for frame in frames] + filename = tmp_path / f"{uuid.uuid4()}.xyz" + with chemfiles.Trajectory(filename.as_posix(), "w") as traj: + for frame in chemfiles_frames: + traj.write(frame) + + def read_chemfiles_xyz(): + """Inner function for benchmarking.""" + with chemfiles.Trajectory(filename.as_posix(), "r") as traj: + for frame in traj: + _ = frame.positions - benchmark(read_znh5md) \ No newline at end of file + benchmark(read_chemfiles_xyz) From c241a971a22a2a20c6c62098f56b6b37aba182dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:27:34 +0000 Subject: [PATCH 06/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .gitignore | 1 - tests/comparison.py | 32 +++++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 3e2f089..b3660dc 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,3 @@ cython_debug/ .vscode/ *.h5 output.json - diff --git a/tests/comparison.py b/tests/comparison.py index d6d5020..2c9a412 100644 --- a/tests/comparison.py +++ b/tests/comparison.py @@ -1,13 +1,14 @@ +import uuid +import warnings + +import ase.io +import chemfiles import mdtraj -import pandas as pd import numpy as np -import chemfiles +import pandas as pd import pytest -import ase.io -import uuid -import znh5md -import warnings +import znh5md # n_steps, n_atoms @@ -16,6 +17,7 @@ WRITE = [(1000, 1000)] READ = [(1000, 1000)] + def collect_file_sizes(tmp_path) -> str: # compute the mean and standard deviation of the file sizes in the given directory sizes = [] @@ -24,6 +26,7 @@ def collect_file_sizes(tmp_path) -> str: # print mean and standard deviation in megabytes return f"Mean: {np.mean(sizes) / 1e6:.2f} MB, Std: {np.std(sizes) / 1e6:.2f} MB" + def create_topology(n_atoms): """Create an MDTraj topology for a given number of atoms.""" data = pd.DataFrame( @@ -38,6 +41,7 @@ def create_topology(n_atoms): ) return mdtraj.Topology().from_dataframe(data) + def generate_frames(n_steps, n_atoms) -> list[ase.Atoms]: """Generate a list of Chemfiles frames with random atomic positions.""" frames = [] @@ -46,6 +50,7 @@ def generate_frames(n_steps, n_atoms) -> list[ase.Atoms]: frames.append(atoms) return frames + def convert_atoms_to_chemfiles(atoms: ase.Atoms) -> chemfiles.Frame: """Convert an ASE atoms object to a Chemfiles frame.""" frame = chemfiles.Frame() @@ -53,12 +58,14 @@ def convert_atoms_to_chemfiles(atoms: ase.Atoms) -> chemfiles.Frame: frame.positions[:] = atoms.positions return frame + @pytest.fixture def frames(request): """Fixture to create frames based on n_steps and n_atoms from the request.""" n_steps, n_atoms = request.param return list(generate_frames(n_steps, n_atoms)) + @pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_chemfiles_pdb(tmp_path, frames, benchmark): @@ -105,6 +112,7 @@ def write_znh5md(): benchmark(write_znh5md) warnings.warn(collect_file_sizes(tmp_path)) + @pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_xtc(tmp_path, frames, benchmark): @@ -114,14 +122,13 @@ def test_write_xtc(tmp_path, frames, benchmark): def write_xtc(): """Inner function for benchmarking.""" filename = tmp_path / f"{uuid.uuid4()}.xtc" - traj = mdtraj.Trajectory( - positions, topology - ) + traj = mdtraj.Trajectory(positions, topology) traj.save_xtc(filename.as_posix()) benchmark(write_xtc) warnings.warn(collect_file_sizes(tmp_path)) + @pytest.mark.benchmark(group="write") @pytest.mark.parametrize("frames", WRITE, indirect=True) def test_write_ase_traj(tmp_path, frames, benchmark): @@ -145,6 +152,7 @@ def write_ase_xyz(): benchmark(write_ase_xyz) warnings.warn(collect_file_sizes(tmp_path)) + @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) def test_read_ase_traj(tmp_path, frames, benchmark): @@ -170,6 +178,7 @@ def read_ase_traj(): benchmark(read_ase_traj) + @pytest.mark.parametrize("compression", ["lzf", "gzip", None]) @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) @@ -190,9 +199,7 @@ def test_read_xtc(tmp_path, frames, benchmark): topology = create_topology(len(frames[0])) positions = np.array([frame.positions for frame in frames]) filename = tmp_path / f"{uuid.uuid4()}.xtc" - traj = mdtraj.Trajectory( - positions, topology - ) + traj = mdtraj.Trajectory(positions, topology) traj.save_xtc(filename.as_posix()) def read_xtc(): @@ -223,7 +230,6 @@ def read_chemfiles_pdb(): benchmark(read_chemfiles_pdb) - @pytest.mark.benchmark(group="read") @pytest.mark.parametrize("frames", READ, indirect=True) def test_read_chemfiles_xyz(tmp_path, frames, benchmark): From 000b8b8a6bb5beaa775f0fbc293bee97b489cfeb Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 11:28:18 +0100 Subject: [PATCH 07/10] add README --- tests/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..b28c0b8 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,5 @@ +# Run comparison benchmark + +```bash +pytest tests/comparison.py -m benchmark --benchmark-json output.json +``` From f35500e47376711f73cd21df2911915b52f4bc18 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:28:25 +0000 Subject: [PATCH 08/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index b28c0b8..b354b0b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,5 +1,5 @@ # Run comparison benchmark ```bash -pytest tests/comparison.py -m benchmark --benchmark-json output.json +pytest tests/comparison.py -m benchmark --benchmark-json output.json ``` From 154ee8f419b522b2b67f4dd3fbcd60f497c26c2d Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 12 Dec 2024 16:36:34 +0100 Subject: [PATCH 09/10] tiny perf improvement --- znh5md/misc.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/znh5md/misc.py b/znh5md/misc.py index fd569b7..f8e5452 100644 --- a/znh5md/misc.py +++ b/znh5md/misc.py @@ -24,21 +24,19 @@ def concatenate_varying_shape_arrays( """ # Determine the maximum shape along all dimensions - maxshape = list(values[0].shape) - for value in values[1:]: - maxshape = [max(a, b) for a, b in zip(maxshape, value.shape)] + shapes = np.array([value.shape for value in values]) + maxshape = tuple(np.max(shapes, axis=0)) # Add the batch dimension maxshape = (len(values), *maxshape) - # Create an array filled with the fillvalue + # Create the array filled with the fillvalue dataset = np.full(maxshape, fillvalue, dtype=dtype) - - # Insert each value into the dataset + + # Get the slices for each value and assign them all at once for i, value in enumerate(values): - # Create slices for each dimension of the current value - slices = tuple(slice(0, dim) for dim in value.shape) - dataset[(i,) + slices] = value + slices = (i,) + tuple(slice(0, dim) for dim in value.shape) + dataset[slices] = value return dataset From ef5ef035a4fa5dd7acc8f271d0f574c1423bcb91 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:36:43 +0000 Subject: [PATCH 10/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- znh5md/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/znh5md/misc.py b/znh5md/misc.py index f8e5452..84f3f91 100644 --- a/znh5md/misc.py +++ b/znh5md/misc.py @@ -32,7 +32,7 @@ def concatenate_varying_shape_arrays( # Create the array filled with the fillvalue dataset = np.full(maxshape, fillvalue, dtype=dtype) - + # Get the slices for each value and assign them all at once for i, value in enumerate(values): slices = (i,) + tuple(slice(0, dim) for dim in value.shape)