Skip to content

Commit 73bd5a2

Browse files
committed
updated schema
1 parent a7479a1 commit 73bd5a2

4 files changed

Lines changed: 103 additions & 40 deletions

File tree

config/config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ imputation:
3030
upper: 300000
3131
minimums:
3232
porosity_ratio: 0.1
33-
mean_depth_m: 800
33+
depth_m: 800
3434
reservoir_thickness_m: 10
3535
seal_thickness_m: 0
36-
permeability_mD: 0
36+
permeability_md: 0
3737
remove_w_remarks:
3838
surface_issues: False
3939
subsurface_issues: False
@@ -44,10 +44,10 @@ imputation:
4444
upper: 300000
4545
minimums:
4646
porosity_ratio: 0
47-
mean_depth_m: 800
47+
depth_m: 800
4848
reservoir_thickness_m: 10
4949
seal_thickness_m: 0
50-
permeability_mD: 0
50+
permeability_md: 0
5151
remove_w_remarks:
5252
surface_issues: False
5353
subsurface_issues: False
@@ -58,10 +58,10 @@ imputation:
5858
upper: 300000
5959
minimums:
6060
porosity_ratio: 0
61-
mean_depth_m: 800
61+
depth_m: 800
6262
reservoir_thickness_m: 10
6363
seal_thickness_m: 0
64-
permeability_mD: 0
64+
permeability_md: 0
6565
remove_w_remarks:
6666
surface_issues: False
6767
subsurface_issues: False

workflow/Snakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ configfile: workflow.source_path("../config/config.yaml")
1010

1111

1212
# Validate the configuration using the schema file.
13-
# validate(config, workflow.source_path("internal/config.schema.yaml"))
13+
validate(config, workflow.source_path("internal/config.schema.yaml"))
1414

1515
# Load internal settings separately so users cannot modify them.
1616
with open(workflow.source_path("internal/settings.yaml"), "r") as f:

workflow/internal/config.schema.yaml

Lines changed: 94 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ $defs:
1111
- type: string
1212
- type: integer
1313

14-
nonNegativeInteger:
15-
type: integer
14+
nonNegativeNumber:
15+
type: number
1616
minimum: 0
1717

1818
boundsMtco2:
@@ -22,50 +22,60 @@ $defs:
2222
required: [lower, upper]
2323
properties:
2424
lower:
25-
$ref: "#/$defs/nonNegativeInteger"
25+
$ref: "#/$defs/nonNegativeNumber"
2626
upper:
27-
$ref: "#/$defs/nonNegativeInteger"
27+
$ref: "#/$defs/nonNegativeNumber"
2828

29-
properties:
30-
crs:
31-
description: "CRS values to use during projections."
29+
aggregatedConfig:
30+
description: "Settings for each aggregated CDR group."
3231
type: object
3332
additionalProperties: false
34-
required: [geographic, projected]
33+
required: [bounds_mtco2]
3534
properties:
36-
geographic:
37-
description: "Geographic CRS (for lat/lon operations)."
38-
allOf:
39-
- $ref: "#/$defs/crsValue"
40-
projected:
41-
description: "Projected CRS (for area operations)."
35+
bounds_mtco2:
36+
description: "These bounds will be applied to each shape_id case after aggregation."
4237
allOf:
43-
- $ref: "#/$defs/crsValue"
38+
- $ref: "#/$defs/boundsMtco2"
4439

45-
imputation:
46-
description: "These settings alter how data is processed."
40+
co2stopConfig:
41+
description: "Settings for each CDR group in the CO2Stop dataset."
4742
type: object
4843
additionalProperties: false
49-
required: [filter, bounds_mtco2]
44+
required: [bounds_mtco2, minimums, remove_w_remarks]
5045
properties:
5146
bounds_mtco2:
47+
description: "These bounds will be applied to each row in the CO2Stop dataset."
48+
allOf:
49+
- $ref: "#/$defs/boundsMtco2"
50+
minimums:
5251
description: |
53-
Lower and upper bounds for the CO2Stop polygons.
54-
These are applied before aggregation.
52+
Minimum values for key reservoir attributes. Cases below them will be dropped.
53+
IMPORTANT: CO2Stop uses '0' for missing values, making NaN and actual 0 indistinguishable.
54+
Some of these settings may result in a lot of removed data due to this dataset limitation!
5555
type: object
56-
required: [co2stop_polygons, aggregated_polygons]
56+
additionalProperties: false
57+
required: [porosity_ratio, depth_m, reservoir_thickness_m, seal_thickness_m, permeability_md]
5758
properties:
58-
co2stop_polygons:
59-
description: "These bounds will be applied to each row in the CO2Stop dataset."
60-
allOf:
61-
- $ref: "#/$defs/boundsMtco2"
62-
aggregated_polygons:
63-
description: "These bounds will be applied to each shape requested for aggregation."
64-
allOf:
65-
- $ref: "#/$defs/boundsMtco2"
66-
filter:
59+
porosity_ratio:
60+
description: Minimum mean porosity ratio
61+
type: number
62+
minimum: 0
63+
maximum: 1
64+
depth_m:
65+
description: Minimum mean depth in metres
66+
$ref: "#/$defs/nonNegativeNumber"
67+
reservoir_thickness_m:
68+
description: Minimum mean reservoir thickness in metres
69+
$ref: "#/$defs/nonNegativeNumber"
70+
seal_thickness_m:
71+
description: Minimum seal thickness in metres
72+
$ref: "#/$defs/nonNegativeNumber"
73+
permeability_md:
74+
description: Permeability in millidarcy (md)
75+
$ref: "#/$defs/nonNegativeNumber"
76+
remove_w_remarks:
6777
description: |
68-
If enabled, these will remove CO2Stop polygons in certain cases.
78+
Remove CO2Stop polygons in certain cases.
6979
Note that CO2Stop settings and comments are the only thing used for these filters.
7080
Quality may vary due to the inconsistent nature of the dataset.
7181
type: object
@@ -83,3 +93,56 @@ properties:
8393
These are cases where the authors state that polygons do not reflect the actual extent of storage.
8494
RECOMMENDED TO LEAVE AS 'True'.
8595
type: boolean
96+
97+
properties:
98+
crs:
99+
description: "CRS values to use during projections."
100+
type: object
101+
additionalProperties: false
102+
required: [geographic, projected]
103+
properties:
104+
geographic:
105+
description: "Geographic CRS (for lat/lon operations)."
106+
allOf:
107+
- $ref: "#/$defs/crsValue"
108+
projected:
109+
description: "Projected CRS (for area operations)."
110+
allOf:
111+
- $ref: "#/$defs/crsValue"
112+
113+
imputation:
114+
description: "These settings alter how data is processed."
115+
type: object
116+
additionalProperties: false
117+
required: [aggregated, co2stop]
118+
properties:
119+
aggregated:
120+
description: Settings applied after aggregating to the provided shapes file.
121+
type: object
122+
additionalProperties: false
123+
required: [aquifer, gas, oil]
124+
properties:
125+
aquifer:
126+
allOf:
127+
- $ref: "#/$defs/aggregatedConfig"
128+
gas:
129+
allOf:
130+
- $ref: "#/$defs/aggregatedConfig"
131+
oil:
132+
allOf:
133+
- $ref: "#/$defs/aggregatedConfig"
134+
co2stop:
135+
description: Settings applied while preparing / standardising the CO2Stop dataset.
136+
type: object
137+
additionalProperties: false
138+
required: [aquifer, gas, oil]
139+
properties:
140+
aquifer:
141+
allOf:
142+
- $ref: "#/$defs/co2stopConfig"
143+
gas:
144+
allOf:
145+
- $ref: "#/$defs/co2stopConfig"
146+
oil:
147+
allOf:
148+
- $ref: "#/$defs/co2stopConfig"

workflow/scripts/prepare_co2stop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
# Translate readable config names to CO2Stop columns
2626
MINIMUMS_CO2STOP = {
2727
"porosity_ratio": "POROSITY_MEAN",
28-
"mean_depth_m": "DEPTH_MEAN",
28+
"depth_m": "DEPTH_MEAN",
2929
"reservoir_thickness_m": "GROSS_THICK_MEAN",
3030
"seal_thickness_m": "MIN_SEAL_THICK",
31-
"permeability_mD": "PERM_MEAN"
31+
"permeability_md": "PERM_MEAN"
3232
}
3333

3434

0 commit comments

Comments
 (0)