cimsi 0.7.8__py3-none-any.whl

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.
Files changed (95) hide show
  1. cimsi-0.7.8.dist-info/METADATA +80 -0
  2. cimsi-0.7.8.dist-info/RECORD +95 -0
  3. cimsi-0.7.8.dist-info/WHEEL +5 -0
  4. cimsi-0.7.8.dist-info/entry_points.txt +3 -0
  5. cimsi-0.7.8.dist-info/top_level.txt +1 -0
  6. imsi/__init__.py +16 -0
  7. imsi/_version.py +34 -0
  8. imsi/cli/__init__.py +0 -0
  9. imsi/cli/cli_snapshot_state.sh +175 -0
  10. imsi/cli/core_cli.py +307 -0
  11. imsi/cli/core_tracking.py +169 -0
  12. imsi/cli/entry.py +58 -0
  13. imsi/cli/lazy.py +104 -0
  14. imsi/cli/post_install.py +16 -0
  15. imsi/cli/sectioned_group.py +26 -0
  16. imsi/config_manager/.gitignore +5 -0
  17. imsi/config_manager/__init__.py +0 -0
  18. imsi/config_manager/config_manager.py +516 -0
  19. imsi/config_manager/databases.py +107 -0
  20. imsi/config_manager/schema/__init__.py +0 -0
  21. imsi/config_manager/schema/compiler.py +8 -0
  22. imsi/config_manager/schema/components.py +87 -0
  23. imsi/config_manager/schema/experiment.py +34 -0
  24. imsi/config_manager/schema/machine.py +156 -0
  25. imsi/config_manager/schema/model.py +21 -0
  26. imsi/config_manager/schema/post_processing.py +12 -0
  27. imsi/config_manager/schema/sequencing.py +26 -0
  28. imsi/config_manager/schema/setup_params.py +7 -0
  29. imsi/config_manager/schema/types.py +7 -0
  30. imsi/config_manager/schema/utilities.py +9 -0
  31. imsi/config_manager/tests.py +50 -0
  32. imsi/imsi.site.rc +4 -0
  33. imsi/scheduler_interface/__init__.py +0 -0
  34. imsi/scheduler_interface/scheduler_tools.py +96 -0
  35. imsi/scheduler_interface/schedulers.py +177 -0
  36. imsi/sequencer_interface/__init__.py +0 -0
  37. imsi/sequencer_interface/iss_cap.py +215 -0
  38. imsi/sequencer_interface/maestro_cap.py +1242 -0
  39. imsi/sequencer_interface/maestro_status.py +201 -0
  40. imsi/sequencer_interface/sequencers.py +65 -0
  41. imsi/shell_interface/__init__.py +6 -0
  42. imsi/shell_interface/config_hooks_collection.py +139 -0
  43. imsi/shell_interface/config_hooks_collection_config.yaml +8 -0
  44. imsi/shell_interface/config_hooks_manager.py +89 -0
  45. imsi/shell_interface/parse_dbs_example.py +43 -0
  46. imsi/shell_interface/shell_comp_environment.py +171 -0
  47. imsi/shell_interface/shell_config_parameters.py +109 -0
  48. imsi/shell_interface/shell_diag_parameters.py +35 -0
  49. imsi/shell_interface/shell_inputs_outputs.py +189 -0
  50. imsi/shell_interface/shell_interface_manager.py +203 -0
  51. imsi/shell_interface/shell_interface_utilities.py +36 -0
  52. imsi/shell_interface/shell_timing_vars.py +72 -0
  53. imsi/tools/__init__.py +0 -0
  54. imsi/tools/disk_tools/__init__.py +0 -0
  55. imsi/tools/disk_tools/disk_tools.py +72 -0
  56. imsi/tools/disk_tools/disk_tools_cli.py +26 -0
  57. imsi/tools/ensemble/README.md +129 -0
  58. imsi/tools/ensemble/__init__.py +0 -0
  59. imsi/tools/ensemble/all_supported_exp.yaml +49 -0
  60. imsi/tools/ensemble/config/example_table.csv +3 -0
  61. imsi/tools/ensemble/config/example_table.yaml +18 -0
  62. imsi/tools/ensemble/config.py +53 -0
  63. imsi/tools/ensemble/config.yaml +11 -0
  64. imsi/tools/ensemble/ensemble_cli.py +105 -0
  65. imsi/tools/ensemble/ensemble_manager.py +231 -0
  66. imsi/tools/ensemble/table_utils/__init__.py +0 -0
  67. imsi/tools/ensemble/table_utils/data_model.py +113 -0
  68. imsi/tools/ensemble/table_utils/table_model.py +202 -0
  69. imsi/tools/ensemble/table_utils/table_utils.py +157 -0
  70. imsi/tools/list/__init__.py +0 -0
  71. imsi/tools/list/list_cli.py +114 -0
  72. imsi/tools/list/list_manager.py +119 -0
  73. imsi/tools/menu/menu_cli.py +53 -0
  74. imsi/tools/menu/menu_helpers.py +99 -0
  75. imsi/tools/simple_sequencer/__init__.py +0 -0
  76. imsi/tools/simple_sequencer/iss.py +872 -0
  77. imsi/tools/simple_sequencer/iss_cli.py +203 -0
  78. imsi/tools/simple_sequencer/iss_globals.py +148 -0
  79. imsi/tools/time_manager/__init__.py +0 -0
  80. imsi/tools/time_manager/cftime_utils.py +300 -0
  81. imsi/tools/time_manager/chunk_manager.py +359 -0
  82. imsi/tools/time_manager/time_manager.py +354 -0
  83. imsi/tools/time_manager/timer_cli.py +136 -0
  84. imsi/tools/validate/validate_cli.py +148 -0
  85. imsi/user_interface/__init__.py +0 -0
  86. imsi/user_interface/setup_manager.py +288 -0
  87. imsi/user_interface/ui_manager.py +296 -0
  88. imsi/user_interface/ui_utils.py +113 -0
  89. imsi/utils/__init__.py +0 -0
  90. imsi/utils/dict_tools.py +366 -0
  91. imsi/utils/general.py +138 -0
  92. imsi/utils/git_tools.py +190 -0
  93. imsi/utils/multiple_inheritance_test.py +86 -0
  94. imsi/utils/nml_tools.py +200 -0
  95. imsi/utils/repo_query_status.sh +29 -0
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: cimsi
3
+ Version: 0.7.8
4
+ Summary: Integrated Modelling System Infrastructure (IMSI) is a comprehensive software project used to download, configure, build and run the suite of models in the CCCma Integrated Modelling System.
5
+ Author: CCCma Technical Development Team
6
+ License: OGL-Canada-2.0
7
+ Project-URL: Homepage, https://imsi.readthedocs.io/en/latest/
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Natural Language :: English
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: isodate
15
+ Requires-Dist: cftime
16
+ Requires-Dist: xarray
17
+ Requires-Dist: dataclasses
18
+ Requires-Dist: json5
19
+ Requires-Dist: click
20
+ Requires-Dist: pydantic
21
+ Requires-Dist: omegaconf
22
+ Requires-Dist: pandas
23
+ Requires-Dist: rich
24
+ Requires-Dist: pyarrow
25
+ Requires-Dist: python-dotenv
26
+ Requires-Dist: questionary
27
+ Provides-Extra: tests
28
+ Requires-Dist: coverage; extra == "tests"
29
+ Requires-Dist: pytest; extra == "tests"
30
+ Requires-Dist: python-dotenv; extra == "tests"
31
+ Provides-Extra: docs
32
+ Requires-Dist: sphinxcontrib-programoutput; extra == "docs"
33
+ Requires-Dist: sphinx-rtd-theme==1.2.2; extra == "docs"
34
+ Requires-Dist: recommonmark; extra == "docs"
35
+
36
+ # Integrated Modelling System Infrastructure (IMSI)
37
+
38
+ [![Documentation Status](https://readthedocs.org/projects/imsi/badge/?version=latest)](https://imsi.readthedocs.io/en/latest/?version=latest)
39
+ ![Pipeline Status](https://gitlab.com/cccma/imsi/badges/main/pipeline.svg)
40
+ ![Coverage Status](https://gitlab.com/cccma/imsi/badges/main/coverage.svg)
41
+
42
+ The **Integrated Modelling System Infrastructure (IMSI)** is a comprehensive Python-based package used to download, configure, build, and run the suite of models in the CCCma Integrated Modelling System.
43
+
44
+ - **Documentation:** [https://imsi.readthedocs.io](https://imsi.readthedocs.io)
45
+
46
+ ---
47
+
48
+ ## License
49
+
50
+ - [Open Government License – Canada version 2.0](https://open.canada.ca/en/open-government-licence-canada)
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ IMSI is normally pre-installed on support machines by technical staff, and users need only source an environment.
57
+
58
+ You can install IMSI manually as shown below. It is recommended to install it inside a Python or Conda virtual environment.
59
+
60
+ ```bash
61
+ python3 -m venv /path/to/new/virtual/environment
62
+ source /path/to/new/virtual/environment/activate
63
+ # conda create -n imsi-test python=3.10
64
+
65
+ git clone git@gitlab.science.gc.ca:CanESM/imsi.git
66
+ cd imsi
67
+ pip install . # for usage
68
+ # pip install -e . # for development
69
+ ```
70
+
71
+ ## Basic usage
72
+ ```bash
73
+ imsi -h # for help
74
+
75
+ # Setup a CanESM5.1 p1 CMIP6 piControl run
76
+ imsi setup --repo=https://gitlab.com/cccma/canesm --ver=develop_canesm --exp=cmip6-piControl --model=canesm51_p1 --runid=imsi-test
77
+ imsi build # compile executables
78
+ imsi save-restarts # save desired restarts
79
+ imsi submit # submit the run
80
+ ```
@@ -0,0 +1,95 @@
1
+ imsi/__init__.py,sha256=CaHq_QzgjiRVGD5xLxa81QskILsYDU-EgVo_x_JvAaA,496
2
+ imsi/_version.py,sha256=mSQsGpKEyQ0mN98SAA-SDBNtL6taCP-gGQJGxh0vecQ,704
3
+ imsi/imsi.site.rc,sha256=YyeEmw3-V0ZQkUrhwfuAydY7kwaTagKBXu1ulaVAu8A,133
4
+ imsi/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ imsi/cli/cli_snapshot_state.sh,sha256=4sEC4gzl4TBcNUwrUmVcaLQTkA9us-Fhro7Tl5DL2YA,4321
6
+ imsi/cli/core_cli.py,sha256=UscNpTfmx1f4Ae1a_5n0FSA76ucFrjr-P9AhaucZqMk,10192
7
+ imsi/cli/core_tracking.py,sha256=JqFIleaaQOrv9szLXUsHRjwSxPu_DVoFO5mkQ0giPHA,5619
8
+ imsi/cli/entry.py,sha256=uxVFpb-P6fD0vnge7EG0q6Ed2FufuWNwJCOUxFR8WFA,2438
9
+ imsi/cli/lazy.py,sha256=BMgOYRR5uKXFG7VKw0I5cCb67nIDwy_o43nRAa0vtro,3374
10
+ imsi/cli/post_install.py,sha256=PbsXBV7PH7ZrAtIcnM9JCqEDMfCnnR9jg5kA-l6BFqk,722
11
+ imsi/cli/sectioned_group.py,sha256=qtGcxYQVWcZ3gG49h1ABjoZ8lCV8vKnmDejtaXB6qFk,894
12
+ imsi/config_manager/.gitignore,sha256=1q4ouJ43KTPNGKKrRWzdM8DLGKa86y0ToGr2WE7R_5U,104
13
+ imsi/config_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ imsi/config_manager/config_manager.py,sha256=1dELI4mgB_8P5EakH7qeEaL_aQ4a82rkhPKCjrbgyHg,21036
15
+ imsi/config_manager/databases.py,sha256=d9mFe1Fod6AQ1jCzRPK7NK6fOLTvUtKNvMSzhrIMf6U,5021
16
+ imsi/config_manager/tests.py,sha256=jhxMR_YJFv2ZldzZh8q33-T4LM4m7hF2NRKkuC7jX3k,1998
17
+ imsi/config_manager/schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ imsi/config_manager/schema/compiler.py,sha256=Z6h3mIFsJ-n3-kRXeafs9rq29_tGVulFcN7ZslEppOw,174
19
+ imsi/config_manager/schema/components.py,sha256=3zG4lg5QBSlO3vhRT1FmhI6Xb4hFIqbUcvmBQLc5R_g,3460
20
+ imsi/config_manager/schema/experiment.py,sha256=byfqGdJUXtyuMgf454pyDieezY4nXp6UJyg3AXKABog,1145
21
+ imsi/config_manager/schema/machine.py,sha256=6h9Ulpz88bGjdVSMu-DM2Ycu1RdrhGux0lE4QWqjvWs,6413
22
+ imsi/config_manager/schema/model.py,sha256=eoghmp6bX2_cOn3SlELI82pjUGYTnAZj9tOQTn-n7CM,681
23
+ imsi/config_manager/schema/post_processing.py,sha256=crU2_5qAhW9jKUHHNWleXD-xI0reP__q7AuU1FP56Oo,471
24
+ imsi/config_manager/schema/sequencing.py,sha256=VXcAczn-HxWF3pyGVdLuvqEQARg0X9PZzmr3DX1kyfg,983
25
+ imsi/config_manager/schema/setup_params.py,sha256=fsXjtxSCWbT77V_dgviM28DgBd6vpRlvT6drz5TtxvY,166
26
+ imsi/config_manager/schema/types.py,sha256=3NGkjBaoa1MZ5Hx5Y6XarHkLg8bbsxaVDk0L8XvmwF8,250
27
+ imsi/config_manager/schema/utilities.py,sha256=XLn9Yo2TcrYi-mKdauzIHpZR-9ooFPDJXO7Ci9dedVE,250
28
+ imsi/scheduler_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ imsi/scheduler_interface/scheduler_tools.py,sha256=L6hVHMGPebj9R56It4EzFTOj_xAxlFxfuv7SD8c43Qo,3229
30
+ imsi/scheduler_interface/schedulers.py,sha256=fENYJtBK-0i9sxAscFxfHxUiMkbjX7KLc0gPYVHKQZY,6236
31
+ imsi/sequencer_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ imsi/sequencer_interface/iss_cap.py,sha256=AnGgVBjpdtjABkFJ1HtqHf-v_1JBEFfaqpZqVgw0fuE,9616
33
+ imsi/sequencer_interface/maestro_cap.py,sha256=4JoW0NTZ-5f_9YeKMdqS6xmHueKBuhU16pqdh0t2wEQ,51014
34
+ imsi/sequencer_interface/maestro_status.py,sha256=oltycJ5GPm-fwftg0JGHWJ40RTnFy6mnB509c2pXLjM,8295
35
+ imsi/sequencer_interface/sequencers.py,sha256=8SAsk-a2H9ezlQmIkrlFzJsVqIZWUFQqsD7U0pU2Yag,2414
36
+ imsi/shell_interface/__init__.py,sha256=kQgA-PEDA8zccCcZCJD6DS0yc7OPf4AvqQCnS7Fnzd0,370
37
+ imsi/shell_interface/config_hooks_collection.py,sha256=O3M_xlLzAiW50anizKzBNSNOwlIzxpXo65OBSpdopvQ,5151
38
+ imsi/shell_interface/config_hooks_collection_config.yaml,sha256=xKPIHAeZ7g-uS9DQiJYbvnmgIpIq5iAravG0BXVSdww,190
39
+ imsi/shell_interface/config_hooks_manager.py,sha256=L2oon5zUmplVseVwWMlCOvawySctB37xB4ftycCUjIo,3248
40
+ imsi/shell_interface/parse_dbs_example.py,sha256=q3HVcAAMqbdBEsnEGBziUFvhJzuxqcktCO64E57D_fE,1807
41
+ imsi/shell_interface/shell_comp_environment.py,sha256=qqVortr5TxrBj9HBZp7C9HTI7veiUJMXeoidjeVzE_g,6873
42
+ imsi/shell_interface/shell_config_parameters.py,sha256=A0PHJEZC9qT-k7hkR0yPz-PDKjxs0h8EUJse7bykz2c,5708
43
+ imsi/shell_interface/shell_diag_parameters.py,sha256=7-wIPWeBsM4XXSZPzjSWZMX_aLhXuhSi34zE-OE7V3k,1572
44
+ imsi/shell_interface/shell_inputs_outputs.py,sha256=hqA5B2lmwg6-GlF15S1HsKq5ynJlVAXE5B8z0z0PPm4,9181
45
+ imsi/shell_interface/shell_interface_manager.py,sha256=3_TYQMxl7Ei7j9cbD835Wj_biwv3Xip-CvE5iLDQXkE,8338
46
+ imsi/shell_interface/shell_interface_utilities.py,sha256=0UBVgY2bK3HC3z-C086Q667wtdlvfwI_BV0FDXujkiQ,1246
47
+ imsi/shell_interface/shell_timing_vars.py,sha256=KXye_l_dWtb5YUppZZPpY4a6ziwjChDNqf_vl2y3pGU,3866
48
+ imsi/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ imsi/tools/disk_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
+ imsi/tools/disk_tools/disk_tools.py,sha256=Yh7tfGeCx9yeXHjNL5dQzIQpCQmW6pNfSCqr9sD5yys,2915
51
+ imsi/tools/disk_tools/disk_tools_cli.py,sha256=HeIbVnttG2YL8LRxX69YAhuac-8WDbkJJrF1-xtAOcI,1051
52
+ imsi/tools/ensemble/README.md,sha256=b1-HFagG5MuDQMLN4ds2YDy2BbP3I2orKCfxkS9QoR8,6391
53
+ imsi/tools/ensemble/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
+ imsi/tools/ensemble/all_supported_exp.yaml,sha256=LhcqW2lre52tfEO37cul8cyJ4M2dyEkkxWWPCcL3vVg,1661
55
+ imsi/tools/ensemble/config.py,sha256=MxpnhrNJt-lfwXa0BMzVXd2bmXYA0yWoiVBaLfe4Rmg,1731
56
+ imsi/tools/ensemble/config.yaml,sha256=VHyuqpSl7CUoLRIryI3Hg2VxTjs7s8odkXYBTTgOONY,285
57
+ imsi/tools/ensemble/ensemble_cli.py,sha256=4hzwQdaU7836c5hM8lPfzIqUgRRsbr1UMNEFm3ODSFI,3114
58
+ imsi/tools/ensemble/ensemble_manager.py,sha256=3-FswugoKoNFi2J7IOaS41FXwxpmfHc3J7pY3APZTQ4,9250
59
+ imsi/tools/ensemble/config/example_table.csv,sha256=fxS0g6fmWrYvpdbNMlTl0M_Y1cFJ6K9CSVLqR9EhStU,82
60
+ imsi/tools/ensemble/config/example_table.yaml,sha256=WMLppQgU6hVHRPCse44OxYBwqkSaQt470rcpteEql3A,338
61
+ imsi/tools/ensemble/table_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
+ imsi/tools/ensemble/table_utils/data_model.py,sha256=YIT7IIDSN0NXaKeZk3OpoeGxwkFR4F252UyONM4jfyY,4379
63
+ imsi/tools/ensemble/table_utils/table_model.py,sha256=T-5ARkK5C_X8d51UFFXq2ffsPrZZSIY6iEJ-9DFR0Wo,7154
64
+ imsi/tools/ensemble/table_utils/table_utils.py,sha256=uL2ic4mdEinYAcukObQPJ-qJdhJeP_vs1VreYueo5K8,5659
65
+ imsi/tools/list/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
+ imsi/tools/list/list_cli.py,sha256=SLd_id-r5lvYY319VJTsKMdln_QrNzdxcinSOhwBrfw,4327
67
+ imsi/tools/list/list_manager.py,sha256=nNzSkHz6mdzei2qR2-KB4Wumt3dJ57ia55BdQG279s8,3548
68
+ imsi/tools/menu/menu_cli.py,sha256=t8at0cJ4BJ9DIOJVtEXyHKTK4rXgdgQnklyRcagH8ao,1996
69
+ imsi/tools/menu/menu_helpers.py,sha256=370pSve9P03B0n1_GpHPgWYqapuwu3bASWDiUf2UsSs,2927
70
+ imsi/tools/simple_sequencer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
+ imsi/tools/simple_sequencer/iss.py,sha256=o2NmaofxPyg-qDt7KxeHUWJjd_L5RthaRPXMlFvO7WU,33264
72
+ imsi/tools/simple_sequencer/iss_cli.py,sha256=GXzZaUpOR7N2Vlx-3luj6f59oCnyAjwuMJsljXO-6oo,9575
73
+ imsi/tools/simple_sequencer/iss_globals.py,sha256=i8FtxbLcAIUMoE-nHRlZiEiGqC9evl1g6BV4TgvY_Wo,5009
74
+ imsi/tools/time_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
+ imsi/tools/time_manager/cftime_utils.py,sha256=JLroGw9SlhI6swtnOnG_aGnJx-_NB7A2e3Uiqq0INWw,11824
76
+ imsi/tools/time_manager/chunk_manager.py,sha256=DGyVzuqYfGi1M9_bNoTHxY4p015np1BmmKd1DkjT7OI,14622
77
+ imsi/tools/time_manager/time_manager.py,sha256=MZSaMRBzTc8qCsT1xEw6-S-wtQubpwN_TktQZhtaZjU,12667
78
+ imsi/tools/time_manager/timer_cli.py,sha256=BQvfGG0xaVP_hLbJYcXZ5IvMXJnNraWLO4c1mPGp6JI,7750
79
+ imsi/tools/validate/validate_cli.py,sha256=pZjjo3OaCW5Us5_25fm347EFR5oiGTdqfIx1oCGtnYE,4659
80
+ imsi/user_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
+ imsi/user_interface/setup_manager.py,sha256=Jp2nNqcUcQMwFwiJzCLsjsUjoWyAGqzig4BBIlPc72w,10844
82
+ imsi/user_interface/ui_manager.py,sha256=E3QuU_l3_TRR7qPAySwyGae1ZStcqUgtGvAVbgoUjhY,12722
83
+ imsi/user_interface/ui_utils.py,sha256=HtqyBM6KcBXIYAR4uD1LkopphlnRxXEIBq8qyxm3GXM,4182
84
+ imsi/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
+ imsi/utils/dict_tools.py,sha256=VXpYl1uM35KgP_rHaJQ7PtLKFJ5HLjeME0dYj-PXByI,12607
86
+ imsi/utils/general.py,sha256=wNBRiUctMzlSjs6h6UclscEC9U2FUzJ0rugfBmY2CO8,4481
87
+ imsi/utils/git_tools.py,sha256=mFZ3RXy7-VsqB6QwNj3WUQ2Po6X07IoTSQ48BheIs_4,6804
88
+ imsi/utils/multiple_inheritance_test.py,sha256=TgtHzfs2vp6Um5mm2np8eI581ADpfSMuZJSk2z0QV7I,2549
89
+ imsi/utils/nml_tools.py,sha256=W-zWJQm69tJ1-tIOB3KNIJP6-aUr0Q8WbN7E003PYYA,7127
90
+ imsi/utils/repo_query_status.sh,sha256=Jh1u1X1GSpQCwG0wORTh4Oms8j5F-3oFKxLlaxworEM,836
91
+ cimsi-0.7.8.dist-info/METADATA,sha256=goa4rD_TEyX_X-lVSofEpkPb797cGb0NQCx4D56r9gM,2903
92
+ cimsi-0.7.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
93
+ cimsi-0.7.8.dist-info/entry_points.txt,sha256=HshtKQr9HaQXBJ7XERdsFjO2kpiW__wSZIqOwhg_Xks,99
94
+ cimsi-0.7.8.dist-info/top_level.txt,sha256=w8iJC9Bv_SLu8L5zqVJ_egupI0KoJ8K0pg0TVmVnzkQ,5
95
+ cimsi-0.7.8.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ imsi = imsi.cli.entry:cli
3
+ imsi-post-install = imsi.cli.post_install:post_install
@@ -0,0 +1 @@
1
+ imsi
imsi/__init__.py ADDED
@@ -0,0 +1,16 @@
1
+ """Top-level package for imsi."""
2
+
3
+ __author__ = "CCCma Technical Development Team"
4
+ __email__ = ""
5
+
6
+ from importlib.metadata import version as get_version, PackageNotFoundError
7
+
8
+ try:
9
+ # Use installed package version (when installed via pip)
10
+ __version__ = get_version("cimsi")
11
+ except PackageNotFoundError:
12
+ try:
13
+ # Use locally generated setuptools_scm file (for local dev)
14
+ from ._version import version as __version__
15
+ except ImportError:
16
+ __version__ = "unknown"
imsi/_version.py ADDED
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.7.8'
32
+ __version_tuple__ = version_tuple = (0, 7, 8)
33
+
34
+ __commit_id__ = commit_id = None
imsi/cli/__init__.py ADDED
File without changes
@@ -0,0 +1,175 @@
1
+ #!/bin/bash
2
+ # create a "snapshot" of a git repo.
3
+ # - write output from git commands to files
4
+ # - keep the folder of those contents if they are unique
5
+ #
6
+ # usage: cli_snapshot_state.sh [list of rel paths]
7
+ #
8
+ # the paths are relative to the current path. the paths must be to git repos.
9
+ # the state is capture for the git repo and any submodules if present.
10
+ #
11
+ # NOTE: this is an imsi integrated tool, and assumes certain processes and
12
+ # states of execution upstream.
13
+ #
14
+ set -e
15
+
16
+ bail() {
17
+ echo "$(basename $0) ERROR: $*"
18
+ exit 1
19
+ }
20
+
21
+ usage () {
22
+ echo "Usage: $0 -p <rel_path> [-i <run_dir>] [-o <out_dir>]"
23
+ }
24
+
25
+ help () {
26
+ usage
27
+ echo ""
28
+ echo "Arguments:"
29
+ echo " -p <rel_path>"
30
+ echo " Relative paths to <run_dir>. Must be git repo."
31
+ echo " Multiple paths can be supplied by repeating -p."
32
+ echo ""
33
+ echo "Options:"
34
+ echo " -i <run_dir>"
35
+ echo " Input directory, usually run directory (default pwd)."
36
+ echo " -o <out_dir>"
37
+ echo " Parent path to where the log artefacts are written"
38
+ echo " (as <out_dir>/.imsi/states) (default pwd)."
39
+ echo " -h"
40
+ echo " Display usage information."
41
+ echo ""
42
+ }
43
+
44
+ # defaults / init
45
+ rel_paths=()
46
+ run_dir=$(pwd)
47
+ out_dir=$(pwd)
48
+
49
+ # note: since this is an integrated imsi tool, pwd is usually the
50
+ # work dir (runid) folder from where the imsi command is issued.
51
+ # this should be left as-is for most applications.
52
+ # other internal imsi tools may call this tool, which then would require
53
+ # setting -i and -o explicitly.
54
+
55
+ OPTSTRING=":p:i:o:h"
56
+
57
+ while getopts ${OPTSTRING} opt; do
58
+ case $opt in
59
+ p)
60
+ rel_paths+=("$OPTARG")
61
+ ;;
62
+ i)
63
+ run_dir=${OPTARG}
64
+ ;;
65
+ o)
66
+ out_dir=${OPTARG}
67
+ ;;
68
+ h)
69
+ help
70
+ exit 0
71
+ ;;
72
+ :)
73
+ echo "Option -$OPTARG requires an argument." >&2
74
+ usage
75
+ exit 1
76
+ ;;
77
+ \?)
78
+ echo "Invalid option: -$OPTARG" >&2
79
+ usage
80
+ exit 1
81
+ ;;
82
+ esac
83
+ done
84
+ shift $((OPTIND-1))
85
+
86
+ snapshot_git_state() {
87
+ local path
88
+ local log_prefix
89
+ local cwd
90
+ path=$1
91
+ log_prefix=$2
92
+ cwd=$(pwd)
93
+
94
+ if [[ -z $log_prefix ]]; then
95
+ log_prefix=""
96
+ else
97
+ log_prefix="${log_prefix}_"
98
+ fi
99
+
100
+ cd $path
101
+ mh=$(git rev-parse HEAD)
102
+ desc=$(git describe --always)
103
+ echo $path >> $tmp_dir/${log_prefix}rev.txt
104
+ echo $mh $(basename $path) "(${desc})" >> $tmp_dir/${log_prefix}rev.txt
105
+ git submodule status --recursive >> $tmp_dir/${log_prefix}rev.txt
106
+ git status --porcelain=v1 >> $tmp_dir/${log_prefix}status.txt
107
+ git diff --submodule=diff > $tmp_dir/${log_prefix}diff.diff
108
+ cd $cwd
109
+ }
110
+
111
+ is_git_repo() {
112
+ local path=$1
113
+ if [[ -d "${path}/.git" ]]; then
114
+ echo 1
115
+ else
116
+ echo 0
117
+ fi
118
+ }
119
+
120
+ #======================
121
+ # prep
122
+ #======================
123
+
124
+ [[ -d $run_dir ]] || bail No directory $run_dir
125
+ [[ -d $out_dir ]] || bail No directory $out_dir
126
+
127
+ full_paths=( "${rel_paths[@]/#/$run_dir/}" )
128
+
129
+ # validate
130
+ for p in "${full_paths[@]}"; do
131
+ if [[ ! -d "${p}" ]]; then
132
+ bail $p is not a valid directory
133
+ fi
134
+ rc=$(is_git_repo "${p}")
135
+ if [ $rc == 0 ]; then
136
+ bail $p is not a git repo
137
+ fi
138
+ done
139
+
140
+ # create output folders
141
+ log_dir=$out_dir/.imsi/states
142
+ tmp_dir=$log_dir/tmp_state
143
+
144
+ mkdir -p $tmp_dir
145
+
146
+ #======================
147
+ # snapshot
148
+ #======================
149
+
150
+ # iterate over the folders -- determine naming and snapshot state by
151
+ # creating artefacts
152
+ # account for duplicate names by creating an id for the input folder path
153
+ # by combining the basename and (short) hash of its full folder path
154
+ # (assume this is deterministic)
155
+ # (the full file paths are written to the *rev.txt files for cross referencing)
156
+
157
+ for p in ${full_paths[@]}; do
158
+ b=$(basename "$p")
159
+ p_id=$( echo $p | md5sum | cut -c1-7 )
160
+ b_id="${b}_${p_id}"
161
+ snapshot_git_state $p $b_id $run_dir
162
+ done
163
+
164
+ # hash the folder of the entire state
165
+ hash=$(find $tmp_dir -type f -exec md5sum {} \; | sort -k 2 | md5sum | awk '{ print $1 }')
166
+
167
+ if [ -d $log_dir/$hash ]; then
168
+ # if hash exists, remove the tmp_dir
169
+ rm -rf $tmp_dir
170
+ else
171
+ # otherwise, save this new state
172
+ mv $tmp_dir $log_dir/$hash
173
+ fi
174
+
175
+ echo $hash