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

Bnb/exo refactor #167

Merged
merged 15 commits into from
Oct 4, 2023
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
18 changes: 9 additions & 9 deletions examples/sup3rcc/run_configs/solar/config_fwp.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"max_nodes": 10,
"exo_kwargs": {
"file_paths": ["/scratch/gbuster/sup3r/source_gcm_data/wind_solar_day_MRI-ESM2-0_ssp585_r1i1p1f1_gn_20150101-20151231.nc"],
"features": ["topography"],
"source_file": "/scratch/gbuster/sup3r/source_gcm_data/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"s_enhancements": [1, 5, 5],
"agg_factors": [625, 25, 1],
"input_handler": "DataHandlerNCforCC",
"exo_steps": [0, 1, 2]
"topography": {
"steps": [{"model": 0, "combine_type": "input"},
{"model": 0, "combine_type": "layer"},
{"model": 1, "combine_type": "input"}],
"file_paths": ["/scratch/gbuster/sup3r/source_gcm_data/wind_solar_day_MRI-ESM2-0_ssp585_r1i1p1f1_gn_20150101-20151231.nc"],
"source_file": "/scratch/gbuster/sup3r/source_gcm_data/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"input_handler": "DataHandlerNCforCC"}
},
"execution_control": {
"option": "eagle",
Expand Down
28 changes: 11 additions & 17 deletions examples/sup3rcc/run_configs/trh/config_fwp.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"file_paths": "PLACEHOLDER",
"model_kwargs": {
"surface_model_kwargs": {
"model_dir": "./sup3rcc_models_202303/sup3rcc_trh_step1_25x_1x_2f/"
},
"temporal_model_kwargs": {
"model_dirs": [
"./sup3rcc_models_202303/sup3rcc_trh_step2_1x_24x_2f/"
]
}
"model_dirs": [
"./sup3rcc_models_202303/sup3rcc_trh_step1_25x_1x_2f/",
"./sup3rcc_models_202303/sup3rcc_trh_step2_1x_24x_2f/"]
},
"model_class": "MultiStepSurfaceMetGan",
"out_pattern": "./chunks/sup3r_chunk_{file_id}.h5",
Expand Down Expand Up @@ -42,15 +37,14 @@
},
"max_nodes": 10,
"exo_kwargs": {
"file_paths": ["/datasets/sup3rcc/source/temp_humi_day_MRI-ESM2-0_ssp245_r1i1p1f1_gn_20500101-20501231.nc"],
"features": ["topography"],
"source_file": "/datasets/sup3rcc/source/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"s_enhancements": [1, 25],
"agg_factors": [625, 1],
"input_handler": "DataHandlerNCforCC",
"exo_steps": [0, 1]
"topography": {
"steps": [{"model": 0, "combine_type": "input"},
{"model": 0, "combine_type": "output"}],
"file_paths": ["/datasets/sup3rcc/source/temp_humi_day_MRI-ESM2-0_ssp245_r1i1p1f1_gn_20500101-20501231.nc"],
"source_file": "/datasets/sup3rcc/source/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"input_handler": "DataHandlerNCforCC"}
},
"execution_control": {
"option": "eagle",
Expand Down
27 changes: 13 additions & 14 deletions examples/sup3rcc/run_configs/wind/config_fwp.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"file_paths": "PLACEHOLDER",
"model_kwargs": {
"spatial_model_dirs": [
"model_dirs": [
"./sup3rcc_models_202303/sup3rcc_wind_step1_5x_1x_6f/",
"./sup3rcc_models_202303/sup3rcc_wind_step2_5x_1x_6f/"
],
"temporal_model_dirs": "./sup3rcc_models_202303/sup3rcc_wind_step3_1x_24x_6f/"
"./sup3rcc_models_202303/sup3rcc_wind_step2_5x_1x_6f/",
"./sup3rcc_models_202303/sup3rcc_wind_step3_1x_24x_6f/"]
},
"model_class": "SpatialThenTemporalGan",
"model_class": "MultiStepGan",
"out_pattern": "./chunks/sup3r_chunk_{file_id}.h5",
"log_pattern": "./logs/sup3r_fwp_log_{node_index}.log",
"bias_correct_method": "monthly_local_linear_bc",
Expand Down Expand Up @@ -39,15 +38,15 @@
},
"max_nodes": 50,
"exo_kwargs": {
"file_paths": ["/scratch/gbuster/sup3r/source_gcm_data/wind_solar_day_MRI-ESM2-0_ssp585_r1i1p1f1_gn_20150101-20151231.nc"],
"features": ["topography"],
"source_file": "/scratch/gbuster/sup3r/source_gcm_data/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"s_enhancements": [1, 5, 5],
"agg_factors": [625, 25, 1],
"input_handler": "DataHandlerNCforCC",
"exo_steps": [0, 1, 2]
"topography": {
"file_paths": ["/scratch/gbuster/sup3r/source_gcm_data/wind_solar_day_MRI-ESM2-0_ssp585_r1i1p1f1_gn_20150101-20151231.nc"],
"source_file": "/scratch/gbuster/sup3r/source_gcm_data/nsrdb_clearsky.h5",
"target": [23.2, -129],
"shape": [26, 59],
"steps": [{"model": 0, "combine_type": "input"},
{"model": 0, "combine_type": "layer"},
{"model": 1, "combine_type": "input"}],
"input_handler": "DataHandlerNCforCC"}
},
"execution_control": {
"option": "eagle",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib>=3.1
NREL-rex>=0.2.82
NREL-rex>=0.2.84
NREL-phygnn>=0.0.23
NREL-rev<0.8.0
NREL-gaps>=0.4.0
Expand Down
6 changes: 3 additions & 3 deletions sup3r/bias/bias_calc_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
sup3r bias correction calculation CLI entry points.
"""
import copy
import click
import logging
import os

import click

import sup3r.bias.bias_calc
from sup3r.utilities import ModuleName
from sup3r.version import __version__
from sup3r.utilities.cli import BaseCLI

from sup3r.version import __version__

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion sup3r/configs/sup3rcc/gen_wind_3x_4x_2f.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{"class": "SpatioTemporalExpansion", "spatial_mult": 3},
{"alpha": 0.2, "class": "LeakyReLU"},

{"class": "Sup3rConcat"},
{"class": "Sup3rConcat", "name": "topography"},

{"class": "FlexiblePadding", "paddings": [[0,0], [3,3], [3,3], [3,3], [0,0]], "mode": "REFLECT"},
{"class": "Conv3D", "filters": 2, "kernel_size": 3, "strides": 1},
Expand Down
2 changes: 1 addition & 1 deletion sup3r/configs/sup3rcc/gen_wind_5x_1x_6f.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{"class": "SpatialExpansion", "spatial_mult": 5},
{"alpha": 0.2, "class": "LeakyReLU"},

{"class": "Sup3rConcat"},
{"class": "Sup3rConcat", "name": "topography"},
{"class": "FlexiblePadding", "paddings": [[0,0], [3,3], [3,3], [0,0]], "mode": "REFLECT"},
{"class": "Conv2D", "filters": 64, "kernel_size": 3, "strides": 1},
{"class": "Cropping2D", "cropping": 2},
Expand Down
15 changes: 5 additions & 10 deletions sup3r/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# -*- coding: utf-8 -*-
"""Sup3r Model Software"""
from .base import Sup3rGan
from .wind import WindGan
from .solar_cc import SolarCC
from .conditional_moments import Sup3rCondMom
from .data_centric import Sup3rGanDC
from .multi_step import (MultiStepGan,
SpatialThenTemporalGan, TemporalThenSpatialGan,
MultiStepSurfaceMetGan, SolarMultiStepGan)
from .surface import SurfaceSpatialMetModel
from .linear import LinearInterp
from .conditional_moments import Sup3rCondMom
from .wind_conditional_moments import WindCondMom
from .multi_step import MultiStepGan, MultiStepSurfaceMetGan, SolarMultiStepGan
from .solar_cc import SolarCC
from .surface import SurfaceSpatialMetModel

SPATIAL_FIRST_MODELS = (SpatialThenTemporalGan,
MultiStepSurfaceMetGan,
SPATIAL_FIRST_MODELS = (MultiStepSurfaceMetGan,
SolarMultiStepGan)
Loading