Skip to content

Commit c3a4eca

Browse files
committed
adapt github CI and provide a minimal data example that can be run for testing purposes
1 parent c645337 commit c3a4eca

6 files changed

+49
-19
lines changed

.github/workflows/climateset-emulator.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ssp package
1+
name: ClimateSet Emulator Checks
22

33
on: [push, pull_request]
44

@@ -26,17 +26,18 @@ jobs:
2626
- name: Setup environment
2727
run: |
2828
bash setup.sh
29-
- name: Download data
29+
- name: Test metrics and losses
3030
run: |
31-
bash setup.sh -d
31+
cd tests
32+
pytest
33+
# - name: Download data from original source
34+
# run: |
35+
# bash setup.sh -d
3236
- name: Test if you can run one single model
3337
run: |
3438
source env_emulator/bin/activate
3539
python emulator/run.py experiment=github_workflow.yaml
36-
- name: Test metrics and losses
37-
run: |
38-
cd tests
39-
pytest
40+
4041
# - name: Pipx build
4142
# - name: check dist
4243
# - name: publish dist (on TestPyPi)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
_target_: emulator.src.datamodules.climate_datamodule.ClimateDataModule
2+
3+
in_var_ids: ['CO2_sum', 'CH4_sum']
4+
out_var_ids: ['tas']
5+
seq_to_seq: True
6+
batch_size: 4
7+
channels_last: False
8+
eval_batch_size: 4
9+
train_historical_years: "1890-1900"
10+
test_years: "2040-2050"
11+
train_years: "2020-2040"
12+
val_split: 0.1
13+
train_scenarios: ["ssp126"]
14+
test_scenarios: ["ssp245"]
15+
train_models: ["NorESM2-LM"]
16+
num_ensembles: 1
17+
num_workers: 0
18+
pin_memory: False
19+
emissions_tracker: True
20+
load_train_into_mem: True
21+
load_test_into_mem: True
22+
verbose: True
23+
seed: 11
24+
seq_len: 12
25+
lat: 96 # corrected latitude after fix
26+
lon: 144 # corrected longitude after fix
27+
num_levels: 1
28+
#input_transform: Optional[AbstractTransform] = None,
29+
#normalizer: Optional[Normalizer] = None,

emulator/configs/experiment/github_workflow.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defaults:
88
- override /model: conv_lstm.yaml # put the desired model name here
99
- override /callbacks: default.yaml
1010
- override /logger: none.yaml
11-
- override /datamodule: climate.yaml # standard datamodule configurations
11+
- override /datamodule: mini-climate.yaml # standard datamodule configurations
1212

1313
# all parameters below will be merged with parameters from default configurations set above
1414
# this allows you to overwrite only specified parameters
@@ -21,7 +21,7 @@ seed: 42
2121

2222
trainer:
2323
min_epochs: 1
24-
max_epochs: 3
24+
max_epochs: 10
2525

2626
model:
2727
loss_function: "climax_lon_lat_rmse"
@@ -30,12 +30,12 @@ model:
3030
pretrained_run_id: null
3131
pretrained_ckpt_dir: null
3232

33-
datamodule:
34-
in_var_ids: ['BC_sum', 'CO2_sum', 'SO2_sum', 'CH4_sum']
35-
out_var_ids: ['tas', 'pr']
36-
train_historical_years: "1850-2010"
37-
train_models: ["NorESM2-LM"]
38-
seq_to_seq: True
39-
batch_size: 4
40-
channels_last: False
41-
eval_batch_size: 4
33+
# datamodule:
34+
# in_var_ids: ['BC_sum', 'CO2_sum', 'SO2_sum', 'CH4_sum']
35+
# out_var_ids: ['tas', 'pr']
36+
# train_historical_years: "1850-2010"
37+
# train_models: ["NorESM2-LM"]
38+
# seq_to_seq: True
39+
# batch_size: 4
40+
# channels_last: False
41+
# eval_batch_size: 4

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on_cluster=false
1313
on_windows=false
1414

1515
# Parse command line options
16-
while getopts pbcnh opt; do
16+
while getopts dmcrwh opt; do
1717
case ${opt} in
1818
d )
1919
get_data=true

0 commit comments

Comments
 (0)