Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch data from remote database #212

Merged
merged 3 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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
18 changes: 0 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- defaults
dependencies:
- astropy
- black
- black>=24,<25
- unitpackage>=0.7.1,<0.8.0
- isort
- make
Expand All @@ -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.
Expand All @@ -39,3 +38,4 @@ dependencies:
- pymdown-extensions>=9.2,<10
- python-frontmatter
- tabulate
- git+https://github.com/echemdb/electrochemistry-data
1 change: 1 addition & 0 deletions website/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""
Provides custom Jinja filters for rendering the echemdb websites.
"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
1 change: 1 addition & 0 deletions website/filters/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'1 M'

"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
1 change: 1 addition & 0 deletions website/filters/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'Glöckner'

"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
1 change: 1 addition & 0 deletions website/generator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<https://oprypin.github.io/mkdocs-gen-files/>` to generate pages such as the
individual pages for each entry in the database.
"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
14 changes: 7 additions & 7 deletions website/generator/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[...]

"""

# ********************************************************************
# This file is part of echemdb-website.
#
Expand All @@ -36,13 +37,12 @@
# along with echemdb-website. If not, see <https://www.gnu.org/licenses/>.
# ********************************************************************

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)
1 change: 1 addition & 0 deletions website/macros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""
Provides custom Jinja macros for rendering the echemdb websites.
"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
1 change: 1 addition & 0 deletions website/macros/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'1 M'

"""

# ********************************************************************
# This file is part of echemdb.
#
Expand Down
Loading