-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from saraedum/pixi
Use pixi instead of a conda setup
- Loading branch information
Showing
12 changed files
with
5,978 additions
and
660 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,34 +14,19 @@ jobs: | |
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: { submodules: recursive } | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: { miniforge-variant: "Mambaforge" } | ||
- name: install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
mamba env update --quiet -n test -f environment.yml | ||
conda list | ||
- name: install echemdb-website | ||
shell: bash -l {0} | ||
run: | | ||
pip install -e . | ||
- uses: actions/checkout@v3 | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.39.5 | ||
- name: mkdocs | ||
shell: bash -l {0} | ||
run: | | ||
env: | ||
# Since no browser is installed during this CI run, plotly fails to | ||
# produce HTML output, see https://github.com/plotly/plotly.py/blob/2c2dd6ab2eeff73c782457f33c590c1d09a97625/packages/python/plotly/plotly/io/_renderers.py#L532 | ||
export PLOTLY_RENDERER=browser | ||
mkdocs build --strict | ||
mv data generated/website/ | ||
PLOTLY_RENDERER: browser | ||
run: | | ||
pixi run doc --strict | ||
# Disable further processing by GitHub | ||
touch generated/website/.nojekyll | ||
- name: fix permissions | ||
shell: bash -l {0} | ||
run: | | ||
# Strangely, the linkchecker modules are installed writable and linkchecker then refuses to load them. | ||
chmod -R a-w `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` | ||
- name: detect broken links | ||
shell: bash -l {0} | ||
run: | | ||
|
@@ -50,7 +35,7 @@ jobs: | |
# We check for broken links: | ||
# * ignore fonts.gstatic.com which is mentioned by a link preconnect tag that linkchecker does not parse correctly. | ||
# * ignore DOIs since some publishers ban GitHub or bots. | ||
linkchecker --check-extern --no-robots --ignore fonts.gstatic.com --ignore doi.org http://localhost:8880/ --ignore mybinder.org --ignore osti.gov --no-warnings | ||
pixi run linkchecker --check-extern --no-robots --ignore fonts.gstatic.com --ignore doi.org http://localhost:8880/ --ignore mybinder.org --ignore osti.gov --no-warnings | ||
# We only check links on Linux since we do not want to get flagged because of too many requests by the target websites. | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
- uses: JamesIves/[email protected] | ||
|
@@ -60,6 +45,3 @@ jobs: | |
target-folder: "" | ||
single-commit: true | ||
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }} | ||
|
||
env: | ||
MAKEFLAGS: -j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,26 +9,15 @@ concurrency: | |
|
||
jobs: | ||
python-linter: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: { submodules: recursive } | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: { miniforge-variant: "Mambaforge" } | ||
- name: install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
mamba env update --quiet -n test -f environment.yml | ||
conda list | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- uses: prefix-dev/[email protected] | ||
with: { pixi-version: v0.39.5 } | ||
- name: pylint | ||
shell: bash -l {0} | ||
run: | | ||
pylint website | ||
run: pixi run pylint | ||
- name: black | ||
shell: bash -l {0} | ||
run: | | ||
black --check --diff website | ||
run: pixi run black --diff --check | ||
- name: isort | ||
shell: bash -l {0} | ||
run: | | ||
isort --check --diff --profile black website | ||
run: pixi run isort --check --diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,22 +13,9 @@ jobs: | |
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
python: ["3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: { submodules: recursive } | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: { miniforge-variant: "Mambaforge", python-version: "${{ matrix.python }}" } | ||
- name: install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
mamba env update --quiet -n test -f environment.yml | ||
conda list | ||
- name: install echemdb-website | ||
shell: bash -l {0} | ||
run: | | ||
pip install -e . | ||
- name: doctest | ||
shell: bash -l {0} | ||
run: | | ||
pytest -n auto --doctest-plus --doctest-modules website | ||
- uses: actions/checkout@v3 | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.39.5 | ||
- run: pixi run doctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,35 @@ | ||
The [echemdb repository](https://github.com/echemdb/website) contains high | ||
quality experimental and theoretical data on electrochemical systems. The | ||
This project builds a website from the [eletrochemistry-data | ||
repository](https://github.com/echemdb/electrochemistry-data) which contains | ||
high quality experimental and theoretical data on electrochemical systems. The | ||
standardized and validated data displayed on the [projects | ||
website](https://www.echemdb.org/) so far is from the community and | ||
website](https://www.echemdb.org/cv) so far is from the community and | ||
publications aiming at fullfilling the [FAIR | ||
principles](https://www.go-fair.org/fair-principles/). | ||
|
||
The repository can be browsed on [our | ||
websites](https://www.echemdb.org/) or explored with a [Python | ||
API](https://github.com/echemdb/echemdb). | ||
API](https://github.com/echemdb/unitpackage). | ||
|
||
# For developers | ||
|
||
The build of the website can be tested locally with the following steps. | ||
|
||
## Installation | ||
|
||
Clone the repository | ||
Install [pixi](https://pixi.sh) and clone this repository | ||
|
||
```sh | ||
git clone [email protected]:echemdb/website.git | ||
``` | ||
|
||
Install dependencies (mamba or conda) | ||
To preview the website run | ||
|
||
```sh | ||
cd website | ||
mamba env create --file environment.yaml | ||
mamba activate echemdb-website | ||
pip install -e . | ||
``` | ||
|
||
## Build website | ||
|
||
```sh | ||
mkdcos serve | ||
``` | ||
|
||
The generated HTML files are located in `generated/website` | ||
|
||
Entries for the individual cyclic voltammograms are created from datapackaes in `data/generated/svgdigitizer`. Follow the next section to create such data. | ||
|
||
## Convert literature to datapackages | ||
|
||
To digitize all data | ||
|
||
```sh | ||
cd data | ||
make | ||
pixi run preview | ||
``` | ||
|
||
To run the svgdigitizer in parallel on 8 cores, use instead | ||
|
||
```sh | ||
make -j8 | ||
``` | ||
|
||
We can also only digitize a single data set | ||
|
||
```sh | ||
make generated/svgdigitizer/mello_2018_understanding_J3045/mello_2018_understanding_J3045_p1_f1H_black.csv | ||
``` | ||
|
||
To digitize data from a different source directory than | ||
`literature/` use | ||
|
||
```sh | ||
make SOURCE_DIR=/another/path | ||
``` | ||
|
||
## Code changes | ||
|
||
If you make changes to the code test the modules with | ||
|
||
```sh | ||
pytest --doctest-modules website | ||
pylint website | ||
isort website | ||
black website | ||
pixi run doctest | ||
pixi run lint | ||
``` | ||
|
||
# License | ||
|
Oops, something went wrong.