igm-model 2.2.3__tar.gz → 3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- igm_model-3.0.1/MANIFEST.in +3 -0
- igm_model-3.0.1/PKG-INFO +47 -0
- igm_model-3.0.1/README.md +12 -0
- igm_model-3.0.1/igm/__init__.py +9 -0
- igm_model-3.0.1/igm/common/__init__.py +18 -0
- igm_model-3.0.1/igm/common/core/__init__.py +1 -0
- igm_model-3.0.1/igm/common/core/src.py +20 -0
- igm_model-3.0.1/igm/common/runner/__init__.py +8 -0
- igm_model-3.0.1/igm/common/runner/configuration/__init__.py +2 -0
- igm_model-3.0.1/igm/common/runner/configuration/loader.py +44 -0
- igm_model-3.0.1/igm/common/runner/configuration/utils.py +86 -0
- igm_model-3.0.1/igm/common/runner/modules/__init__.py +1 -0
- igm_model-3.0.1/igm/common/runner/modules/loader.py +182 -0
- igm_model-3.0.1/igm/common/runner/modules/src.py +61 -0
- igm_model-3.0.1/igm/common/runner/modules/utils.py +34 -0
- igm_model-3.0.1/igm/common/runner/modules/validator.py +9 -0
- igm_model-3.0.1/igm/common/utilities/__init__.py +6 -0
- igm_model-3.0.1/igm/common/utilities/misc.py +56 -0
- igm_model-3.0.1/igm/common/utilities/printers.py +95 -0
- igm_model-3.0.1/igm/common/utilities/visualizers.py +95 -0
- {igm_model-2.2.3/tests/test_iceflow → igm_model-3.0.1/igm/conf}/__init__.py +0 -0
- igm_model-3.0.1/igm/conf/config.yaml +23 -0
- igm_model-3.0.1/igm/conf/core.yaml +31 -0
- igm_model-3.0.1/igm/conf/inputs/load_ncdf.yaml +12 -0
- igm_model-3.0.1/igm/conf/inputs/load_tif.yaml +10 -0
- igm_model-3.0.1/igm/conf/inputs/local.yaml +15 -0
- igm_model-3.0.1/igm/conf/inputs/oggm_shop.yaml +15 -0
- igm_model-3.0.1/igm/conf/outputs/local.yaml +15 -0
- igm_model-3.0.1/igm/conf/outputs/plot2d.yaml +6 -0
- igm_model-3.0.1/igm/conf/outputs/write_ncdf.yaml +12 -0
- igm_model-3.0.1/igm/conf/outputs/write_tif.yaml +4 -0
- igm_model-3.0.1/igm/conf/outputs/write_ts.yaml +2 -0
- igm_model-3.0.1/igm/conf/outputs/write_vtp.yaml +5 -0
- igm_model-3.0.1/igm/conf/processes/avalanche.yaml +4 -0
- igm_model-3.0.1/igm/conf/processes/clim_glacialindex.yaml +8 -0
- igm_model-3.0.1/igm/conf/processes/clim_oggm.yaml +9 -0
- igm_model-3.0.1/igm/conf/processes/clim_station.yaml +59 -0
- igm_model-3.0.1/igm/conf/processes/damage.yaml +9 -0
- igm_model-3.0.1/igm/conf/processes/data_assimilation.yaml +74 -0
- igm_model-3.0.1/igm/conf/processes/enthalpy.yaml +23 -0
- igm_model-3.0.1/igm/conf/processes/flow_accumulation.yaml +2 -0
- igm_model-3.0.1/igm/conf/processes/gflex.yaml +6 -0
- igm_model-3.0.1/igm/conf/processes/glerosion.yaml +4 -0
- igm_model-3.0.1/igm/conf/processes/iceflow.yaml +72 -0
- igm_model-3.0.1/igm/conf/processes/particles.yaml +36 -0
- igm_model-3.0.1/igm/conf/processes/pretraining.yaml +13 -0
- igm_model-3.0.1/igm/conf/processes/read_output.yaml +7 -0
- igm_model-3.0.1/igm/conf/processes/rockflow.yaml +2 -0
- igm_model-3.0.1/igm/conf/processes/smb_accpdd.yaml +11 -0
- igm_model-3.0.1/igm/conf/processes/smb_oggm.yaml +5 -0
- igm_model-3.0.1/igm/conf/processes/smb_simple.yaml +4 -0
- igm_model-3.0.1/igm/conf/processes/stress.yaml +2 -0
- igm_model-3.0.1/igm/conf/processes/texture.yaml +6 -0
- igm_model-3.0.1/igm/conf/processes/thk.yaml +5 -0
- igm_model-3.0.1/igm/conf/processes/time.yaml +6 -0
- igm_model-3.0.1/igm/conf/processes/vert_flow.yaml +3 -0
- igm_model-3.0.1/igm/conf_help/core.yaml +83 -0
- igm_model-3.0.1/igm/conf_help/header.yaml +3 -0
- igm_model-3.0.1/igm/conf_help/inputs/load_ncdf.yaml +44 -0
- igm_model-3.0.1/igm/conf_help/inputs/load_tif.yaml +36 -0
- igm_model-3.0.1/igm/conf_help/inputs/local.yaml +50 -0
- igm_model-3.0.1/igm/conf_help/inputs/oggm_shop.yaml +56 -0
- igm_model-3.0.1/igm/conf_help/outputs/local.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/outputs/plot2d.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/outputs/write_ncdf.yaml +8 -0
- igm_model-3.0.1/igm/conf_help/outputs/write_tif.yaml +4 -0
- igm_model-3.0.1/igm/conf_help/outputs/write_ts.yaml +4 -0
- igm_model-3.0.1/igm/conf_help/outputs/write_vtp.yaml +4 -0
- igm_model-3.0.1/igm/conf_help/processes/avalanche.yaml +12 -0
- igm_model-3.0.1/igm/conf_help/processes/clim_glacialindex.yaml +28 -0
- igm_model-3.0.1/igm/conf_help/processes/clim_oggm.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/processes/damage.yaml +32 -0
- igm_model-3.0.1/igm/conf_help/processes/data_assimilation.yaml +206 -0
- igm_model-3.0.1/igm/conf_help/processes/enthalpy.yaml +88 -0
- igm_model-3.0.1/igm/conf_help/processes/flow_accumulation.yaml +4 -0
- igm_model-3.0.1/igm/conf_help/processes/gflex.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/processes/glerosion.yaml +12 -0
- igm_model-3.0.1/igm/conf_help/processes/iceflow.yaml +236 -0
- igm_model-3.0.1/igm/conf_help/processes/particles.yaml +52 -0
- igm_model-3.0.1/igm/conf_help/processes/pretraining.yaml +48 -0
- igm_model-3.0.1/igm/conf_help/processes/read_output.yaml +24 -0
- igm_model-3.0.1/igm/conf_help/processes/rockflow.yaml +4 -0
- igm_model-3.0.1/igm/conf_help/processes/smb_accpdd.yaml +40 -0
- igm_model-3.0.1/igm/conf_help/processes/smb_oggm.yaml +16 -0
- igm_model-3.0.1/igm/conf_help/processes/smb_simple.yaml +12 -0
- igm_model-3.0.1/igm/conf_help/processes/texture.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/processes/thk.yaml +12 -0
- igm_model-3.0.1/igm/conf_help/processes/time.yaml +20 -0
- igm_model-3.0.1/igm/conf_help/processes/vert_flow.yaml +8 -0
- igm_model-3.0.1/igm/igm_run.py +125 -0
- igm_model-3.0.1/igm/inputs/__init__.py +6 -0
- igm_model-3.0.1/igm/inputs/complete_data.py +38 -0
- {igm_model-2.2.3/igm/modules/preproc/include_icemask → igm_model-3.0.1/igm/inputs}/include_icemask.py +3 -29
- igm_model-3.0.1/igm/inputs/load_ncdf.py +97 -0
- igm_model-3.0.1/igm/inputs/load_tif.py +73 -0
- igm_model-3.0.1/igm/inputs/local.py +117 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/__init__.py +1 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/arrange_data.py +90 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/make_input_file.py +54 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/masks_subentities.py +60 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/oggm_shop.py +56 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/oggm_util.py +167 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/open_gridded_data.py +47 -0
- igm_model-3.0.1/igm/inputs/oggm_shop/read_glathida.py +124 -0
- {igm_model-2.2.3 → igm_model-3.0.1}/igm/instructed_oggm.py +9 -20
- igm_model-3.0.1/igm/outputs/__init__.py +8 -0
- igm_model-3.0.1/igm/outputs/local.py +206 -0
- igm_model-3.0.1/igm/outputs/plot2d.py +93 -0
- {igm_model-2.2.3/igm/modules/postproc/write_ncdf → igm_model-3.0.1/igm/outputs}/write_ncdf.py +26 -70
- {igm_model-2.2.3/igm/modules/postproc/write_tif → igm_model-3.0.1/igm/outputs}/write_tif.py +4 -22
- {igm_model-2.2.3/igm/modules/postproc/write_ts → igm_model-3.0.1/igm/outputs}/write_ts.py +5 -18
- igm_model-3.0.1/igm/outputs/write_vtp.py +119 -0
- igm_model-3.0.1/igm/processes/__init__.py +4 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/avalanche/__init__.py +0 -1
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/avalanche/avalanche.py +25 -44
- igm_model-3.0.1/igm/processes/clim_glacialindex/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/clim_glacialindex/clim_glacialindex.py +267 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/clim_oggm/__init__.py +0 -1
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/clim_oggm/clim_oggm.py +40 -83
- {igm_model-2.2.3/tests/test_vert_flow → igm_model-3.0.1/igm/processes/clim_station}/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/clim_station/clim_station.py +181 -0
- igm_model-3.0.1/igm/processes/damage/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/damage/damage.py +86 -0
- igm_model-3.0.1/igm/processes/data_assimilation/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cook/__init__.py +0 -0
- igm_model-2.2.3/igm/modules/process/iceflow/optimize_params_cook.py → igm_model-3.0.1/igm/processes/data_assimilation/cook/infer_params_cook.py +3 -3
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/cost_divfluxfcz.py +39 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/cost_divfluxobs.py +29 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/cost_vol.py +21 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/misfit_thk.py +16 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/misfit_usurf.py +18 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/misfit_velsurf.py +30 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/misfit_vol.py +14 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/regu_arrhenius.py +28 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/regu_slidingco.py +53 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/regu_thk.py +163 -0
- igm_model-3.0.1/igm/processes/data_assimilation/cost_terms/total_cost.py +75 -0
- igm_model-3.0.1/igm/processes/data_assimilation/data_assimilation.py +80 -0
- igm_model-3.0.1/igm/processes/data_assimilation/optimize/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/data_assimilation/optimize/initialize.py +69 -0
- igm_model-3.0.1/igm/processes/data_assimilation/optimize/update.py +114 -0
- igm_model-3.0.1/igm/processes/data_assimilation/optimize/update_lbfgs.py +76 -0
- igm_model-3.0.1/igm/processes/data_assimilation/outputs/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/data_assimilation/outputs/output_ncdf.py +124 -0
- igm_model-2.2.3/igm/modules/process/iceflow/optimize_outputs.py → igm_model-3.0.1/igm/processes/data_assimilation/outputs/plots.py +54 -165
- igm_model-3.0.1/igm/processes/data_assimilation/outputs/prints.py +82 -0
- igm_model-3.0.1/igm/processes/data_assimilation/outputs/write_vtp.py +47 -0
- igm_model-3.0.1/igm/processes/data_assimilation/utils.py +254 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/enthalpy/__init__.py +0 -1
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/enthalpy/enthalpy.py +192 -307
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/arrhenius_from_temp.py +45 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/compute_drainage_function.py +40 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/compute_sliding_co_tf.py +100 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/compute_sliding_co_tillwat_2.py +100 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/plot_tauc.py +40 -0
- igm_model-3.0.1/igm/processes/enthalpy/tests_formulas/test-TMDA.py +27 -0
- igm_model-3.0.1/igm/processes/flow_accumulation/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/flow_accumulation/flow_accumulation.py +82 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/gflex/__init__.py +0 -1
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/gflex/gflex.py +19 -57
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/glerosion/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/glerosion/glerosion.py +43 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/iceflow/__init__.py +2 -1
- igm_model-3.0.1/igm/processes/iceflow/diagnostic/__init__.py +1 -0
- igm_model-3.0.1/igm/processes/iceflow/diagnostic/diagnostic.py +87 -0
- igm_model-3.0.1/igm/processes/iceflow/emulate/__init__.py +1 -0
- igm_model-3.0.1/igm/processes/iceflow/emulate/emulate.py +361 -0
- igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_5_4_cnn_16_32_2_1_e/model.h5 +0 -0
- igm_model-3.0.1/igm/processes/iceflow/emulate/neural_network.py +94 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/__init__.py +4 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/cost_floating.py +111 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/cost_gravity.py +70 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/cost_shear.py +213 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/cost_sliding_weertman.py +43 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/energy.py +30 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/sliding_laws/__init__.py +2 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/sliding_laws/sliding_law.py +32 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/sliding_laws/weertman.py +34 -0
- igm_model-3.0.1/igm/processes/iceflow/energy/utils.py +100 -0
- igm_model-3.0.1/igm/processes/iceflow/iceflow.py +122 -0
- igm_model-3.0.1/igm/processes/iceflow/solve/__init__.py +1 -0
- igm_model-3.0.1/igm/processes/iceflow/solve/solve.py +188 -0
- igm_model-3.0.1/igm/processes/iceflow/utils.py +204 -0
- igm_model-3.0.1/igm/processes/iceflow/vert_disc.py +47 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/particles/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/particles/particles.py +76 -0
- igm_model-3.0.1/igm/processes/particles/remove_particles.py +27 -0
- igm_model-3.0.1/igm/processes/particles/seeding_particles.py +129 -0
- igm_model-3.0.1/igm/processes/particles/update_particles.py +114 -0
- igm_model-3.0.1/igm/processes/particles/utils.py +61 -0
- igm_model-3.0.1/igm/processes/particles/utils_cuda.py +37 -0
- igm_model-3.0.1/igm/processes/particles/utils_cupy.py +183 -0
- igm_model-3.0.1/igm/processes/particles/utils_interp.py +103 -0
- igm_model-3.0.1/igm/processes/particles/utils_tf.py +20 -0
- igm_model-3.0.1/igm/processes/particles/write_particle_cudf.py +114 -0
- igm_model-3.0.1/igm/processes/particles/write_particle_numpy.py +73 -0
- igm_model-3.0.1/igm/processes/pretraining/__init__.py +5 -0
- {igm_model-2.2.3/igm/modules/process/iceflow → igm_model-3.0.1/igm/processes/pretraining}/pretraining.py +142 -117
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/read_output/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/read_output/read_output.py +71 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/rockflow/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/rockflow/rockflow.py +39 -0
- igm_model-3.0.1/igm/processes/smb_accpdd/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/smb_accpdd/smb_accpdd.py +142 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/smb_oggm/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/smb_oggm/smb_oggm.py +86 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/smb_simple/__init__.py +0 -1
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/smb_simple/smb_simple.py +11 -38
- igm_model-3.0.1/igm/processes/stress/__init__.py +5 -0
- igm_model-3.0.1/igm/processes/stress/stress.py +211 -0
- igm_model-3.0.1/igm/processes/texture/__init__.py +1 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/pix2pixhd.py +8 -5
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/generator.py +151 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/layer_functions/__init__.py +0 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/layer_functions/bilinear_upsampling.py +18 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/layer_functions/reflection_pad2d.py +17 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/layer_functions/resnet_block.py +32 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/layer_functions/tanh.py +10 -0
- igm_model-3.0.1/igm/processes/texture/pix2pixhd_model_assets/loading.py +14 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/preparer.py +3 -3
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/texture.py +61 -70
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/thk/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/thk/thk.py +58 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/time/__init__.py +2 -2
- igm_model-3.0.1/igm/processes/time/time.py +75 -0
- {igm_model-2.2.3/igm/modules/process → igm_model-3.0.1/igm/processes}/vert_flow/__init__.py +0 -1
- igm_model-3.0.1/igm/processes/vert_flow/vert_flow.py +59 -0
- igm_model-3.0.1/igm/processes/vert_flow/vert_flow_legendre.py +31 -0
- igm_model-3.0.1/igm/processes/vert_flow/vert_flow_v1.py +95 -0
- igm_model-2.2.3/igm/modules/process/vert_flow/vert_flow.py → igm_model-3.0.1/igm/processes/vert_flow/vert_flow_v2.py +59 -54
- igm_model-3.0.1/igm/utils/__init__.py +0 -0
- igm_model-3.0.1/igm/utils/gradient/__init__.py +8 -0
- igm_model-3.0.1/igm/utils/gradient/compute_divflux.py +51 -0
- igm_model-3.0.1/igm/utils/gradient/compute_divflux_slope_limiter.py +65 -0
- igm_model-3.0.1/igm/utils/gradient/compute_gradient.py +48 -0
- igm_model-3.0.1/igm/utils/gradient/compute_gradient_stag.py +17 -0
- igm_model-3.0.1/igm/utils/gradient/compute_gradient_tf.py +37 -0
- igm_model-3.0.1/igm/utils/gradient/compute_upwind_gradient_tf.py +24 -0
- igm_model-3.0.1/igm/utils/math/__init__.py +7 -0
- igm_model-3.0.1/igm/utils/math/gaussian_filter_tf.py +17 -0
- igm_model-3.0.1/igm/utils/math/getmag.py +5 -0
- igm_model-3.0.1/igm/utils/math/getmag3d.py +12 -0
- igm_model-3.0.1/igm/utils/math/interp1d_tf.py +42 -0
- igm_model-3.0.1/igm/utils/math/interpolate_bilinear_tf.py +119 -0
- igm_model-3.0.1/igm/utils/optuna_hooks.py +8 -0
- igm_model-3.0.1/igm_model.egg-info/PKG-INFO +47 -0
- igm_model-3.0.1/igm_model.egg-info/SOURCES.txt +305 -0
- {igm_model-2.2.3 → igm_model-3.0.1}/igm_model.egg-info/entry_points.txt +0 -1
- {igm_model-2.2.3 → igm_model-3.0.1}/igm_model.egg-info/requires.txt +3 -0
- igm_model-3.0.1/igm_model.egg-info/top_level.txt +1 -0
- {igm_model-2.2.3 → igm_model-3.0.1}/setup.py +7 -4
- igm_model-2.2.3/PKG-INFO +0 -65
- igm_model-2.2.3/README.md +0 -31
- igm_model-2.2.3/igm/__init__.py +0 -29
- igm_model-2.2.3/igm/common.py +0 -453
- igm_model-2.2.3/igm/emulators/f15_cfsflow_GJ_22_a/README.md +0 -26
- igm_model-2.2.3/igm/igm_help.py +0 -30
- igm_model-2.2.3/igm/igm_run.py +0 -54
- igm_model-2.2.3/igm/modules/__init__.py +0 -10
- igm_model-2.2.3/igm/modules/postproc/__init__.py +0 -5
- igm_model-2.2.3/igm/modules/postproc/anim_mayavi/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/anim_mayavi/anim_mayavi.py +0 -96
- igm_model-2.2.3/igm/modules/postproc/anim_plotly/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/anim_plotly/anim_plotly.py +0 -320
- igm_model-2.2.3/igm/modules/postproc/anim_video/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/anim_video/anim_video.py +0 -66
- igm_model-2.2.3/igm/modules/postproc/plot2d/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/plot2d/plot2d.py +0 -138
- igm_model-2.2.3/igm/modules/postproc/print_comp/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/print_comp/print_comp.py +0 -176
- igm_model-2.2.3/igm/modules/postproc/print_info/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/print_info/print_info.py +0 -65
- igm_model-2.2.3/igm/modules/postproc/texture/__init__.py +0 -1
- igm_model-2.2.3/igm/modules/postproc/write_ncdf/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/write_particles/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/write_particles/write_particles.py +0 -96
- igm_model-2.2.3/igm/modules/postproc/write_tif/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/postproc/write_ts/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/__init__.py +0 -24
- igm_model-2.2.3/igm/modules/preproc/include_icemask/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/infersmb/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/infersmb/infersmb.py +0 -53
- igm_model-2.2.3/igm/modules/preproc/load_ncdf/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/load_ncdf/load_ncdf.py +0 -154
- igm_model-2.2.3/igm/modules/preproc/load_tif/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/load_tif/load_tif.py +0 -125
- igm_model-2.2.3/igm/modules/preproc/oggm_shop/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/oggm_shop/oggm_shop.py +0 -677
- igm_model-2.2.3/igm/modules/preproc/optimize_v1/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/preproc/optimize_v1/optimize_v1.py +0 -1140
- igm_model-2.2.3/igm/modules/process/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/process/flow_dt_thk/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/process/flow_dt_thk/flow_dt_thk.py +0 -32
- igm_model-2.2.3/igm/modules/process/glerosion/glerosion.py +0 -68
- igm_model-2.2.3/igm/modules/process/iceflow/diagnostic.py +0 -60
- igm_model-2.2.3/igm/modules/process/iceflow/emulate.py +0 -325
- igm_model-2.2.3/igm/modules/process/iceflow/energy_iceflow.py +0 -416
- igm_model-2.2.3/igm/modules/process/iceflow/iceflow.py +0 -132
- igm_model-2.2.3/igm/modules/process/iceflow/neural_network.py +0 -70
- igm_model-2.2.3/igm/modules/process/iceflow/optimize.py +0 -691
- igm_model-2.2.3/igm/modules/process/iceflow/params_iceflow.py +0 -332
- igm_model-2.2.3/igm/modules/process/iceflow/params_optimize.py +0 -267
- igm_model-2.2.3/igm/modules/process/iceflow/params_pretraining.py +0 -80
- igm_model-2.2.3/igm/modules/process/iceflow/solve.py +0 -151
- igm_model-2.2.3/igm/modules/process/iceflow/utils.py +0 -67
- igm_model-2.2.3/igm/modules/process/iceflow_v1/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/process/iceflow_v1/iceflow_v1.py +0 -192
- igm_model-2.2.3/igm/modules/process/particles/particles.py +0 -289
- igm_model-2.2.3/igm/modules/process/particles_v1/__init__.py +0 -6
- igm_model-2.2.3/igm/modules/process/particles_v1/particles_v1.py +0 -266
- igm_model-2.2.3/igm/modules/process/read_output/read_output.py +0 -99
- igm_model-2.2.3/igm/modules/process/rockflow/rockflow.py +0 -48
- igm_model-2.2.3/igm/modules/process/smb_oggm/smb_oggm.py +0 -118
- igm_model-2.2.3/igm/modules/process/thk/thk.py +0 -79
- igm_model-2.2.3/igm/modules/process/time/time.py +0 -107
- igm_model-2.2.3/igm/modules/utils.py +0 -403
- igm_model-2.2.3/igm_model.egg-info/PKG-INFO +0 -65
- igm_model-2.2.3/igm_model.egg-info/SOURCES.txt +0 -176
- igm_model-2.2.3/igm_model.egg-info/top_level.txt +0 -2
- igm_model-2.2.3/tests/__init__.py +0 -3
- igm_model-2.2.3/tests/test_full_glacier_evolution_oggm_shop/__init__.py +0 -2
- igm_model-2.2.3/tests/test_full_glacier_evolution_oggm_shop/test_full_glacier_evolution_oggm_shop.py +0 -44
- igm_model-2.2.3/tests/test_full_glacier_evolution_synthetic/__init__.py +0 -2
- igm_model-2.2.3/tests/test_full_glacier_evolution_synthetic/make_synthetic.py +0 -42
- igm_model-2.2.3/tests/test_full_glacier_evolution_synthetic/test_full_glacier_evolution_synthetic.py +0 -43
- igm_model-2.2.3/tests/test_iceflow/test_iceflow.py +0 -39
- igm_model-2.2.3/tests/test_load_ncdf/__init__.py +0 -2
- igm_model-2.2.3/tests/test_load_ncdf/make_fake_ncdf.py +0 -43
- igm_model-2.2.3/tests/test_load_ncdf/test_load_ncdf.py +0 -39
- igm_model-2.2.3/tests/test_modules/__init__.py +0 -2
- igm_model-2.2.3/tests/test_modules/invalid_custom_module_folder/__init__.py +0 -6
- igm_model-2.2.3/tests/test_modules/invalid_custom_module_folder/invalid_custom_module.py +0 -27
- igm_model-2.2.3/tests/test_modules/missing_function_custom_module.py +0 -28
- igm_model-2.2.3/tests/test_modules/test_loading_modules.py +0 -24
- igm_model-2.2.3/tests/test_modules/valid_custom_module.py +0 -27
- igm_model-2.2.3/tests/test_modules/valid_custom_module_folder/__init__.py +0 -6
- igm_model-2.2.3/tests/test_modules/valid_custom_module_folder/valid_custom_module.py +0 -27
- igm_model-2.2.3/tests/test_optimize/__init__.py +0 -2
- igm_model-2.2.3/tests/test_optimize/test_optimize.py +0 -41
- igm_model-2.2.3/tests/test_params/test_params.py +0 -214
- igm_model-2.2.3/tests/test_vert_flow/test_vert_flow.py +0 -37
- {igm_model-2.2.3 → igm_model-3.0.1}/LICENSE +0 -0
- {igm_model-2.2.3/tests/test_params → igm_model-3.0.1/igm/conf_help}/__init__.py +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/100/fieldin.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/100/fieldout.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/100/model.h5 +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/200/fieldin.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/200/fieldout.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/200/model.h5 +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/50/fieldin.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/50/fieldout.dat +0 -0
- {igm_model-2.2.3/igm → igm_model-3.0.1/igm/processes/iceflow/emulate}/emulators/f15_cfsflow_GJ_22_a/50/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_16_3_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_16_3_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_16_3_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_0_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_0_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_0_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_2_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_0_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_0_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_0_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_16_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_16_32_3_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_2_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_2_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_2_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_3_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_3_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_16_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_16_3_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_0_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_0_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_0 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_0_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_cnn_8_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_cnn_8_32_2_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_unet_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_unet_16_32_2_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_unet_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_unet_16_32_2_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_10_4_unet_16_32_2_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_10_4_unet_16_32_2_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_30_4_cnn_12_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_30_4_cnn_12_32_3_1_a}/fieldin.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_30_4_cnn_12_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_30_4_cnn_12_32_3_1_a}/fieldout.dat +0 -0
- {igm_model-2.2.3/igm/emulators/pinnbp_30_4_cnn_12_32_3_1 → igm_model-3.0.1/igm/processes/iceflow/emulate/emulators/pinnbp_30_4_cnn_12_32_3_1_a}/model.h5 +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/constants.py +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/emulator.py +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/exporter.py +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/image_data.py +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/normalizer.py +0 -0
- {igm_model-2.2.3/igm/modules/postproc → igm_model-3.0.1/igm/processes}/texture/utils.py +0 -0
- {igm_model-2.2.3 → igm_model-3.0.1}/igm_model.egg-info/dependency_links.txt +0 -0
- {igm_model-2.2.3 → igm_model-3.0.1}/setup.cfg +0 -0
igm_model-3.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: igm-model
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: IGM - a glacier evolution model
|
|
5
|
+
Home-page: https://github.com/jouvetg/igm
|
|
6
|
+
Author: Guillaume Jouvet
|
|
7
|
+
Author-email: guillaume.jouvet@unil.ch
|
|
8
|
+
License: gpl-3.0
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: tensorflow[and-cuda]==2.15.1
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Requires-Dist: scipy
|
|
14
|
+
Requires-Dist: netCDF4==1.6.0
|
|
15
|
+
Requires-Dist: xarray
|
|
16
|
+
Requires-Dist: rasterio
|
|
17
|
+
Requires-Dist: pyproj
|
|
18
|
+
Requires-Dist: geopandas
|
|
19
|
+
Requires-Dist: oggm
|
|
20
|
+
Requires-Dist: salem
|
|
21
|
+
Requires-Dist: pyyaml
|
|
22
|
+
Requires-Dist: importlib_resources
|
|
23
|
+
Requires-Dist: tqdm
|
|
24
|
+
Requires-Dist: hydra-core
|
|
25
|
+
Requires-Dist: omegaconf
|
|
26
|
+
Dynamic: author
|
|
27
|
+
Dynamic: author-email
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: summary
|
|
35
|
+
|
|
36
|
+
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
37
|
+
### <h1 align="center" id="title">The Instructed Glacier Model (IGM) </h1>
|
|
38
|
+
|
|
39
|
+
<div align="center">
|
|
40
|
+
<img src="logo/logo_igm.svg" width="40%" alt="Alt text">
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
Source code of the Instructed Glacier Model (IGM).
|
|
44
|
+
|
|
45
|
+
Documentation (from version 3) : https://igm-model.org/
|
|
46
|
+
|
|
47
|
+
Documentation (up to version 2) : https://github.com/jouvetg/igm/wiki
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
2
|
+
### <h1 align="center" id="title">The Instructed Glacier Model (IGM) </h1>
|
|
3
|
+
|
|
4
|
+
<div align="center">
|
|
5
|
+
<img src="logo/logo_igm.svg" width="40%" alt="Alt text">
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
Source code of the Instructed Glacier Model (IGM).
|
|
9
|
+
|
|
10
|
+
Documentation (from version 3) : https://igm-model.org/
|
|
11
|
+
|
|
12
|
+
Documentation (up to version 2) : https://github.com/jouvetg/igm/wiki
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from .core import State
|
|
2
|
+
|
|
3
|
+
from .runner import (
|
|
4
|
+
initialize_modules,
|
|
5
|
+
update_modules,
|
|
6
|
+
finalize_modules,
|
|
7
|
+
setup_igm_modules,
|
|
8
|
+
check_incompatilities_in_parameters_file,
|
|
9
|
+
load_yaml_as_cfg,
|
|
10
|
+
EmptyClass
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
from .utilities import (
|
|
14
|
+
add_logger,
|
|
15
|
+
download_unzip_and_store,
|
|
16
|
+
print_comp,
|
|
17
|
+
print_gpu_info,
|
|
18
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .src import State, IGM_DESCRIPTION
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
IGM_DESCRIPTION = r"""
|
|
2
|
+
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
3
|
+
│ Welcome to IGM, a modular, open-source, fast, and user-friendly glacier evolution model! │
|
|
4
|
+
│ │
|
|
5
|
+
│ │
|
|
6
|
+
│ __/\\\\\\\\\\\_____/\\\\\\\\\\\\__/\\\\____________/\\\\_ │
|
|
7
|
+
│ _\/////\\\///____/\\\//////////__\/\\\\\\________/\\\\\\_ │
|
|
8
|
+
│ _____\/\\\______/\\\_____________\/\\\//\\\____/\\\//\\\_ │
|
|
9
|
+
│ _____\/\\\_____\/\\\____/\\\\\\\_\/\\\\///\\\/\\\/_\/\\\_ │
|
|
10
|
+
│ _____\/\\\_____\/\\\___\/////\\\_\/\\\__\///\\\/___\/\\\_ │
|
|
11
|
+
│ _____\/\\\_____\/\\\_______\/\\\_\/\\\____\///_____\/\\\_ │
|
|
12
|
+
│ _____\/\\\_____\/\\\_______\/\\\_\/\\\_____________\/\\\_ │
|
|
13
|
+
│ __/\\\\\\\\\\\_\//\\\\\\\\\\\\/__\/\\\_____________\/\\\_ │
|
|
14
|
+
│ _\///////////___\////////////____\///______________\///__ │
|
|
15
|
+
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class State:
|
|
20
|
+
pass
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import os, yaml
|
|
2
|
+
from omegaconf import OmegaConf
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def load_yaml_as_cfg(yaml_filename):
|
|
6
|
+
from .utils import DictToObj
|
|
7
|
+
|
|
8
|
+
script_dir = os.path.dirname(
|
|
9
|
+
os.path.abspath(__file__)
|
|
10
|
+
) # Get the script's directory
|
|
11
|
+
yaml_path = os.path.join(script_dir, yaml_filename) # Build the full path
|
|
12
|
+
|
|
13
|
+
with open(yaml_path, "r") as file:
|
|
14
|
+
yaml_dict = yaml.safe_load(file) # Load as dict
|
|
15
|
+
|
|
16
|
+
return DictToObj(yaml_dict) # Convert to object
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def load_yaml_recursive(base_dir):
|
|
20
|
+
config = {}
|
|
21
|
+
for root, _, files in os.walk(base_dir):
|
|
22
|
+
for file in files:
|
|
23
|
+
if file.endswith(".yaml") or file.endswith(".yml"):
|
|
24
|
+
full_path = os.path.join(root, file)
|
|
25
|
+
relative_path = os.path.relpath(full_path, base_dir)
|
|
26
|
+
keys = (
|
|
27
|
+
relative_path.replace(".yaml", "").replace(".yml", "").split(os.sep)
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# Load the YAML file
|
|
31
|
+
yaml_conf = OmegaConf.load(full_path)
|
|
32
|
+
|
|
33
|
+
# Nest it in the config dictionary
|
|
34
|
+
sub_conf = config
|
|
35
|
+
for key in keys[:-1]:
|
|
36
|
+
sub_conf = sub_conf.setdefault(key, {})
|
|
37
|
+
if keys[-1] in yaml_conf:
|
|
38
|
+
sub_conf[keys[-1]] = OmegaConf.merge(
|
|
39
|
+
sub_conf.get(keys[-1], {}), yaml_conf[keys[-1]]
|
|
40
|
+
)
|
|
41
|
+
else:
|
|
42
|
+
sub_conf[keys[-1]] = yaml_conf
|
|
43
|
+
|
|
44
|
+
return OmegaConf.create(config)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import igm
|
|
3
|
+
from omegaconf import OmegaConf
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from .loader import load_yaml_recursive
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class EmptyClass:
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DictToObj:
|
|
14
|
+
"""Recursively convert a dictionary to an object with attribute-style access."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, dictionary):
|
|
17
|
+
for key, value in dictionary.items():
|
|
18
|
+
if isinstance(value, dict):
|
|
19
|
+
setattr(self, key, DictToObj(value))
|
|
20
|
+
else:
|
|
21
|
+
setattr(self, key, value)
|
|
22
|
+
|
|
23
|
+
def __getitem__(self, key):
|
|
24
|
+
return getattr(self, key) # Allow dictionary-like access
|
|
25
|
+
|
|
26
|
+
def __repr__(self):
|
|
27
|
+
return str(self.__dict__)
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""Convert back to a dictionary."""
|
|
31
|
+
return {
|
|
32
|
+
key: value.to_dict() if isinstance(value, DictToObj) else value
|
|
33
|
+
for key, value in self.__dict__.items()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def check_incompatilities_in_parameters_file(cfg, path):
|
|
38
|
+
|
|
39
|
+
from difflib import get_close_matches
|
|
40
|
+
|
|
41
|
+
def flatten_dict(d, parent_key="", sep="."):
|
|
42
|
+
def recurse(obj, prefix):
|
|
43
|
+
if isinstance(obj, dict):
|
|
44
|
+
for k, v in obj.items():
|
|
45
|
+
yield from recurse(v, f"{prefix}{sep}{k}" if prefix else k)
|
|
46
|
+
elif isinstance(obj, list):
|
|
47
|
+
for i, item in enumerate(obj):
|
|
48
|
+
yield from recurse(item, f"{prefix}[{i}]")
|
|
49
|
+
else:
|
|
50
|
+
yield (prefix, obj)
|
|
51
|
+
|
|
52
|
+
return dict(recurse(d, parent_key))
|
|
53
|
+
|
|
54
|
+
def compare_configs(cfg, cfgo, path="", excluded_keys=["cwd", "config"]):
|
|
55
|
+
for key in cfg:
|
|
56
|
+
full_path = f"{path}.{key}" if path else key
|
|
57
|
+
if key not in excluded_keys:
|
|
58
|
+
if key not in cfgo:
|
|
59
|
+
# Get possible matches for the missing key
|
|
60
|
+
posskeys = flatten_dict(
|
|
61
|
+
OmegaConf.to_container(cfgo, resolve=False)
|
|
62
|
+
).keys()
|
|
63
|
+
suggestions = get_close_matches(key, posskeys, n=5, cutoff=0.2)
|
|
64
|
+
suggestions = [path + "." + s for s in suggestions]
|
|
65
|
+
suggestion_msg = (
|
|
66
|
+
f" Did you mean '{suggestions}'?" if suggestions else ""
|
|
67
|
+
)
|
|
68
|
+
raise ValueError(
|
|
69
|
+
f"Parameter '{full_path}' does not exist.\n {suggestion_msg}"
|
|
70
|
+
)
|
|
71
|
+
if OmegaConf.is_dict(cfg[key]):
|
|
72
|
+
if not OmegaConf.is_dict(cfgo[key]):
|
|
73
|
+
raise ValueError(
|
|
74
|
+
f"Configuration mismatch at '{full_path}': expected a dictionary-like config."
|
|
75
|
+
)
|
|
76
|
+
compare_configs(cfg[key], cfgo[key], full_path)
|
|
77
|
+
|
|
78
|
+
############################
|
|
79
|
+
|
|
80
|
+
cfgo = load_yaml_recursive(os.path.join(igm.__path__[0], "conf"))
|
|
81
|
+
|
|
82
|
+
addo = load_yaml_recursive(os.path.join(path, "user/conf"))
|
|
83
|
+
|
|
84
|
+
cfgo = OmegaConf.merge(cfgo, addo)
|
|
85
|
+
|
|
86
|
+
compare_configs(cfg, cfgo)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .src import initialize_modules, update_modules, finalize_modules, setup_igm_modules
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
# Copyright (C) 2021-2025 IGM authors
|
|
5
|
+
Published under the GNU GPL (Version 3), check at the LICENSE file
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import sys
|
|
9
|
+
import importlib
|
|
10
|
+
from typing import List, Tuple
|
|
11
|
+
from types import ModuleType
|
|
12
|
+
from hydra.core.hydra_config import HydraConfig
|
|
13
|
+
|
|
14
|
+
from .utils import get_module_name, get_orders
|
|
15
|
+
from .validator import validate_module
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def load_modules(
|
|
19
|
+
cfg, state
|
|
20
|
+
) -> Tuple[List[ModuleType], List[ModuleType], List[ModuleType]]:
|
|
21
|
+
"""Returns a list of actionable modules to then apply the update, initialize, finalize functions on for IGM."""
|
|
22
|
+
imported_input_modules = []
|
|
23
|
+
imported_modules = []
|
|
24
|
+
imported_output_modules = []
|
|
25
|
+
|
|
26
|
+
root_foldername = (
|
|
27
|
+
f"{HydraConfig.get().runtime.cwd}/{cfg.core.structure.root_foldername}"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# Add custom modules folder to sys.path
|
|
31
|
+
user_input_modules_folder = f"{root_foldername}/{cfg.core.structure.code_foldername}/{cfg.core.structure.input_modules_foldername}"
|
|
32
|
+
user_process_modules_folder = f"{root_foldername}/{cfg.core.structure.code_foldername}/{cfg.core.structure.process_modules_foldername}"
|
|
33
|
+
user_output_modules_folder = f"{root_foldername}/{cfg.core.structure.code_foldername}/{cfg.core.structure.output_modules_foldername}"
|
|
34
|
+
|
|
35
|
+
custom_modules_folders = [
|
|
36
|
+
user_input_modules_folder,
|
|
37
|
+
user_process_modules_folder,
|
|
38
|
+
user_output_modules_folder,
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
for folder in custom_modules_folders:
|
|
42
|
+
if folder not in sys.path:
|
|
43
|
+
sys.path.append(folder)
|
|
44
|
+
|
|
45
|
+
if "inputs" in cfg:
|
|
46
|
+
load_user_modules(
|
|
47
|
+
cfg=cfg,
|
|
48
|
+
state=state,
|
|
49
|
+
modules_list=cfg.inputs,
|
|
50
|
+
imported_modules_list=imported_input_modules,
|
|
51
|
+
module_folder=user_input_modules_folder,
|
|
52
|
+
)
|
|
53
|
+
load_modules_igm(
|
|
54
|
+
cfg=cfg,
|
|
55
|
+
state=state,
|
|
56
|
+
modules_list=cfg.inputs,
|
|
57
|
+
imported_modules_list=imported_input_modules,
|
|
58
|
+
module_type="inputs",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if "processes" in cfg:
|
|
62
|
+
load_user_modules(
|
|
63
|
+
cfg=cfg,
|
|
64
|
+
state=state,
|
|
65
|
+
modules_list=cfg.processes,
|
|
66
|
+
imported_modules_list=imported_modules,
|
|
67
|
+
module_folder=user_process_modules_folder,
|
|
68
|
+
)
|
|
69
|
+
load_modules_igm(
|
|
70
|
+
cfg=cfg,
|
|
71
|
+
state=state,
|
|
72
|
+
modules_list=cfg.processes,
|
|
73
|
+
imported_modules_list=imported_modules,
|
|
74
|
+
module_type="processes",
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
if "outputs" in cfg:
|
|
78
|
+
load_user_modules(
|
|
79
|
+
cfg=cfg,
|
|
80
|
+
state=state,
|
|
81
|
+
modules_list=cfg.outputs,
|
|
82
|
+
imported_modules_list=imported_output_modules,
|
|
83
|
+
module_folder=user_output_modules_folder,
|
|
84
|
+
)
|
|
85
|
+
load_modules_igm(
|
|
86
|
+
cfg=cfg,
|
|
87
|
+
state=state,
|
|
88
|
+
modules_list=cfg.outputs,
|
|
89
|
+
imported_modules_list=imported_output_modules,
|
|
90
|
+
module_type="outputs",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Reorder modules
|
|
94
|
+
input_order, module_order, output_order = get_orders()
|
|
95
|
+
|
|
96
|
+
input_order_dict = {name: index for index, name in enumerate(input_order)}
|
|
97
|
+
imported_input_modules = sorted(
|
|
98
|
+
imported_input_modules,
|
|
99
|
+
key=lambda module: input_order_dict[get_module_name(module)],
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
modules_order_dict = {name: index for index, name in enumerate(module_order)}
|
|
103
|
+
imported_modules = sorted(
|
|
104
|
+
imported_modules, key=lambda module: modules_order_dict[get_module_name(module)]
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
output_order_dict = {name: index for index, name in enumerate(output_order)}
|
|
108
|
+
imported_output_modules = sorted(
|
|
109
|
+
imported_output_modules,
|
|
110
|
+
key=lambda module: output_order_dict[get_module_name(module)],
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
if cfg.core.print_imported_modules:
|
|
114
|
+
print(f"{'':-^100}")
|
|
115
|
+
print(f"{'INPUTS Modules':-^100}")
|
|
116
|
+
for i, input_module in enumerate(imported_input_modules):
|
|
117
|
+
print(f" {i}: {input_module}")
|
|
118
|
+
print(f"{'PROCESSES Modules':-^100}")
|
|
119
|
+
for i, module in enumerate(imported_modules):
|
|
120
|
+
print(f" {i}: {module}")
|
|
121
|
+
print(f"{'OUTPUTS Modules':-^100}")
|
|
122
|
+
for i, output_module in enumerate(imported_output_modules):
|
|
123
|
+
print(f" {i}: {output_module}")
|
|
124
|
+
print(f"{'':-^100}")
|
|
125
|
+
|
|
126
|
+
return imported_input_modules, imported_modules, imported_output_modules
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def load_user_modules(
|
|
130
|
+
cfg, state, modules_list, imported_modules_list, module_folder
|
|
131
|
+
) -> List[ModuleType]:
|
|
132
|
+
|
|
133
|
+
from importlib.machinery import SourceFileLoader
|
|
134
|
+
|
|
135
|
+
for module_name in modules_list:
|
|
136
|
+
# Local Directory
|
|
137
|
+
try:
|
|
138
|
+
module = SourceFileLoader(
|
|
139
|
+
f"{module_name}", f".{module_name}.py"
|
|
140
|
+
).load_module()
|
|
141
|
+
except FileNotFoundError:
|
|
142
|
+
|
|
143
|
+
# User Modules Folder
|
|
144
|
+
try:
|
|
145
|
+
module = SourceFileLoader(
|
|
146
|
+
f"{module_name}", f"{module_folder}/{module_name}.py"
|
|
147
|
+
).load_module()
|
|
148
|
+
except FileNotFoundError:
|
|
149
|
+
# User Modules Folder Folder
|
|
150
|
+
try:
|
|
151
|
+
module = SourceFileLoader(
|
|
152
|
+
f"{module_name}",
|
|
153
|
+
f"{module_folder}/{module_name}/{module_name}.py",
|
|
154
|
+
).load_module()
|
|
155
|
+
except FileNotFoundError:
|
|
156
|
+
pass
|
|
157
|
+
else:
|
|
158
|
+
imported_modules_list.append(module)
|
|
159
|
+
else:
|
|
160
|
+
imported_modules_list.append(module)
|
|
161
|
+
else:
|
|
162
|
+
imported_modules_list.append(module)
|
|
163
|
+
|
|
164
|
+
return imported_modules_list
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def load_modules_igm(
|
|
168
|
+
cfg, state, modules_list, imported_modules_list, module_type
|
|
169
|
+
) -> List[ModuleType]:
|
|
170
|
+
|
|
171
|
+
from importlib.machinery import SourceFileLoader
|
|
172
|
+
|
|
173
|
+
imported_modules_names = [module.__name__ for module in imported_modules_list]
|
|
174
|
+
for module_name in modules_list:
|
|
175
|
+
if module_name in imported_modules_names:
|
|
176
|
+
continue
|
|
177
|
+
|
|
178
|
+
module_path = f"igm.{module_type}.{module_name}"
|
|
179
|
+
module = importlib.import_module(module_path)
|
|
180
|
+
if module_type == "processes":
|
|
181
|
+
validate_module(module)
|
|
182
|
+
imported_modules_list.append(module)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from typing import List, Any
|
|
2
|
+
from types import ModuleType
|
|
3
|
+
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from ...core import State
|
|
7
|
+
from ...utilities import print_info
|
|
8
|
+
from ..modules.loader import load_modules
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def initialize_modules(processes: List, cfg: Any, state: State) -> None:
|
|
12
|
+
for module in processes:
|
|
13
|
+
if cfg.core.logging:
|
|
14
|
+
state.logger.info(f"Initializing module: {module.__name__.split('.')[-1]}")
|
|
15
|
+
module.initialize(cfg, state)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def update_modules(processes: List, outputs: List, cfg: Any, state: State) -> None:
|
|
19
|
+
|
|
20
|
+
state.it = 0
|
|
21
|
+
state.continue_run = True
|
|
22
|
+
if cfg.core.print_comp:
|
|
23
|
+
state.tcomp = {
|
|
24
|
+
module.__name__.split(".")[-1]: [] for module in processes + outputs
|
|
25
|
+
}
|
|
26
|
+
while state.continue_run:
|
|
27
|
+
for module in processes:
|
|
28
|
+
m = module.__name__.split(".")[-1]
|
|
29
|
+
if cfg.core.print_comp:
|
|
30
|
+
state.tcomp[m].append(time.time())
|
|
31
|
+
module.update(cfg, state)
|
|
32
|
+
if cfg.core.print_comp:
|
|
33
|
+
state.tcomp[m][-1] -= time.time()
|
|
34
|
+
state.tcomp[m][-1] *= -1
|
|
35
|
+
run_outputs(outputs, cfg, state)
|
|
36
|
+
if cfg.core.print_info:
|
|
37
|
+
print_info(state)
|
|
38
|
+
state.it += 1
|
|
39
|
+
|
|
40
|
+
if not hasattr(state, "t"):
|
|
41
|
+
state.continue_run = False
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def finalize_modules(processes: List, cfg: Any, state: State) -> None:
|
|
45
|
+
for module in processes:
|
|
46
|
+
module.finalize(cfg, state)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def run_outputs(output_modules: List, cfg: Any, state: State) -> None:
|
|
50
|
+
for module in output_modules:
|
|
51
|
+
m = module.__name__.split(".")[-1]
|
|
52
|
+
if cfg.core.print_comp:
|
|
53
|
+
state.tcomp[m].append(time.time())
|
|
54
|
+
module.run(cfg, state)
|
|
55
|
+
if cfg.core.print_comp:
|
|
56
|
+
state.tcomp[m][-1] -= time.time()
|
|
57
|
+
state.tcomp[m][-1] *= -1
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def setup_igm_modules(cfg, state) -> List[ModuleType]:
|
|
61
|
+
return load_modules(cfg, state)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from hydra.core.hydra_config import HydraConfig
|
|
2
|
+
import yaml
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_orders():
|
|
6
|
+
config_path = [
|
|
7
|
+
path["path"]
|
|
8
|
+
for path in HydraConfig.get().runtime.config_sources
|
|
9
|
+
if path["schema"] == "file"
|
|
10
|
+
][0]
|
|
11
|
+
|
|
12
|
+
with open(
|
|
13
|
+
f"{config_path}/experiment/{HydraConfig.get().runtime.choices.experiment}.yaml",
|
|
14
|
+
"r",
|
|
15
|
+
) as file:
|
|
16
|
+
original_experiment_config = yaml.safe_load(file)
|
|
17
|
+
|
|
18
|
+
defaults = original_experiment_config["defaults"]
|
|
19
|
+
input_order = modules_order = output_order = []
|
|
20
|
+
for default in defaults:
|
|
21
|
+
|
|
22
|
+
key = list(default.keys())[0] # ? Cleaner / more robust way to do this?
|
|
23
|
+
if key == "override /inputs":
|
|
24
|
+
input_order = default[key]
|
|
25
|
+
elif key == "override /processes":
|
|
26
|
+
modules_order = default[key]
|
|
27
|
+
elif key == "override /outputs":
|
|
28
|
+
output_order = default[key]
|
|
29
|
+
|
|
30
|
+
return input_order, modules_order, output_order
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def get_module_name(module):
|
|
34
|
+
return module.__name__.split(".")[-1]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
def validate_module(module) -> None:
|
|
2
|
+
"""Validates that a module has the required functions to be used in IGM."""
|
|
3
|
+
required_functions = ["initialize", "finalize", "update"]
|
|
4
|
+
for function in required_functions:
|
|
5
|
+
if not hasattr(module, function):
|
|
6
|
+
raise AttributeError(
|
|
7
|
+
f"Module {module} is missing the required function ({function}). If it is a custom python package, make sure to include the 3 required functions: ['initialize', 'finalize', 'update'].",
|
|
8
|
+
f"Please see https://github.com/jouvetg/igm/wiki/5.-Custom-modules-(coding) for more information on how to construct custom modules.",
|
|
9
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def download_unzip_and_store(url, folder_path) -> None:
|
|
5
|
+
"""
|
|
6
|
+
Use wget to download a ZIP file and unzip its contents to a specified folder.
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
- url (str): The URL of the ZIP file to download.
|
|
10
|
+
- folder_path (str): The path of the folder where the ZIP file's contents will be extracted.
|
|
11
|
+
# - folder_name (str): The name of the folder where the ZIP file's contents will be extracted.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import subprocess
|
|
15
|
+
import os
|
|
16
|
+
import zipfile
|
|
17
|
+
|
|
18
|
+
# Ensure the destination folder exists
|
|
19
|
+
if not os.path.exists(folder_path): # directory exists?
|
|
20
|
+
os.makedirs(folder_path)
|
|
21
|
+
|
|
22
|
+
# Download the file with wget
|
|
23
|
+
logging.info("Downloading the ZIP file with wget...")
|
|
24
|
+
subprocess.run(["wget", "-O", "downloaded_file.zip", url])
|
|
25
|
+
|
|
26
|
+
# Unzipping the file
|
|
27
|
+
logging.info("Unzipping the file...")
|
|
28
|
+
with zipfile.ZipFile("downloaded_file.zip", "r") as zip_ref:
|
|
29
|
+
zip_ref.extractall(folder_path)
|
|
30
|
+
|
|
31
|
+
# Clean up (delete) the zip file after extraction
|
|
32
|
+
os.remove("downloaded_file.zip")
|
|
33
|
+
logging.info(f"File successfully downloaded and extracted to '{folder_path}'")
|
|
34
|
+
|
|
35
|
+
else:
|
|
36
|
+
logging.info(f"The data already exists at '{folder_path}'")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def add_logger(cfg, state) -> None:
|
|
40
|
+
|
|
41
|
+
# ! Ignore logging file for now...
|
|
42
|
+
# if cfg.logging_file == "":
|
|
43
|
+
# pathf = ""
|
|
44
|
+
# else:
|
|
45
|
+
# pathf = cfg.logging_file
|
|
46
|
+
|
|
47
|
+
logging.basicConfig(
|
|
48
|
+
# filename=pathf,
|
|
49
|
+
encoding="utf-8",
|
|
50
|
+
filemode="w",
|
|
51
|
+
level=cfg.core.logging_level,
|
|
52
|
+
format="%(asctime)s - %(levelname)s - %(message)s",
|
|
53
|
+
)
|
|
54
|
+
logging.root.setLevel(cfg.core.logging_level)
|
|
55
|
+
|
|
56
|
+
state.logger = logging.getLogger("igm")
|