Skip to content

Commit 5a72e74

Browse files
authored
Merge pull request #249 from ClimateImpactLab/clean_dscim
Clean dscim. Remove outdated scripts and functions.
2 parents 5d96a00 + f16b308 commit 5a72e74

File tree

13 files changed

+16
-916
lines changed

13 files changed

+16
-916
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Removed
10+
11+
- Removed [`preprocessing/climate`](https://github.com/ClimateImpactLab/dscim/tree/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/preprocessing/climate) and [`preprocessing/misc`](https://github.com/ClimateImpactLab/dscim/tree/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/preprocessing/misc) subpackages. ([PR #249](https://github.com/ClimateImpactLab/dscim/pull/249), [@JMGilbert](https://github.com/JMGilbert))
12+
- The modules in these subpackages referenced hard coded filepaths and were used for old versions of climate files and inputs that are now properly formatted by default
13+
- Removed [`utils/generate_yaml`](https://github.com/ClimateImpactLab/dscim/blob/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/utils/generate_yaml.py) and [`utils/plotting_utils`](https://github.com/ClimateImpactLab/dscim/blob/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/utils/plotting_utils.py) modules. ([PR #249](https://github.com/ClimateImpactLab/dscim/pull/249), [@JMGilbert](https://github.com/JMGilbert))
14+
- `generate_yaml` seems to have been designed for an old version of `dscim-epa` and that functionality has now been transferred to the `scripts/directory_setup.py` script in the `dscim-epa` and `dscim-facts-epa` repositories
15+
- `plotting utils` was only in use for a single diagnostic and was transferred to the script that generated that diagnostic
16+
- Removed `midprocessing` [`update_damage_function_library`](https://github.com/ClimateImpactLab/dscim/blob/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/preprocessing/midprocessing.py#L8-L26) and `utils` [`constant_equivalent_discount_rate`](https://github.com/ClimateImpactLab/dscim/blob/main/src/dscim/utils/functions.py#L25-L61), [`calculate_constant_equivalent_discount_rate`](https://github.com/ClimateImpactLab/dscim/blob/main/src/dscim/utils/functions.py#L64-L142), and [`get_model_weights`](https://github.com/ClimateImpactLab/dscim/blob/main/src/dscim/utils/functions.py#L145-L216) functions. ([PR #249](https://github.com/ClimateImpactLab/dscim/pull/249), [@JMGilbert](https://github.com/JMGilbert))
17+
- `update_damage_function_library` was previously used to move files prior to the functionality that directly saved files into the appropriate location
18+
- `constant_equivalent_discount_rate` and `calculate_constant_equivalent_discount_rate` are used for integration paper tables, and have been transferred to the appropriate scripts
19+
- `get_model_weights` is used for a few diagnostics and has been transferred to the appropriate scripts
20+
21+
922
## [0.6.0] - 2024-04-24
1023

1124
### Added

src/dscim/preprocessing/climate/all_masks_rff.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/dscim/preprocessing/climate/ssp_clipped_rff.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/dscim/preprocessing/climate/stack_iterations.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/dscim/preprocessing/climate/stack_masks.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/dscim/preprocessing/input_damages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def calculate_labor_batch_damages(batch, ec, input_path, save_path):
290290

291291

292292
def calculate_labor_damages(
293-
path_econ="/shares/gcp/integration/float32/dscim_input_data/econvars/zarrs/integration-econ-bc39.zarr",
294-
input_path="/shares/gcp/outputs/labor/impacts-woodwork/mc_correct_rebasing_for_integration",
295-
save_path="/shares/gcp/integration/float32/input_data_histclim/labor_data/replication/",
293+
path_econ,
294+
input_path,
295+
save_path,
296296
):
297297
ec = EconVars(path_econ)
298298
# process in 3 rounds to limit memory usage

src/dscim/preprocessing/midprocessing.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
import os
2-
import shutil
32

43
USER = os.getenv("USER")
54
import xarray as xr
65

76

8-
def update_damage_function_library(
9-
input,
10-
output,
11-
recipe,
12-
disc,
13-
eta,
14-
rho,
15-
fit=True,
16-
):
17-
os.makedirs(output, exist_ok=True)
18-
shutil.copy2(
19-
f"{input}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_coefficients.nc4",
20-
output,
21-
)
22-
23-
if fit:
24-
shutil.copy2(
25-
f"{input}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_fit.nc4", output
26-
)
27-
28-
297
def combine_CAMEL_coefs(
308
recipe,
319
disc,

src/dscim/preprocessing/misc/bottom_code_econ_zarr.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)