diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 283f85f..673d7a6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -12,5 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + + # 👇 ADD THIS BLOCK (important) - uses: actions/setup-python@v6 + with: + python-version: '3.11' + - uses: pre-commit/action@v3.0.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9472729..e3eda7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,8 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [\#49](https://github.com/mllam/weather-model-graphs/pull/49), [\#54](https://github.com/mllam/weather-model-graphs/pull/54), @leifdenby -- Improve isolation of README example tests by executing each code block in an isolated namespace. - [#65](https://github.com/mllam/weather-model-graphs/pull/64) @Shristi-Goel +- Improve isolation of README example tests by executing each code block in an isolated namespace + [#65](https://github.com/mllam/weather-model-graphs/pull/65) @Shristi-Goel ## [v0.2.0](https://github.com/mllam/weather-model-graphs/releases/tag/v0.2.0) diff --git a/pdm.lock b/pdm.lock index 740391a..5cd8e38 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "docs", "pytorch", "visualisation"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:6181ca7b07848fde5291c934abf5286ef2d2c22967a5dd6512bf09786968b601" +content_hash = "sha256:754a005ecd8946783235a2d9912507d1aed033d5c448664ab402e952baf550b2" [[metadata.targets]] requires_python = ">=3.10" @@ -28,7 +28,7 @@ name = "aiohttp" version = "3.9.5" requires_python = ">=3.8" summary = "Async http client/server framework (asyncio)" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "aiosignal>=1.1.2", "async-timeout<5.0,>=4.0; python_version < \"3.11\"", @@ -91,7 +91,7 @@ name = "aiosignal" version = "1.3.1" requires_python = ">=3.7" summary = "aiosignal: a list of registered asynchronous callbacks" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "frozenlist>=1.1.0", ] @@ -141,7 +141,7 @@ name = "async-timeout" version = "4.0.3" requires_python = ">=3.7" summary = "Timeout context manager for asyncio programs" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "python_version < \"3.11\"" files = [ {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, @@ -153,7 +153,7 @@ name = "attrs" version = "23.2.0" requires_python = ">=3.7" summary = "Classes Without Boilerplate" -groups = ["dev", "docs", "pytorch"] +groups = ["default", "dev", "docs", "pytorch"] files = [ {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, @@ -291,7 +291,7 @@ name = "charset-normalizer" version = "3.3.2" requires_python = ">=3.7.0" summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -387,7 +387,7 @@ name = "contourpy" version = "1.2.1" requires_python = ">=3.9" summary = "Python library for calculating contours of 2D quadrilateral grids" -groups = ["visualisation"] +groups = ["default", "visualisation"] dependencies = [ "numpy>=1.20", ] @@ -474,7 +474,7 @@ name = "cycler" version = "0.12.1" requires_python = ">=3.8" summary = "Composable style cycles" -groups = ["visualisation"] +groups = ["default", "visualisation"] files = [ {file = "cycler-0.12.1-py3-none-any.whl", hash = "sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30"}, {file = "cycler-0.12.1.tar.gz", hash = "sha256:88bb128f02ba341da8ef447245a9e138fae777f6a23943da4540077d3601eb1c"}, @@ -573,7 +573,7 @@ name = "filelock" version = "3.14.0" requires_python = ">=3.8" summary = "A platform independent file lock." -groups = ["dev", "pytorch"] +groups = ["default", "dev", "pytorch"] files = [ {file = "filelock-3.14.0-py3-none-any.whl", hash = "sha256:43339835842f110ca7ae60f1e1c160714c5a6afd15a2873419ab185334975c0f"}, {file = "filelock-3.14.0.tar.gz", hash = "sha256:6ea72da3be9b8c82afd3edcf99f2fffbb5076335a5ae4d03248bb5b6c3eae78a"}, @@ -584,7 +584,7 @@ name = "fonttools" version = "4.51.0" requires_python = ">=3.8" summary = "Tools to manipulate font files" -groups = ["visualisation"] +groups = ["default", "visualisation"] files = [ {file = "fonttools-4.51.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:84d7751f4468dd8cdd03ddada18b8b0857a5beec80bce9f435742abc9a851a74"}, {file = "fonttools-4.51.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8b4850fa2ef2cfbc1d1f689bc159ef0f45d8d83298c1425838095bf53ef46308"}, @@ -619,7 +619,7 @@ name = "frozenlist" version = "1.4.1" requires_python = ">=3.8" summary = "A list-like structure which implements collections.abc.MutableSequence" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f9aa1878d1083b276b0196f2dfbe00c9b7e752475ed3b682025ff20c1c1f51ac"}, {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29acab3f66f0f24674b7dc4736477bcd4bc3ad4b896f5f45379a67bce8b96868"}, @@ -675,7 +675,7 @@ name = "fsspec" version = "2024.3.1" requires_python = ">=3.8" summary = "File-system specification" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "fsspec-2024.3.1-py3-none-any.whl", hash = "sha256:918d18d41bf73f0e2b261824baeb1b124bcf771767e3a26425cd7dec3332f512"}, {file = "fsspec-2024.3.1.tar.gz", hash = "sha256:f39780e282d7d117ffb42bb96992f8a90795e4d0fb0f661a70ca39fe9c43ded9"}, @@ -735,7 +735,7 @@ name = "idna" version = "3.7" requires_python = ">=3.5" summary = "Internationalized Domain Names in Applications (IDNA)" -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -781,7 +781,7 @@ files = [ name = "intel-openmp" version = "2021.4.0" summary = "Intel® OpenMP* Runtime Library" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Windows\"" files = [ {file = "intel_openmp-2021.4.0-py2.py3-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl", hash = "sha256:41c01e266a7fdb631a7609191709322da2bbf24b252ba763f125dd651bcc7675"}, @@ -878,7 +878,7 @@ name = "jinja2" version = "3.1.3" requires_python = ">=3.7" summary = "A very fast and expressive template engine." -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] dependencies = [ "MarkupSafe>=2.0", ] @@ -892,7 +892,7 @@ name = "joblib" version = "1.4.0" requires_python = ">=3.8" summary = "Lightweight pipelining with Python functions" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "joblib-1.4.0-py3-none-any.whl", hash = "sha256:42942470d4062537be4d54c83511186da1fc14ba354961a2114da91efa9a4ed7"}, {file = "joblib-1.4.0.tar.gz", hash = "sha256:1eb0dc091919cd384490de890cb5dfd538410a6d4b3b54eef09fb8c50b409b1c"}, @@ -1020,7 +1020,7 @@ name = "kiwisolver" version = "1.4.5" requires_python = ">=3.7" summary = "A fast implementation of the Cassowary constraint solver" -groups = ["visualisation"] +groups = ["default", "visualisation"] files = [ {file = "kiwisolver-1.4.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:05703cf211d585109fcd72207a31bb170a0f22144d68298dc5e61b3c946518af"}, {file = "kiwisolver-1.4.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:146d14bebb7f1dc4d5fbf74f8a6cb15ac42baadee8912eb84ac0b3b2a3dc6ac3"}, @@ -1144,7 +1144,7 @@ name = "markupsafe" version = "2.1.5" requires_python = ">=3.7" summary = "Safely add untrusted strings to HTML/XML markup." -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] files = [ {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, @@ -1181,44 +1181,77 @@ files = [ [[package]] name = "matplotlib" -version = "3.8.4" -requires_python = ">=3.9" +version = "3.10.8" +requires_python = ">=3.10" summary = "Python plotting package" -groups = ["visualisation"] +groups = ["default", "visualisation"] dependencies = [ "contourpy>=1.0.1", "cycler>=0.10", "fonttools>=4.22.0", "kiwisolver>=1.3.1", - "numpy>=1.21", + "numpy>=1.23", "packaging>=20.0", "pillow>=8", - "pyparsing>=2.3.1", + "pyparsing>=3", "python-dateutil>=2.7", ] files = [ - {file = "matplotlib-3.8.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:abc9d838f93583650c35eca41cfcec65b2e7cb50fd486da6f0c49b5e1ed23014"}, - {file = "matplotlib-3.8.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f65c9f002d281a6e904976007b2d46a1ee2bcea3a68a8c12dda24709ddc9106"}, - {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce1edd9f5383b504dbc26eeea404ed0a00656c526638129028b758fd43fc5f10"}, - {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecd79298550cba13a43c340581a3ec9c707bd895a6a061a78fa2524660482fc0"}, - {file = "matplotlib-3.8.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:90df07db7b599fe7035d2f74ab7e438b656528c68ba6bb59b7dc46af39ee48ef"}, - {file = "matplotlib-3.8.4-cp310-cp310-win_amd64.whl", hash = "sha256:ac24233e8f2939ac4fd2919eed1e9c0871eac8057666070e94cbf0b33dd9c338"}, - {file = "matplotlib-3.8.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:72f9322712e4562e792b2961971891b9fbbb0e525011e09ea0d1f416c4645661"}, - {file = "matplotlib-3.8.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:232ce322bfd020a434caaffbd9a95333f7c2491e59cfc014041d95e38ab90d1c"}, - {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6addbd5b488aedb7f9bc19f91cd87ea476206f45d7116fcfe3d31416702a82fa"}, - {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc4ccdc64e3039fc303defd119658148f2349239871db72cd74e2eeaa9b80b71"}, - {file = "matplotlib-3.8.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b7a2a253d3b36d90c8993b4620183b55665a429da8357a4f621e78cd48b2b30b"}, - {file = "matplotlib-3.8.4-cp311-cp311-win_amd64.whl", hash = "sha256:8080d5081a86e690d7688ffa542532e87f224c38a6ed71f8fbed34dd1d9fedae"}, - {file = "matplotlib-3.8.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6485ac1f2e84676cff22e693eaa4fbed50ef5dc37173ce1f023daef4687df616"}, - {file = "matplotlib-3.8.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c89ee9314ef48c72fe92ce55c4e95f2f39d70208f9f1d9db4e64079420d8d732"}, - {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50bac6e4d77e4262c4340d7a985c30912054745ec99756ce213bfbc3cb3808eb"}, - {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f51c4c869d4b60d769f7b4406eec39596648d9d70246428745a681c327a8ad30"}, - {file = "matplotlib-3.8.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b12ba985837e4899b762b81f5b2845bd1a28f4fdd1a126d9ace64e9c4eb2fb25"}, - {file = "matplotlib-3.8.4-cp312-cp312-win_amd64.whl", hash = "sha256:7a6769f58ce51791b4cb8b4d7642489df347697cd3e23d88266aaaee93b41d9a"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c7064120a59ce6f64103c9cefba8ffe6fba87f2c61d67c401186423c9a20fd35"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0e47eda4eb2614300fc7bb4657fced3e83d6334d03da2173b09e447418d499f"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:493e9f6aa5819156b58fce42b296ea31969f2aab71c5b680b4ea7a3cb5c07d94"}, - {file = "matplotlib-3.8.4.tar.gz", hash = "sha256:8aac397d5e9ec158960e31c381c5ffc52ddd52bd9a47717e2a694038167dffea"}, + {file = "matplotlib-3.10.8-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:00270d217d6b20d14b584c521f810d60c5c78406dc289859776550df837dcda7"}, + {file = "matplotlib-3.10.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37b3c1cc42aa184b3f738cfa18c1c1d72fd496d85467a6cf7b807936d39aa656"}, + {file = "matplotlib-3.10.8-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ee40c27c795bda6a5292e9cff9890189d32f7e3a0bf04e0e3c9430c4a00c37df"}, + {file = "matplotlib-3.10.8-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a48f2b74020919552ea25d222d5cc6af9ca3f4eb43a93e14d068457f545c2a17"}, + {file = "matplotlib-3.10.8-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f254d118d14a7f99d616271d6c3c27922c092dac11112670b157798b89bf4933"}, + {file = "matplotlib-3.10.8-cp310-cp310-win_amd64.whl", hash = "sha256:f9b587c9c7274c1613a30afabf65a272114cd6cdbe67b3406f818c79d7ab2e2a"}, + {file = "matplotlib-3.10.8-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6be43b667360fef5c754dda5d25a32e6307a03c204f3c0fc5468b78fa87b4160"}, + {file = "matplotlib-3.10.8-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a2b336e2d91a3d7006864e0990c83b216fcdca64b5a6484912902cef87313d78"}, + {file = "matplotlib-3.10.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:efb30e3baaea72ce5928e32bab719ab4770099079d66726a62b11b1ef7273be4"}, + {file = "matplotlib-3.10.8-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d56a1efd5bfd61486c8bc968fa18734464556f0fb8e51690f4ac25d85cbbbbc2"}, + {file = "matplotlib-3.10.8-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:238b7ce5717600615c895050239ec955d91f321c209dd110db988500558e70d6"}, + {file = "matplotlib-3.10.8-cp311-cp311-win_amd64.whl", hash = "sha256:18821ace09c763ec93aef5eeff087ee493a24051936d7b9ebcad9662f66501f9"}, + {file = "matplotlib-3.10.8-cp311-cp311-win_arm64.whl", hash = "sha256:bab485bcf8b1c7d2060b4fcb6fc368a9e6f4cd754c9c2fea281f4be21df394a2"}, + {file = "matplotlib-3.10.8-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:64fcc24778ca0404ce0cb7b6b77ae1f4c7231cdd60e6778f999ee05cbd581b9a"}, + {file = "matplotlib-3.10.8-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b9a5ca4ac220a0cdd1ba6bcba3608547117d30468fefce49bb26f55c1a3d5c58"}, + {file = "matplotlib-3.10.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3ab4aabc72de4ff77b3ec33a6d78a68227bf1123465887f9905ba79184a1cc04"}, + {file = "matplotlib-3.10.8-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:24d50994d8c5816ddc35411e50a86ab05f575e2530c02752e02538122613371f"}, + {file = "matplotlib-3.10.8-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:99eefd13c0dc3b3c1b4d561c1169e65fe47aab7b8158754d7c084088e2329466"}, + {file = "matplotlib-3.10.8-cp312-cp312-win_amd64.whl", hash = "sha256:dd80ecb295460a5d9d260df63c43f4afbdd832d725a531f008dad1664f458adf"}, + {file = "matplotlib-3.10.8-cp312-cp312-win_arm64.whl", hash = "sha256:3c624e43ed56313651bc18a47f838b60d7b8032ed348911c54906b130b20071b"}, + {file = "matplotlib-3.10.8-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:3f2e409836d7f5ac2f1c013110a4d50b9f7edc26328c108915f9075d7d7a91b6"}, + {file = "matplotlib-3.10.8-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56271f3dac49a88d7fca5060f004d9d22b865f743a12a23b1e937a0be4818ee1"}, + {file = "matplotlib-3.10.8-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a0a7f52498f72f13d4a25ea70f35f4cb60642b466cbb0a9be951b5bc3f45a486"}, + {file = "matplotlib-3.10.8-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:646d95230efb9ca614a7a594d4fcacde0ac61d25e37dd51710b36477594963ce"}, + {file = "matplotlib-3.10.8-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f89c151aab2e2e23cb3fe0acad1e8b82841fd265379c4cecd0f3fcb34c15e0f6"}, + {file = "matplotlib-3.10.8-cp313-cp313-win_amd64.whl", hash = "sha256:e8ea3e2d4066083e264e75c829078f9e149fa119d27e19acd503de65e0b13149"}, + {file = "matplotlib-3.10.8-cp313-cp313-win_arm64.whl", hash = "sha256:c108a1d6fa78a50646029cb6d49808ff0fc1330fda87fa6f6250c6b5369b6645"}, + {file = "matplotlib-3.10.8-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ad3d9833a64cf48cc4300f2b406c3d0f4f4724a91c0bd5640678a6ba7c102077"}, + {file = "matplotlib-3.10.8-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:eb3823f11823deade26ce3b9f40dcb4a213da7a670013929f31d5f5ed1055b22"}, + {file = "matplotlib-3.10.8-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d9050fee89a89ed57b4fb2c1bfac9a3d0c57a0d55aed95949eedbc42070fea39"}, + {file = "matplotlib-3.10.8-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b44d07310e404ba95f8c25aa5536f154c0a8ec473303535949e52eb71d0a1565"}, + {file = "matplotlib-3.10.8-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:0a33deb84c15ede243aead39f77e990469fff93ad1521163305095b77b72ce4a"}, + {file = "matplotlib-3.10.8-cp313-cp313t-win_amd64.whl", hash = "sha256:3a48a78d2786784cc2413e57397981fb45c79e968d99656706018d6e62e57958"}, + {file = "matplotlib-3.10.8-cp313-cp313t-win_arm64.whl", hash = "sha256:15d30132718972c2c074cd14638c7f4592bd98719e2308bccea40e0538bc0cb5"}, + {file = "matplotlib-3.10.8-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:b53285e65d4fa4c86399979e956235deb900be5baa7fc1218ea67fbfaeaadd6f"}, + {file = "matplotlib-3.10.8-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32f8dce744be5569bebe789e46727946041199030db8aeb2954d26013a0eb26b"}, + {file = "matplotlib-3.10.8-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4cf267add95b1c88300d96ca837833d4112756045364f5c734a2276038dae27d"}, + {file = "matplotlib-3.10.8-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2cf5bd12cecf46908f286d7838b2abc6c91cda506c0445b8223a7c19a00df008"}, + {file = "matplotlib-3.10.8-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:41703cc95688f2516b480f7f339d8851a6035f18e100ee6a32bc0b8536a12a9c"}, + {file = "matplotlib-3.10.8-cp314-cp314-win_amd64.whl", hash = "sha256:83d282364ea9f3e52363da262ce32a09dfe241e4080dcedda3c0db059d3c1f11"}, + {file = "matplotlib-3.10.8-cp314-cp314-win_arm64.whl", hash = "sha256:2c1998e92cd5999e295a731bcb2911c75f597d937341f3030cc24ef2733d78a8"}, + {file = "matplotlib-3.10.8-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b5a2b97dbdc7d4f353ebf343744f1d1f1cca8aa8bfddb4262fcf4306c3761d50"}, + {file = "matplotlib-3.10.8-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3f5c3e4da343bba819f0234186b9004faba952cc420fbc522dc4e103c1985908"}, + {file = "matplotlib-3.10.8-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f62550b9a30afde8c1c3ae450e5eb547d579dd69b25c2fc7a1c67f934c1717a"}, + {file = "matplotlib-3.10.8-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:495672de149445ec1b772ff2c9ede9b769e3cb4f0d0aa7fa730d7f59e2d4e1c1"}, + {file = "matplotlib-3.10.8-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:595ba4d8fe983b88f0eec8c26a241e16d6376fe1979086232f481f8f3f67494c"}, + {file = "matplotlib-3.10.8-cp314-cp314t-win_amd64.whl", hash = "sha256:25d380fe8b1dc32cf8f0b1b448470a77afb195438bafdf1d858bfb876f3edf7b"}, + {file = "matplotlib-3.10.8-cp314-cp314t-win_arm64.whl", hash = "sha256:113bb52413ea508ce954a02c10ffd0d565f9c3bc7f2eddc27dfe1731e71c7b5f"}, + {file = "matplotlib-3.10.8-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:f97aeb209c3d2511443f8797e3e5a569aebb040d4f8bc79aa3ee78a8fb9e3dd8"}, + {file = "matplotlib-3.10.8-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fb061f596dad3a0f52b60dc6a5dec4a0c300dec41e058a7efe09256188d170b7"}, + {file = "matplotlib-3.10.8-pp310-pypy310_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:12d90df9183093fcd479f4172ac26b322b1248b15729cb57f42f71f24c7e37a3"}, + {file = "matplotlib-3.10.8-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:6da7c2ce169267d0d066adcf63758f0604aa6c3eebf67458930f9d9b79ad1db1"}, + {file = "matplotlib-3.10.8-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:9153c3292705be9f9c64498a8872118540c3f4123d1a1c840172edf262c8be4a"}, + {file = "matplotlib-3.10.8-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1ae029229a57cd1e8fe542485f27e7ca7b23aa9e8944ddb4985d0bc444f1eca2"}, + {file = "matplotlib-3.10.8.tar.gz", hash = "sha256:2299372c19d56bcd35cf05a2738308758d32b9eaed2371898d8f5bd33f084aa3"}, ] [[package]] @@ -1264,7 +1297,7 @@ files = [ name = "mkl" version = "2021.4.0" summary = "Intel® oneAPI Math Kernel Library" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Windows\"" dependencies = [ "intel-openmp==2021.*", @@ -1282,7 +1315,7 @@ files = [ name = "mpmath" version = "1.3.0" summary = "Python library for arbitrary-precision floating-point arithmetic" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c"}, {file = "mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f"}, @@ -1293,7 +1326,7 @@ name = "multidict" version = "6.0.5" requires_python = ">=3.7" summary = "multidict implementation" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, @@ -1513,7 +1546,7 @@ name = "nvidia-cublas-cu12" version = "12.1.3.1" requires_python = ">=3" summary = "CUBLAS native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl", hash = "sha256:ee53ccca76a6fc08fb9701aa95b6ceb242cdaab118c3bb152af4e579af792728"}, @@ -1525,7 +1558,7 @@ name = "nvidia-cuda-cupti-cu12" version = "12.1.105" requires_python = ">=3" summary = "CUDA profiling tools runtime libs." -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:e54fde3983165c624cb79254ae9818a456eb6e87a7fd4d56a2352c24ee542d7e"}, @@ -1537,7 +1570,7 @@ name = "nvidia-cuda-nvrtc-cu12" version = "12.1.105" requires_python = ">=3" summary = "NVRTC native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:339b385f50c309763ca65456ec75e17bbefcbbf2893f462cb8b90584cd27a1c2"}, @@ -1549,7 +1582,7 @@ name = "nvidia-cuda-runtime-cu12" version = "12.1.105" requires_python = ">=3" summary = "CUDA Runtime native Libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:6e258468ddf5796e25f1dc591a31029fa317d97a0a94ed93468fc86301d61e40"}, @@ -1561,7 +1594,7 @@ name = "nvidia-cudnn-cu12" version = "8.9.2.26" requires_python = ">=3" summary = "cuDNN runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" dependencies = [ "nvidia-cublas-cu12", @@ -1575,7 +1608,7 @@ name = "nvidia-cufft-cu12" version = "11.0.2.54" requires_python = ">=3" summary = "CUFFT native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl", hash = "sha256:794e3948a1aa71fd817c3775866943936774d1c14e7628c74f6f7417224cdf56"}, @@ -1587,7 +1620,7 @@ name = "nvidia-curand-cu12" version = "10.3.2.106" requires_python = ">=3" summary = "CURAND native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:9d264c5036dde4e64f1de8c50ae753237c12e0b1348738169cd0f8a536c0e1e0"}, @@ -1599,7 +1632,7 @@ name = "nvidia-cusolver-cu12" version = "11.4.5.107" requires_python = ">=3" summary = "CUDA solver native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" dependencies = [ "nvidia-cublas-cu12", @@ -1616,7 +1649,7 @@ name = "nvidia-cusparse-cu12" version = "12.1.0.106" requires_python = ">=3" summary = "CUSPARSE native runtime libraries" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" dependencies = [ "nvidia-nvjitlink-cu12", @@ -1631,7 +1664,7 @@ name = "nvidia-nccl-cu12" version = "2.20.5" requires_python = ">=3" summary = "NVIDIA Collective Communication Library (NCCL) Runtime" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1fc150d5c3250b170b29410ba682384b14581db722b2531b0d8d33c595f33d01"}, @@ -1643,7 +1676,7 @@ name = "nvidia-nvjitlink-cu12" version = "12.4.127" requires_python = ">=3" summary = "Nvidia JIT LTO Library" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl", hash = "sha256:06b3b9b25bf3f8af351d664978ca26a16d2c5127dbd53c0497e28d1fb9611d57"}, @@ -1655,7 +1688,7 @@ name = "nvidia-nvtx-cu12" version = "12.1.105" requires_python = ">=3" summary = "NVIDIA Tools Extension" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl", hash = "sha256:dc21cf308ca5691e7c04d962e213f8a4aa9bbfa23d95412f452254c2caeb09e5"}, @@ -1667,7 +1700,7 @@ name = "packaging" version = "24.0" requires_python = ">=3.7" summary = "Core utilities for Python packages" -groups = ["dev", "docs", "visualisation"] +groups = ["default", "dev", "docs", "visualisation"] files = [ {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, @@ -1703,7 +1736,7 @@ name = "pillow" version = "10.3.0" requires_python = ">=3.8" summary = "Python Imaging Library (Fork)" -groups = ["visualisation"] +groups = ["default", "visualisation"] files = [ {file = "pillow-10.3.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:90b9e29824800e90c84e4022dd5cc16eb2d9605ee13f05d47641eb183cd73d45"}, {file = "pillow-10.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a2c405445c79c3f5a124573a051062300936b0281fee57637e706453e452746c"}, @@ -1814,7 +1847,7 @@ name = "psutil" version = "5.9.8" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" summary = "Cross-platform lib for process and system monitoring in Python." -groups = ["dev", "docs", "pytorch", "visualisation"] +groups = ["default", "dev", "docs", "pytorch", "visualisation"] files = [ {file = "psutil-5.9.8-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:aee678c8720623dc456fa20659af736241f575d79429a0e5e9cf88ae0605cc81"}, {file = "psutil-5.9.8-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cb6403ce6d8e047495a701dc7c5bd788add903f8986d523e3e20b98b733e421"}, @@ -1926,7 +1959,7 @@ name = "pyparsing" version = "3.1.2" requires_python = ">=3.6.8" summary = "pyparsing module - Classes and methods to define and execute parsing grammars" -groups = ["pytorch", "visualisation"] +groups = ["default", "pytorch", "visualisation"] files = [ {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"}, {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"}, @@ -2012,7 +2045,7 @@ name = "python-dateutil" version = "2.9.0.post0" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" summary = "Extensions to the standard Python datetime module" -groups = ["dev", "docs", "visualisation"] +groups = ["default", "dev", "docs", "visualisation"] dependencies = [ "six>=1.5", ] @@ -2161,7 +2194,7 @@ name = "requests" version = "2.31.0" requires_python = ">=3.7" summary = "Python HTTP for Humans." -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] dependencies = [ "certifi>=2017.4.17", "charset-normalizer<4,>=2", @@ -2260,7 +2293,7 @@ name = "scikit-learn" version = "1.4.2" requires_python = ">=3.9" summary = "A set of python modules for machine learning and data mining" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "joblib>=1.2.0", "numpy>=1.19.5", @@ -2402,7 +2435,7 @@ name = "six" version = "1.16.0" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" summary = "Python 2 and 3 compatibility utilities" -groups = ["dev", "docs", "visualisation"] +groups = ["default", "dev", "docs", "visualisation"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -2742,7 +2775,7 @@ name = "sympy" version = "1.12" requires_python = ">=3.8" summary = "Computer algebra system (CAS) in Python" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "mpmath>=0.19", ] @@ -2766,7 +2799,7 @@ files = [ name = "tbb" version = "2021.12.0" summary = "Intel® oneAPI Threading Building Blocks (oneTBB)" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Windows\"" files = [ {file = "tbb-2021.12.0-py2.py3-none-manylinux1_i686.whl", hash = "sha256:f2cc9a7f8ababaa506cbff796ce97c3bf91062ba521e15054394f773375d81d8"}, @@ -2780,7 +2813,7 @@ name = "threadpoolctl" version = "3.5.0" requires_python = ">=3.8" summary = "threadpoolctl" -groups = ["pytorch"] +groups = ["default", "pytorch"] files = [ {file = "threadpoolctl-3.5.0-py3-none-any.whl", hash = "sha256:56c1e26c150397e58c4926da8eeee87533b1e32bef131bd4bf6a2f45f3185467"}, {file = "threadpoolctl-3.5.0.tar.gz", hash = "sha256:082433502dd922bf738de0d8bcc4fdcbf0979ff44c42bd40f5af8a282f6fa107"}, @@ -2803,7 +2836,7 @@ name = "torch" version = "2.3.0" requires_python = ">=3.8.0" summary = "Tensors and Dynamic neural networks in Python with strong GPU acceleration" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "filelock", "fsspec", @@ -2845,7 +2878,7 @@ name = "torch-geometric" version = "2.5.3" requires_python = ">=3.8" summary = "Graph Neural Network Library for PyTorch" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "aiohttp", "fsspec", @@ -2888,7 +2921,7 @@ name = "tqdm" version = "4.66.2" requires_python = ">=3.7" summary = "Fast, Extensible Progress Meter" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "colorama; platform_system == \"Windows\"", ] @@ -2912,7 +2945,7 @@ files = [ name = "triton" version = "2.3.0" summary = "A language and compiler for custom Deep Learning operations" -groups = ["pytorch"] +groups = ["default", "pytorch"] marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.12\"" dependencies = [ "filelock", @@ -2928,7 +2961,7 @@ name = "typing-extensions" version = "4.15.0" requires_python = ">=3.9" summary = "Backported and Experimental Type Hints for Python 3.9+" -groups = ["dev", "docs", "pytorch", "visualisation"] +groups = ["default", "dev", "docs", "pytorch", "visualisation"] files = [ {file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"}, {file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"}, @@ -2950,7 +2983,7 @@ name = "urllib3" version = "2.2.1" requires_python = ">=3.8" summary = "HTTP library with thread-safe connection pooling, file post, and more." -groups = ["docs", "pytorch"] +groups = ["default", "docs", "pytorch"] files = [ {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, @@ -3012,7 +3045,7 @@ name = "yarl" version = "1.9.4" requires_python = ">=3.7" summary = "Yet another URL library" -groups = ["pytorch"] +groups = ["default", "pytorch"] dependencies = [ "idna>=2.0", "multidict>=4.0", diff --git a/pyproject.toml b/pyproject.toml index 01eb298..2946319 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,8 @@ dependencies = [ "networkx>=3.3", "scipy>=1.13.0", "pyproj>=3.7.0", + "matplotlib>=3.10.8", + "weather-model-graphs[pytorch]", ] requires-python = ">=3.10" readme = "README.md" diff --git a/tests/test_validator.py b/tests/test_validator.py new file mode 100644 index 0000000..199842d --- /dev/null +++ b/tests/test_validator.py @@ -0,0 +1,81 @@ +import importlib.util +import tempfile +import urllib.request +from pathlib import Path + +import pytest + +import tests.utils as test_utils +import weather_model_graphs as wmg + +VALIDATOR_URL = ( + "https://raw.githubusercontent.com/mllam/neural-lam/" + "feat/graph-on-disk-spec-and-validator/docs/validate_graph.py" +) + + +def _download_validator(tmpdir): + """Download the neural-lam validator script.""" + validator_path = Path(tmpdir) / "validate_graph.py" + + try: + urllib.request.urlretrieve(VALIDATOR_URL, validator_path) + except Exception: + pytest.skip("Could not download neural-lam validator script") + + return validator_path + + +def _load_validator_module(script_path): + """Dynamically load the validator module.""" + spec = importlib.util.spec_from_file_location("validator", script_path) + module = importlib.util.module_from_spec(spec) + + assert spec.loader is not None + spec.loader.exec_module(module) + + return module + + +def test_saved_graph_passes_neural_lam_validator(): + """Ensure graphs saved with save.to_pyg() follow neural-lam disk specification.""" + + xy = test_utils.create_fake_xy(N=64) + + graph = wmg.create.archetype.create_oskarsson_hierarchical_graph(coords=xy) + + with tempfile.TemporaryDirectory() as tmpdir: + graph_dir = Path(tmpdir) / "graph" + graph_dir.mkdir() + + # Split graph into components + graph_components = wmg.split_graph_by_edge_attribute(graph, attr="component") + graph = list(graph_components.values())[0] + + # Find common edge attributes + edge_attrs_sets = [set(d.keys()) for _, _, d in graph.edges(data=True)] + common_attrs = set.intersection(*edge_attrs_sets) if edge_attrs_sets else set() + edge_features = [f for f in common_attrs if f != "component"] + + # Save graph + wmg.save.to_pyg( + graph=graph, + output_directory=str(graph_dir), + name="test_graph", + edge_features=edge_features, + ) + + # Ensure files were created + written_files = list(graph_dir.rglob("*")) + assert written_files, "save.to_pyg() did not create any files" + + # Download validator + validator_script = _download_validator(tmpdir) + + # Load validator module + validator = _load_validator_module(validator_script) + + # Run validation + report = validator.validate_graph_directory(graph_dir) + + assert report.ok, f"Graph validation failed: {report.errors}"