GFDRR / rdl-data

Challenge Fund Database combining Hazard, Exposure, Loss and Vulnerability schema into a single database
GNU Affero General Public License v3.0
1 stars 2 forks source link

Optimise ENUM types across schema #30

Closed matamadio closed 3 years ago

matamadio commented 3 years ago

Most relevant from H schema: calc_method_enum

Current value Should be
INF Inferred
SIM Simulated
OBS Obeserved

mover.an_analysis_type_enum mover.em_analysis_type_enum mover.jd_analysis_type_enum mover.f_math_enum mover.f_mathtype_enum mover.dm_scale_ty_enum mover.im_method_enum mover.nonsampling_err_enum

The _mover.damage_states_all_enum_ includes many of overlapping and repeated definitions. I did cut down to 32, split into coherent blocks, which is still a lot. Suggest to simplify more.

Current _mover.damage_states_allenum

No damage
Light damage
Minor damage
Moderate damage
Major damage
Heavy damage
Complete damage

None
None to Slight
Negligible to Slight
Slight
Light
Moderate
Severe
Substantial to Heavy
Heavy
Very Heavy
Extensive
Destruction
Complete

Partial collapse
Collapse
Collapse prevention
Near Collapse
Collapsed
Washed away

Operational
Fully Operational

Immediate Occupancy
Life safety
Production loss
Not applicable

Suggested _mover.damage_states_allenum

No damage
Minor damage
Moderate damage
Major damage
Heavy damage
Destruction
matamadio commented 3 years ago

Review schema and optimisation

matamadio commented 3 years ago

The common.imt table has 60 entries (most for EQ), but some of them are duplicated, e.g. "water depth: m" is the same unit for river floods, pluvial floods, storm surge. Suggest to group the units by primary hazard, since they apply the same to processes, to reduce the size of the enum.