Skip to content

Commit e9ee2c5

Browse files
authored
Merge pull request #4 from scottyhq/use-pixi
Use pixi instead of conda for environment management
2 parents 15c6540 + 0b13b25 commit e9ee2c5

10 files changed

Lines changed: 9397 additions & 90 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/batch_predict_sd.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name: batch_predict_sd
33
run-name: batch snow depth ${{ inputs.target_date }}
44

5-
env:
6-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
7-
85
on:
96
workflow_dispatch:
107
inputs:
@@ -60,7 +57,7 @@ on:
6057
options:
6158
- 'False'
6259
- 'True'
63-
60+
6461
workflow_call:
6562
inputs:
6663
target_date:
@@ -94,26 +91,20 @@ jobs:
9491
outputs:
9592
MATRIX: ${{ steps.prep_tiles.outputs.MATRIX_PARAMS_COMBINATIONS }}
9693
TILE_COUNT: ${{ steps.prep_tiles.outputs.TILE_COUNT }}
97-
defaults:
98-
run:
99-
shell: bash -el {0}
94+
10095
steps:
10196
- name: Checkout Repository
10297
uses: actions/checkout@v6
10398

104-
- name: Install Conda environment with Micromamba
105-
uses: mamba-org/setup-micromamba@v3
99+
- uses: prefix-dev/setup-pixi@v0.9.5
106100
with:
107-
cache-environment: true
108-
environment-file: environment.yml
109-
110-
- name: Install deep-snow
111-
run: |
112-
pip install .
101+
cache: true
102+
frozen: true
103+
activate-environment: true
113104

114105
- name: Prepare tiles over area of interest
115106
id: prep_tiles
116-
run: |
107+
run: |
117108
python -u scripts/actions/prep_tiles.py ${{ inputs.target_date }} "${{ inputs.aoi }}"
118109
119110
- name: Summarize Tile Preparation
@@ -141,7 +132,7 @@ jobs:
141132
uses: ./.github/workflows/predict_tile_sd.yml
142133
with:
143134
target_date: ${{ inputs.target_date }}
144-
snow_off_date: ${{ inputs.snow_off_date }}
135+
snow_off_date: ${{ inputs.snow_off_date }}
145136
aoi: ${{ matrix.aoi }}
146137
clip_aoi: ${{ matrix.clip_aoi }}
147138
cloud_cover: ${{ inputs.cloud_cover }}

.github/workflows/batch_predict_ts.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name: batch_sd_timeseries
33
run-name: snow depth time series ${{ inputs.begin_date }}-${{ inputs.end_date }}
44

5-
env:
6-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
7-
85
on:
96
workflow_dispatch:
107
inputs:
@@ -73,26 +70,20 @@ jobs:
7370
outputs:
7471
MATRIX: ${{ steps.prep_dates.outputs.MATRIX_PARAMS_COMBINATIONS }}
7572
DATE_COUNT: ${{ steps.prep_dates.outputs.DATE_COUNT }}
76-
defaults:
77-
run:
78-
shell: bash -el {0}
73+
7974
steps:
8075
- name: Checkout Repository
8176
uses: actions/checkout@v6
8277

83-
- name: Install Conda environment with Micromamba
84-
uses: mamba-org/setup-micromamba@v3
78+
- uses: prefix-dev/setup-pixi@v0.9.5
8579
with:
86-
cache-environment: true
87-
environment-file: environment.yml
88-
89-
- name: Install deep-snow
90-
run: |
91-
pip install .
80+
cache: true
81+
frozen: true
82+
activate-environment: true
9283

9384
- name: Select dates over time range
9485
id: prep_dates
95-
run: |
86+
run: |
9687
python -u scripts/actions/prep_time_series.py ${{ inputs.begin_date }} ${{ inputs.end_date }} ${{ inputs.snow_off_day }}
9788
9889
- name: Summarize Time-Series Request
@@ -121,7 +112,7 @@ jobs:
121112
uses: ./.github/workflows/batch_predict_sd.yml
122113
with:
123114
target_date: ${{ matrix.target_date }}
124-
snow_off_date: ${{ matrix.snow_off_date }}
115+
snow_off_date: ${{ matrix.snow_off_date }}
125116
aoi: ${{ inputs.aoi }}
126117
cloud_cover: ${{ inputs.cloud_cover }}
127118
selection_strategy: ${{ inputs.selection_strategy }}

.github/workflows/ci.yml

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,21 @@ on:
55
push:
66
branches:
77
- main
8-
9-
env:
10-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
11-
ACTIONLINT_VERSION: "1.7.12"
12-
138
jobs:
149
test:
1510
name: test
1611
runs-on: ubuntu-latest
17-
defaults:
18-
run:
19-
shell: bash -el {0}
2012

2113
steps:
2214
- name: Checkout repository
2315
uses: actions/checkout@v6
2416

25-
- name: Install Conda environment with Micromamba
26-
uses: mamba-org/setup-micromamba@v3
17+
- uses: prefix-dev/setup-pixi@v0.9.5
2718
with:
28-
cache-environment: true
29-
cache-downloads: true
30-
environment-file: environment.yml
31-
32-
- name: Install deep-snow
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -e .
19+
cache: true
20+
frozen: true
21+
activate-environment: true
3622

3723
- name: Run test suite
3824
run: |
3925
pytest -q tests
40-
41-
workflow_lint:
42-
name: workflow lint
43-
runs-on: ubuntu-latest
44-
defaults:
45-
run:
46-
shell: bash
47-
48-
steps:
49-
- name: Checkout repository
50-
uses: actions/checkout@v6
51-
52-
- name: Install actionlint
53-
run: |
54-
curl -sSL "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" -o actionlint.tar.gz
55-
tar -xzf actionlint.tar.gz actionlint
56-
sudo mv actionlint /usr/local/bin/actionlint
57-
58-
- name: Lint GitHub Actions workflows
59-
run: |
60-
actionlint

.github/workflows/predict_tile_sd.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name: predict_tile_sd
33
run-name: tile snow depth ${{ inputs.target_date }}
44

5-
env:
6-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
7-
85
on:
96
workflow_dispatch:
107
inputs:
@@ -69,7 +66,7 @@ on:
6966
required: false
7067
default: 'predict_tile_sd'
7168
type: string
72-
69+
7370
workflow_call:
7471
inputs:
7572
target_date:
@@ -106,23 +103,16 @@ jobs:
106103
predict_tile_sd:
107104
name: ${{ inputs.workflow_name }}
108105
runs-on: ubuntu-latest
109-
defaults:
110-
run:
111-
shell: bash -el {0}
112106

113107
steps:
114108
- name: Checkout Repository
115109
uses: actions/checkout@v6
116110

117-
- name: Install Conda environment with Micromamba
118-
uses: mamba-org/setup-micromamba@v3
111+
- uses: prefix-dev/setup-pixi@v0.9.5
119112
with:
120-
cache-environment: true
121-
environment-file: environment.yml
122-
123-
- name: Install deep-snow
124-
run: |
125-
pip install .
113+
cache: true
114+
frozen: true
115+
activate-environment: true
126116

127117
- name: Download Data and Predict Snow Depth
128118
run: |

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# deep-snow example outputs
2+
data/
3+
tmp-output/
4+
5+
# pixi environments
6+
.pixi/*
7+
!.pixi/config.toml
8+
19
# Byte-compiled / optimized / DLL files
210
__pycache__/
311
*.py[cod]

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ Fork the repo and run workflows from the Actions tab:
2727

2828
See [docs/github-actions.md](docs/github-actions.md) for details.
2929

30-
### Option 2: Local install
30+
### Option 2: Local install (we recommend pixi over conda)
31+
32+
```
33+
git clone https://github.com/geo-smart/deep-snow.git
34+
cd deep-snow
35+
pixi shell # 'exit'
36+
# test run
37+
pixi run predict-example
38+
```
39+
40+
### Option 2: Local install (with conda)
3141

3242
```bash
3343
git clone https://github.com/geo-smart/deep-snow.git
@@ -82,13 +92,13 @@ The model uses the following input data sources:
8292
- Fractional forest cover
8393
- COP30 digital elevation model
8494

85-
Sentinel-1 and Sentinel-2 inputs are selected close in time to the target date. Inputs are co-registered to a common grid and assembled into model-ready datasets. Airborne lidar snow depth maps are used for training and evaluation, but not for inference.
95+
Sentinel-1 and Sentinel-2 inputs are selected close in time to the target date. Inputs are co-registered to a common grid and assembled into model-ready datasets. Airborne lidar snow depth maps are used for training and evaluation, but not for inference.
8696

8797
<img src="imgs/inputs_v0.png" width="50%">
8898

8999
## Contributing
90100

91-
Contributions are welcome! No matter what your level of experience, you CAN help make this package better.
101+
Contributions are welcome! No matter what your level of experience, you CAN help make this package better.
92102

93103
If you have a suggestion, please fork the repo and create a pull request. You can also simply open an issue.
94104
1. Fork the Project

0 commit comments

Comments
 (0)