From e96ccd4cd4ad02cd496b47c55bf5485882081650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:42:19 -0400 Subject: [PATCH] Update `.readthedocs.yaml` (#418) * Update .readthedocs.yaml * Bump `flake8` to avoid linting failure * Fix typo and reformat code to satisfy now-caught `flake8` linting --- .github/workflows/lint.yaml | 2 +- .readthedocs.yaml | 9 +++++++-- nequip/data/_dataset/_base_datasets.py | 5 +++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 070f2557..5f7c96cd 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,7 +29,7 @@ jobs: python-version: '3.x' - name: Install flake8 run: | - pip install flake8==4.0.1 + pip install flake8==7.0.0 - name: run flake8 run: | flake8 . --count --show-source --statistics diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 661d3d3b..70205bbd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,10 +1,15 @@ # .readthedocs.yaml # Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# See https://docs.readthedocs.io/en/stable/config-file for details # Required version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.9" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py @@ -12,4 +17,4 @@ sphinx: # Optionally declare the Python requirements required to build your docs python: install: - - requirements: docs/requirements.txt \ No newline at end of file + - requirements: docs/requirements.txt diff --git a/nequip/data/_dataset/_base_datasets.py b/nequip/data/_dataset/_base_datasets.py index d49b91d2..bda86734 100644 --- a/nequip/data/_dataset/_base_datasets.py +++ b/nequip/data/_dataset/_base_datasets.py @@ -220,11 +220,12 @@ def process(self): # Check bad key combinations, but don't require that this be a graph yet. AtomicDataDict.validate_keys(all_keys, graph_required=False) - # check dimesionality + # check dimensionality num_examples = set([len(a) for a in fields.values()]) if not len(num_examples) == 1: + shape_dict = {f: v.shape for f, v in fields.items()} raise ValueError( - f"This dataset is invalid: expected all fields to have same length (same number of examples), but they had shapes { {f: v.shape for f, v in fields.items() } }" + f"This dataset is invalid: expected all fields to have same length (same number of examples), but they had shapes {shape_dict}" ) num_examples = next(iter(num_examples))