From 39468a16cfe901f4198746c65bad01de627b638b Mon Sep 17 00:00:00 2001 From: AlbertEngstfeld Date: Sun, 3 Mar 2024 00:06:18 +0100 Subject: [PATCH 1/3] Change retrieval of data --- environment.yml | 6 +++--- website/filters/__init__.py | 1 + website/filters/render.py | 1 + website/filters/unicode.py | 1 + website/generator/__main__.py | 1 + website/generator/database.py | 14 +++++++------- website/macros/__init__.py | 1 + website/macros/render.py | 1 + 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/environment.yml b/environment.yml index 5ab7768c3..02b0e0dc1 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - defaults dependencies: - astropy - - black + - black>=24,<25 - unitpackage>=0.7.1,<0.8.0 - isort - make @@ -14,12 +14,11 @@ dependencies: - myst-parser>=0.18.0,<0.19.0 - pip - pylatexenc>=2.10,<3 - - pylint + - pylint>=3,<3.1 - pytest - pytest-doctestplus - pytest-xdist - pytest-remotedata - - svgdigitizer>=0.10,<0.11 - pip: - linkchecker # In early 2022 we had trouble with some recent versions of mkdocs. To work around this issue, we pin mkdocs plugin versions exactly. This pin can likely be relaxed again. @@ -39,3 +38,4 @@ dependencies: - pymdown-extensions>=9.2,<10 - python-frontmatter - tabulate + - git+https://github.com/echemdb/electrochemistry-data diff --git a/website/filters/__init__.py b/website/filters/__init__.py index ecf73f12b..66c546f16 100644 --- a/website/filters/__init__.py +++ b/website/filters/__init__.py @@ -1,6 +1,7 @@ r""" Provides custom Jinja filters for rendering the echemdb websites. """ + # ******************************************************************** # This file is part of echemdb. # diff --git a/website/filters/render.py b/website/filters/render.py index c7ab4aa15..fea8632f5 100644 --- a/website/filters/render.py +++ b/website/filters/render.py @@ -37,6 +37,7 @@ '1 M' """ + # ******************************************************************** # This file is part of echemdb. # diff --git a/website/filters/unicode.py b/website/filters/unicode.py index 556513e06..3a79bca81 100644 --- a/website/filters/unicode.py +++ b/website/filters/unicode.py @@ -10,6 +10,7 @@ 'Glöckner' """ + # ******************************************************************** # This file is part of echemdb. # diff --git a/website/generator/__main__.py b/website/generator/__main__.py index 5966d3519..e074e2e86 100644 --- a/website/generator/__main__.py +++ b/website/generator/__main__.py @@ -5,6 +5,7 @@ ` to generate pages such as the individual pages for each entry in the database. """ + # ******************************************************************** # This file is part of echemdb. # diff --git a/website/generator/database.py b/website/generator/database.py index 86f014658..6e83e678b 100644 --- a/website/generator/database.py +++ b/website/generator/database.py @@ -14,6 +14,7 @@ [...] """ + # ******************************************************************** # This file is part of echemdb-website. # @@ -36,13 +37,12 @@ # along with echemdb-website. If not, see . # ******************************************************************** -import os.path - -import unitpackage.cv.cv_collection -import unitpackage.local +from echemdb_ecdata.url import get_echemdb_database_url +from unitpackage.cv.cv_collection import CVCollection +from unitpackage.remote import collect_datapackages -packages = unitpackage.local.collect_datapackages( - os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "data")) +packages = collect_datapackages( + data=".", url=get_echemdb_database_url(), outdir="data/generated/" ) -cv = unitpackage.cv.cv_collection.CVCollection(packages) +cv = CVCollection(packages) diff --git a/website/macros/__init__.py b/website/macros/__init__.py index b5ddf6537..53105a12e 100644 --- a/website/macros/__init__.py +++ b/website/macros/__init__.py @@ -1,6 +1,7 @@ r""" Provides custom Jinja macros for rendering the echemdb websites. """ + # ******************************************************************** # This file is part of echemdb. # diff --git a/website/macros/render.py b/website/macros/render.py index 51529b2c7..4a0e3fd45 100644 --- a/website/macros/render.py +++ b/website/macros/render.py @@ -13,6 +13,7 @@ '1 M' """ + # ******************************************************************** # This file is part of echemdb. # From b13020ae360b9f8b78cbe0ea2a0d5998c8d1aac8 Mon Sep 17 00:00:00 2001 From: AlbertEngstfeld Date: Sun, 3 Mar 2024 00:08:23 +0100 Subject: [PATCH 2/3] adapt workflow --- .github/workflows/build.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43df13027..215bf2ff2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,11 +23,6 @@ jobs: run: | mamba env update --quiet -n test -f environment.yml conda list - - name: digitize - shell: bash -l {0} - run: | - cd data - make - name: install echemdb-website shell: bash -l {0} run: | @@ -65,19 +60,6 @@ jobs: target-folder: "" single-commit: true if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }} - - name: doctest against generated website data - shell: bash -l {0} - run: | - # Create a ZIP archive similar to the one automatically rovided by GitHub. - mkdir website-gh-pages - cp -R generated/website/data website-gh-pages/ - zip -r generated/website/website-gh-pages.zip website-gh-pages - - # Run tests against the new ZIP archive. - export ECHEMDB_DATABASE_URL=http://localhost:8880/website/website-gh-pages.zip - pytest -n auto --doctest-plus --remote-data --doctest-modules website - # We only run tests on Linux since we already run tests for all OSes in the test workflow. - if: ${{ matrix.os == 'ubuntu-latest' }} env: MAKEFLAGS: -j2 From 7de48a7c755e52f58b7500a1ccb59de3ccf73627 Mon Sep 17 00:00:00 2001 From: AlbertEngstfeld Date: Sun, 3 Mar 2024 00:10:22 +0100 Subject: [PATCH 3/3] Adapat PR template --- .github/pull_request_template.md | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 575fe274a..eb06a92f7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,31 +1,3 @@ -# Adding Literature Checklist (delete if not applicable) - -For contributors and reviewers alike. - -- [ ] Name PR `Add literature_identifier` - -**Filename** - -- [ ] Words and identifiers in the filenames must be lowercase. -- [ ] The filename must be of type `NAME_YEAR_FIRST-WORD_VOLUME_fxy_IDENTIFIER` (where x is the figure number and y the subfigure label, i.e., 2b). -- [ ] The figure number must match that of the figure in the article. - -**Bib file** - -- [ ] The identifier must be identical with that in the filename as well as the citation key in the YAML. -- [ ] Remove typos (or unwanted whitespace), specifically in the title such as `Pt (111)` to `Pt(111)`. - -**SVG** - -- [ ] The curve label should be short and unambiguous? -- [ ] Figure label should be of type `Figure: xy` (not `Figure: fxy`). -- [ ] The figure label must be identical to that in the article. -- [ ] Comments should be complete sentences ending with a period. -- [ ] A `tags` text label should be included in the SVG. -- [ ] The units on the axis should be identical to those n the figure. - -**YAML** - -- [ ] The identifier must be identical to that in the filename. -- [ ] Comments should be complete sentences ending with a period. +- [ ] Add news for the change +- [ ] Adapt documentation