Skip to content

Commit f706cba

Browse files
Revert "Adopt pixi for environment management and modernize CI (#493)"
This reverts commit dec571e.
1 parent dec571e commit f706cba

19 files changed

Lines changed: 226 additions & 18798 deletions

.github/workflows/nbval.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: prefix-dev/setup-pixi@v0.8.3
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
2223
with:
23-
environments: dev
24-
- name: Validate notebook output
24+
python-version: "3.12"
25+
- name: Install notebook environment
2526
run: |
26-
pixi run -e dev pytest --nbval --nbval-sanitize-with docs/nbval_sanitization_rules.cfg docs/${{ matrix.notebook-file }}
27-
- name: Convert notebook to HTML
27+
python -m pip install --upgrade pip wheel
28+
pip install --timeout=300 -r requirements.txt -r docs/notebook_requirements.txt .[test]
29+
- name: Run notebook and check output
2830
run: |
31+
# --nbval-sanitize-with: pre-process text to remove irrelevant differences (e.g. warning filepaths)
32+
pytest --nbval --nbval-sanitize-with docs/nbval_sanitization_rules.cfg docs/${{ matrix.notebook-file }}
33+
- name: Run notebooks again, save files
34+
run: |
35+
pip install nbconvert[webpdf]
2936
mkdir docs/artifacts
30-
pixi run -e dev jupyter nbconvert --to html --output artifacts/${{ matrix.notebook-file }}.html docs/${{ matrix.notebook-file }}
37+
jupyter nbconvert --to html --execute --ExecutePreprocessor.timeout=600 --allow-errors --output artifacts/${{ matrix.notebook-file }}.html docs/${{ matrix.notebook-file }}
3138
- name: Upload artifacts
3239
uses: actions/upload-artifact@v4
3340
with:

.github/workflows/pytest.yaml

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,24 @@ on:
99

1010

1111
jobs:
12-
validate-envs:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: prefix-dev/setup-pixi@v0.8.3
17-
with:
18-
environments: core default dev
19-
frozen: true
20-
- name: Validate core environment
21-
run: pixi run -e core python -c "import rdtools; print(rdtools.__version__)"
22-
- name: Validate default environment
23-
run: pixi run python -c "import rdtools; import jupyter; print('default OK')"
24-
- name: Validate dev environment
25-
run: pixi run -e dev python -c "import rdtools; import pytest; import jupyter; print('dev OK')"
26-
27-
test:
28-
runs-on: ubuntu-latest
29-
strategy:
30-
matrix:
31-
environment: [dev-py310, dev-py311, dev-py312, dev-py313, dev-py314]
32-
fail-fast: false
33-
34-
steps:
35-
- uses: actions/checkout@v4
36-
- uses: prefix-dev/setup-pixi@v0.8.3
37-
with:
38-
environments: ${{ matrix.environment }}
39-
- name: Test with pytest (${{ matrix.environment }})
40-
run: pixi run -e ${{ matrix.environment }} test
41-
- name: Upload coverage reports to Codecov
42-
uses: codecov/codecov-action@v4
43-
env:
44-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45-
46-
test-min:
47-
runs-on: ubuntu-latest
48-
49-
steps:
50-
- uses: actions/checkout@v4
51-
- uses: prefix-dev/setup-pixi@v0.8.3
52-
with:
53-
environments: dev-min
54-
- name: Test with pytest (minimum versions)
55-
run: pixi run -e dev-min test
56-
- name: Upload coverage reports to Codecov
57-
uses: codecov/codecov-action@v4
58-
env:
59-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
12+
build:
6013

61-
test-latest:
6214
runs-on: ubuntu-latest
6315
strategy:
6416
matrix:
65-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
18+
env: [
19+
'-r requirements.txt .[test]',
20+
'-r requirements-min.txt .[test]',
21+
'--upgrade --upgrade-strategy=eager .[test]'
22+
]
23+
exclude:
24+
- python-version: "3.11"
25+
env: '-r requirements-min.txt .[test]'
26+
- python-version: "3.12"
27+
env: '-r requirements-min.txt .[test]'
28+
- python-version: "3.13"
29+
env: '-r requirements-min.txt .[test]'
6630
fail-fast: false
6731

6832
steps:
@@ -71,12 +35,13 @@ jobs:
7135
uses: actions/setup-python@v5
7236
with:
7337
python-version: ${{ matrix.python-version }}
74-
- name: Install latest versions
38+
- name: Install ${{ matrix.env }}
7539
run: |
7640
python -m pip install --upgrade pip wheel
77-
pip install --timeout=300 --upgrade --upgrade-strategy=eager .[test]
78-
- name: Test with pytest (latest)
79-
run: python -m pytest --cov=rdtools --cov-report=xml
41+
pip install --timeout=300 ${{ matrix.env }}
42+
- name: Test with pytest ${{ matrix.env }}
43+
run: |
44+
python -m pytest --cov=./ --cov-report=xml
8045
- name: Upload coverage reports to Codecov
8146
uses: codecov/codecov-action@v4
8247
env:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: requirements
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- development
8+
pull_request:
9+
10+
11+
jobs:
12+
requirements:
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
- name: Install notebook environment
27+
run: |
28+
python -m pip install --upgrade pip wheel
29+
pip install --timeout=300 -r requirements.txt -r docs/notebook_requirements.txt

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
.coveralls.yml
1212
.coverage
1313
.coverage.*
14-
coverage.xml
1514
htmlcov/
1615

1716
# ignore test cache
@@ -39,9 +38,5 @@ rdtools.egg-info*
3938

4039
*.pickle
4140

42-
# pixi environments (local, not committed)
43-
.pixi/*
44-
!.pixi/config.toml
45-
4641
# ignore vscode settings
4742
.vscode/

.pixi.lnk

-707 Bytes
Binary file not shown.

README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,17 @@ command line:
2525
pip install rdtools
2626
```
2727

28-
Optional extras are available:
29-
30-
```
31-
pip install rdtools[notebooks] # Jupyter and notebook dependencies
32-
pip install rdtools[test] # pytest, coverage, flake8
33-
pip install rdtools[dev] # notebooks + test combined
34-
```
35-
36-
Alternatively, RdTools uses [pixi](https://pixi.sh) for reproducible
37-
environment management. To get started with pixi:
38-
39-
```
40-
pixi install # default environment (core + notebooks)
41-
pixi run lab # launch Jupyter Lab
42-
```
43-
44-
For development, use the `dev` environment which includes both notebook
45-
and test dependencies:
46-
47-
```
48-
pixi shell -e dev # activate the dev environment
49-
pixi run -e dev test # run pytest with coverage
50-
pixi run -e dev nbval # validate notebooks
51-
pixi run -e dev lab # launch Jupyter Lab
52-
```
53-
5428
For API documentation and full examples, please see the [documentation](https://rdtools.readthedocs.io).
5529

56-
RdTools currently is tested on Python 3.10+.
30+
RdTools currently is tested on Python 3.9+.
5731

5832
## Citing RdTools
5933

6034
To cite RdTools, please use the following along with the version number
6135
and the specific DOI coresponding to that version from [Zenodo](https://doi.org/10.5281/zenodo.1210316):
6236

63-
- Michael G. Deceglie, Martin Springer, Kevin Anderson, Adam Shinn, Kirsten Perry, Ambarish Nag,
64-
Mark Mikofski, Jiyang Yan, Sandra Villamar, Will Vining,
37+
- Michael G. Deceglie, Kevin Anderson, Adam Shinn, Ambarish Nag, Mark Mikofski,
38+
Martin Springer, Jiyang Yan, Kirsten Perry, Sandra Villamar, Will Vining,
6539
Gregory Kimball, Daniel Ruth, Noah Moyer, Quyen Nguyen, Dirk Jordan,
6640
Matthew Muller, and Chris Deline, RdTools, version {insert version}, Computer Software,
6741
https://github.com/NatLabRockies/rdtools. DOI:{insert DOI}

docs/Multi-year_on_year_example.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"1. Import and preliminary calculations: In this step data is imported and augmented to enable analysis with RdTools. **No RdTools functions are used in this step. It will vary depending on the particulars of your dataset.** \n",
1717
"2. Analysis with RdTools: This notebook illustrates the use of the TrendAnalysis API with two new features: `label='center'` and `multi_yoy=True`. Because we are implementing this with the `rdtools.TrendAnalysis` object-oriented API, it requires passing kwargs to `degradation_year_on_year` as a dictionary in the `TrendAnalysis.sensor_analysis(yoy_kwargs={})` input.\n",
1818
"\n",
19-
"For a consistent experience, we recommend using [pixi](https://pixi.sh) to set up the notebook environment. From the base directory, run `pixi run -e notebooks lab` to launch JupyterLab with all required packages. Alternatively, install manually with `pip install rdtools[notebooks]`. This notebook was tested in python 3.13.\n",
19+
"For a consistent experience, we recommend installing the packages and versions documented in `docs/notebook_requirements.txt`. This can be achieved in your environment by running `pip install -r docs/notebook_requirements.txt` from the base directory. (RdTools must also be separately installed.) This notebook was tested in python 3.12.\n",
2020
"\n",
2121
"This notebook works with data from system 4 of the PVDAQ dataset [1]. This notebook automatically downloads and locally caches the dataset used in this example. The data can also be found on the DuraMAT Datahub (https://datahub.duramat.org/dataset/pvdaq-time-series-with-soiling-signal).\n",
2222
"\n",
@@ -230,7 +230,7 @@
230230
},
231231
{
232232
"cell_type": "code",
233-
"execution_count": null,
233+
"execution_count": 9,
234234
"metadata": {},
235235
"outputs": [
236236
{
@@ -459,9 +459,9 @@
459459
"metadata": {
460460
"anaconda-cloud": {},
461461
"kernelspec": {
462-
"display_name": "rdtools_313-nb",
462+
"display_name": "Python [conda env:rdtools_dev]",
463463
"language": "python",
464-
"name": "python3"
464+
"name": "conda-env-rdtools_dev-py"
465465
},
466466
"language_info": {
467467
"codemirror_mode": {
@@ -473,7 +473,7 @@
473473
"name": "python",
474474
"nbconvert_exporter": "python",
475475
"pygments_lexer": "ipython3",
476-
"version": "3.13.11"
476+
"version": "3.12.11"
477477
}
478478
},
479479
"nbformat": 4,

docs/TrendAnalysis_example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"# TrendAnalysis object-oriented example\n",
88
"\n",
99
"\n",
10-
"This juypter notebook is intended to demonstrate the RdTools analysis workflow as implemented with the `rdtools.TrendAnalysis` object-oriented API. For a consistent experience, we recommend using [pixi](https://pixi.sh) to set up the notebook environment. From the base directory, run `pixi run -e notebooks lab` to launch JupyterLab with all required packages. Alternatively, install manually with `pip install rdtools[notebooks]`. This notebook was tested in python 3.13.\n",
10+
"This juypter notebook is intended to demonstrate the RdTools analysis workflow as implemented with the `rdtools.TrendAnalysis` object-oriented API. For a consistent experience, we recommend installing the packages and versions documented in `docs/notebook_requirements.txt`. This can be achieved in your environment by running `pip install -r docs/notebook_requirements.txt` from the base directory. (RdTools must also be separately installed.) This notebook was tested in python 3.12.\n",
1111
"\n",
1212
"The calculations consist of two phases:\n",
1313
"\n",

docs/TrendAnalysis_example_NSRDB.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"# TrendAnalysis with satellite data\n",
88
"\n",
99
"\n",
10-
"This juypter notebook is intended to demonstrate how to use the RdTools analysis workflow as implemented with the `rdtools.TrendAnalysis` object-oriented API with satellite weather/irradiance data, such as NSRDB, instead of ground-based sensor data. For a consistent experience, we recommend using [pixi](https://pixi.sh) to set up the notebook environment. From the base directory, run `pixi run -e notebooks lab` to launch JupyterLab with all required packages. Alternatively, install manually with `pip install rdtools[notebooks]`. This notebook was tested in python 3.13.\n",
10+
"This juypter notebook is intended to demonstrate how to use the RdTools analysis workflow as implemented with the `rdtools.TrendAnalysis` object-oriented API with satellite weather/irradiance data, such as NSRDB, instead of ground-based sensor data. For a consistent experience, we recommend installing the packages and versions documented in `docs/notebook_requirements.txt`. This can be achieved in your environment by running `pip install -r docs/notebook_requirements.txt` from the base directory. (RdTools must also be separately installed.) This notebook was tested in python 3.12.\n",
1111
"\n",
1212
"The calculations consist of two phases:\n",
1313
"\n",

docs/degradation_and_soiling_example.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"# Degradation and soiling example\n",
88
"\n",
99
"\n",
10-
"This jupyter notebook is intended to the RdTools trend analysis workflow using the functional API. In addition, the notebook demonstrates the effects of changes in the workflow. For a consistent experience, we recommend using [pixi](https://pixi.sh) to set up the notebook environment. From the base directory, run `pixi run -e notebooks lab` to launch JupyterLab with all required packages. Alternatively, install manually with `pip install rdtools[notebooks]`. These environments and examples are tested with Python 3.13.\n",
10+
"This jupyter notebook is intended to the RdTools trend analysis workflow using the functional API. In addition, the notebook demonstrates the effects of changes in the workflow. For a consistent experience, we recommend installing the specific versions of packages used to develop this notebook. This can be achieved in your environment by running `pip install -r requirements.txt` followed by `pip install -r docs/notebook_requirements.txt` from the base directory. (RdTools must also be separately installed.) These environments and examples are tested with Python 3.12.\n",
1111
"\n",
1212
"The calculations consist of several steps illustrated here:\n",
1313
"<ol start=\"0\">\n",
@@ -94371,7 +94371,7 @@
9437194371
"metadata": {
9437294372
"anaconda-cloud": {},
9437394373
"kernelspec": {
94374-
"display_name": "rdtools_313-nb",
94374+
"display_name": "Python 3 (ipykernel)",
9437594375
"language": "python",
9437694376
"name": "python3"
9437794377
},
@@ -94385,7 +94385,7 @@
9438594385
"name": "python",
9438694386
"nbconvert_exporter": "python",
9438794387
"pygments_lexer": "ipython3",
94388-
"version": "3.13.11"
94388+
"version": "3.12.7"
9438994389
}
9439094390
},
9439194391
"nbformat": 4,

0 commit comments

Comments
 (0)