gammasimtools 0.5.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.
Files changed (224) hide show
  1. gammasimtools-0.5.1/.github/dependabot.yml +10 -0
  2. gammasimtools-0.5.1/.github/workflows/CI-docs.yml +44 -0
  3. gammasimtools-0.5.1/.github/workflows/CI-integrationtests.yml +95 -0
  4. gammasimtools-0.5.1/.github/workflows/CI-unittests.yml +113 -0
  5. gammasimtools-0.5.1/.github/workflows/build-docker-corsika-simtelarray-image.yml +82 -0
  6. gammasimtools-0.5.1/.github/workflows/build-docker-images.yml +71 -0
  7. gammasimtools-0.5.1/.github/workflows/pypi.yml +33 -0
  8. gammasimtools-0.5.1/.gitignore +33 -0
  9. gammasimtools-0.5.1/.mailmap +3 -0
  10. gammasimtools-0.5.1/.pre-commit-config.yaml +30 -0
  11. gammasimtools-0.5.1/CITATION.cff +31 -0
  12. gammasimtools-0.5.1/LICENSE +29 -0
  13. gammasimtools-0.5.1/PKG-INFO +110 -0
  14. gammasimtools-0.5.1/README.rst +60 -0
  15. gammasimtools-0.5.1/data/layout/telescope_positions-North-1LST.ecsv +48 -0
  16. gammasimtools-0.5.1/data/layout/telescope_positions-North-1MST.ecsv +48 -0
  17. gammasimtools-0.5.1/data/layout/telescope_positions-North-4LST.ecsv +52 -0
  18. gammasimtools-0.5.1/data/layout/telescope_positions-North-4MST.ecsv +52 -0
  19. gammasimtools-0.5.1/data/layout/telescope_positions-North-TestLayout.ecsv +67 -0
  20. gammasimtools-0.5.1/data/layout/telescope_positions-South-1LST.ecsv +60 -0
  21. gammasimtools-0.5.1/data/layout/telescope_positions-South-1MST.ecsv +60 -0
  22. gammasimtools-0.5.1/data/layout/telescope_positions-South-1SST.ecsv +60 -0
  23. gammasimtools-0.5.1/data/layout/telescope_positions-South-4LST.ecsv +64 -0
  24. gammasimtools-0.5.1/data/layout/telescope_positions-South-4MST.ecsv +64 -0
  25. gammasimtools-0.5.1/data/layout/telescope_positions-South-4SST.ecsv +64 -0
  26. gammasimtools-0.5.1/data/layout/telescope_positions-South-TestLayout.ecsv +128 -0
  27. gammasimtools-0.5.1/data/parameters/array-simulator_parameters.yml +19 -0
  28. gammasimtools-0.5.1/data/parameters/camera-efficiency_parameters.yml +7 -0
  29. gammasimtools-0.5.1/data/parameters/corsika_parameters.yml +132 -0
  30. gammasimtools-0.5.1/data/parameters/ray-tracing_parameters.yml +30 -0
  31. gammasimtools-0.5.1/data/parameters/simtel-runner-array_parameters.yml +21 -0
  32. gammasimtools-0.5.1/data/parameters/simtel-runner-ray-tracing_parameters.yml +27 -0
  33. gammasimtools-0.5.1/docker/Dockerfile-dev +31 -0
  34. gammasimtools-0.5.1/docker/Dockerfile-prod +29 -0
  35. gammasimtools-0.5.1/docker/Dockerfile-simtelarray +49 -0
  36. gammasimtools-0.5.1/docker/README.md +133 -0
  37. gammasimtools-0.5.1/docker/download_simulationsoftware.sh +11 -0
  38. gammasimtools-0.5.1/docker/entrypoint.sh +9 -0
  39. gammasimtools-0.5.1/docs/Makefile +20 -0
  40. gammasimtools-0.5.1/docs/source/applications.rst +149 -0
  41. gammasimtools-0.5.1/docs/source/auxiliary_files.rst +11 -0
  42. gammasimtools-0.5.1/docs/source/camera_efficiency.rst +13 -0
  43. gammasimtools-0.5.1/docs/source/conf.py +250 -0
  44. gammasimtools-0.5.1/docs/source/configuration_module.rst +22 -0
  45. gammasimtools-0.5.1/docs/source/corsika.rst +22 -0
  46. gammasimtools-0.5.1/docs/source/corsika_simtel.rst +14 -0
  47. gammasimtools-0.5.1/docs/source/data_model.rst +47 -0
  48. gammasimtools-0.5.1/docs/source/databases.rst +14 -0
  49. gammasimtools-0.5.1/docs/source/db_handler.rst +14 -0
  50. gammasimtools-0.5.1/docs/source/getting_started.rst +179 -0
  51. gammasimtools-0.5.1/docs/source/guidelines.rst +331 -0
  52. gammasimtools-0.5.1/docs/source/images/compare_cumulative_psf_North-LST-1_cumulativePSF.png +0 -0
  53. gammasimtools-0.5.1/docs/source/images/compare_cumulative_psf_North-LST-1_image.png +0 -0
  54. gammasimtools-0.5.1/docs/source/images/derive_mirror_rnda_North-MST-FlashCam-D.png +0 -0
  55. gammasimtools-0.5.1/docs/source/images/derive_mirror_rnda_North-MST-FlashCam-D_D80-distributions.png +0 -0
  56. gammasimtools-0.5.1/docs/source/images/tune_psf.png +0 -0
  57. gammasimtools-0.5.1/docs/source/images/validate_camera_efficiency_North-MST-NectarCam-D_cherenkov.png +0 -0
  58. gammasimtools-0.5.1/docs/source/images/validate_camera_efficiency_North-MST-NectarCam-D_nsb.png +0 -0
  59. gammasimtools-0.5.1/docs/source/images/validate_camera_fov_North-LST-1_pixelLayout.png +0 -0
  60. gammasimtools-0.5.1/docs/source/images/validate_optics_North-LST-1_d80_cm.png +0 -0
  61. gammasimtools-0.5.1/docs/source/images/validate_optics_North-LST-1_d80_deg.png +0 -0
  62. gammasimtools-0.5.1/docs/source/images/validate_optics_North-LST-1_eff_area.png +0 -0
  63. gammasimtools-0.5.1/docs/source/images/validate_optics_North-LST-1_eff_flen.png +0 -0
  64. gammasimtools-0.5.1/docs/source/index.rst +51 -0
  65. gammasimtools-0.5.1/docs/source/io_handler.rst +14 -0
  66. gammasimtools-0.5.1/docs/source/job_execution.rst +12 -0
  67. gammasimtools-0.5.1/docs/source/layout_array.rst +24 -0
  68. gammasimtools-0.5.1/docs/source/library.rst +27 -0
  69. gammasimtools-0.5.1/docs/source/mc_model.rst +55 -0
  70. gammasimtools-0.5.1/docs/source/psf_analysis.rst +15 -0
  71. gammasimtools-0.5.1/docs/source/ray_tracing.rst +16 -0
  72. gammasimtools-0.5.1/docs/source/sim_telarray.rst +54 -0
  73. gammasimtools-0.5.1/docs/source/simtools-configuration.rst +42 -0
  74. gammasimtools-0.5.1/docs/source/simulation_software.rst +25 -0
  75. gammasimtools-0.5.1/docs/source/simulators.rst +14 -0
  76. gammasimtools-0.5.1/docs/source/utils.rst +26 -0
  77. gammasimtools-0.5.1/docs/source/visualization.rst +26 -0
  78. gammasimtools-0.5.1/environment.yml +28 -0
  79. gammasimtools-0.5.1/gammasimtools.egg-info/PKG-INFO +110 -0
  80. gammasimtools-0.5.1/gammasimtools.egg-info/SOURCES.txt +222 -0
  81. gammasimtools-0.5.1/gammasimtools.egg-info/dependency_links.txt +1 -0
  82. gammasimtools-0.5.1/gammasimtools.egg-info/entry_points.txt +21 -0
  83. gammasimtools-0.5.1/gammasimtools.egg-info/requires.txt +24 -0
  84. gammasimtools-0.5.1/gammasimtools.egg-info/top_level.txt +1 -0
  85. gammasimtools-0.5.1/pyproject.toml +629 -0
  86. gammasimtools-0.5.1/set_DB_environ_template.sh +11 -0
  87. gammasimtools-0.5.1/setup.cfg +4 -0
  88. gammasimtools-0.5.1/simtools/__init__.py +8 -0
  89. gammasimtools-0.5.1/simtools/_dev_version/__init__.py +0 -0
  90. gammasimtools-0.5.1/simtools/_dev_version/scm_version.py +10 -0
  91. gammasimtools-0.5.1/simtools/_version.py +4 -0
  92. gammasimtools-0.5.1/simtools/applications/__init__.py +0 -0
  93. gammasimtools-0.5.1/simtools/applications/add_file_to_db.py +153 -0
  94. gammasimtools-0.5.1/simtools/applications/compare_cumulative_psf.py +208 -0
  95. gammasimtools-0.5.1/simtools/applications/db_development_tools/add_new_parameter_to_db.py +75 -0
  96. gammasimtools-0.5.1/simtools/applications/db_development_tools/add_unit_to_parameter_in_db.py +59 -0
  97. gammasimtools-0.5.1/simtools/applications/db_development_tools/mark_non_optics_parameters_non_applicable.py +102 -0
  98. gammasimtools-0.5.1/simtools/applications/derive_mirror_rnda.py +413 -0
  99. gammasimtools-0.5.1/simtools/applications/generate_corsika_histograms.py +408 -0
  100. gammasimtools-0.5.1/simtools/applications/get_file_from_db.py +99 -0
  101. gammasimtools-0.5.1/simtools/applications/get_parameter.py +92 -0
  102. gammasimtools-0.5.1/simtools/applications/make_regular_arrays.py +164 -0
  103. gammasimtools-0.5.1/simtools/applications/plot_layout_array.py +190 -0
  104. gammasimtools-0.5.1/simtools/applications/plot_simtel_histograms.py +120 -0
  105. gammasimtools-0.5.1/simtools/applications/print_array_elements.py +149 -0
  106. gammasimtools-0.5.1/simtools/applications/produce_array_config.py +136 -0
  107. gammasimtools-0.5.1/simtools/applications/production.py +279 -0
  108. gammasimtools-0.5.1/simtools/applications/sim_showers_for_trigger_rates.py +191 -0
  109. gammasimtools-0.5.1/simtools/applications/simulate_prod.py +345 -0
  110. gammasimtools-0.5.1/simtools/applications/submit_data_from_external.py +118 -0
  111. gammasimtools-0.5.1/simtools/applications/tune_psf.py +336 -0
  112. gammasimtools-0.5.1/simtools/applications/validate_camera_efficiency.py +132 -0
  113. gammasimtools-0.5.1/simtools/applications/validate_camera_fov.py +147 -0
  114. gammasimtools-0.5.1/simtools/applications/validate_optics.py +203 -0
  115. gammasimtools-0.5.1/simtools/applications/validate_schema_files.py +135 -0
  116. gammasimtools-0.5.1/simtools/camera_efficiency.py +536 -0
  117. gammasimtools-0.5.1/simtools/configuration/__init__.py +0 -0
  118. gammasimtools-0.5.1/simtools/configuration/commandline_parser.py +426 -0
  119. gammasimtools-0.5.1/simtools/configuration/configurator.py +412 -0
  120. gammasimtools-0.5.1/simtools/corsika/__init__.py +0 -0
  121. gammasimtools-0.5.1/simtools/corsika/corsika_config.py +535 -0
  122. gammasimtools-0.5.1/simtools/corsika/corsika_histograms.py +1721 -0
  123. gammasimtools-0.5.1/simtools/corsika/corsika_histograms_visualize.py +575 -0
  124. gammasimtools-0.5.1/simtools/corsika/corsika_output_visualize.py +345 -0
  125. gammasimtools-0.5.1/simtools/corsika/corsika_runner.py +446 -0
  126. gammasimtools-0.5.1/simtools/corsika_simtel/__init__.py +0 -0
  127. gammasimtools-0.5.1/simtools/corsika_simtel/corsika_simtel_runner.py +202 -0
  128. gammasimtools-0.5.1/simtools/data_model/__init__.py +0 -0
  129. gammasimtools-0.5.1/simtools/data_model/metadata_collector.py +311 -0
  130. gammasimtools-0.5.1/simtools/data_model/metadata_model.py +281 -0
  131. gammasimtools-0.5.1/simtools/data_model/model_data_writer.py +140 -0
  132. gammasimtools-0.5.1/simtools/data_model/validate_data.py +532 -0
  133. gammasimtools-0.5.1/simtools/data_model/validate_schema.py +285 -0
  134. gammasimtools-0.5.1/simtools/db_handler.py +1455 -0
  135. gammasimtools-0.5.1/simtools/io_handler.py +154 -0
  136. gammasimtools-0.5.1/simtools/job_execution/__init__.py +0 -0
  137. gammasimtools-0.5.1/simtools/job_execution/job_manager.py +177 -0
  138. gammasimtools-0.5.1/simtools/layout/__init__.py +0 -0
  139. gammasimtools-0.5.1/simtools/layout/layout_array.py +961 -0
  140. gammasimtools-0.5.1/simtools/layout/telescope_position.py +538 -0
  141. gammasimtools-0.5.1/simtools/model/__init__.py +0 -0
  142. gammasimtools-0.5.1/simtools/model/array_model.py +364 -0
  143. gammasimtools-0.5.1/simtools/model/camera.py +863 -0
  144. gammasimtools-0.5.1/simtools/model/mirrors.py +159 -0
  145. gammasimtools-0.5.1/simtools/model/model_utils.py +153 -0
  146. gammasimtools-0.5.1/simtools/model/telescope_model.py +861 -0
  147. gammasimtools-0.5.1/simtools/psf_analysis.py +442 -0
  148. gammasimtools-0.5.1/simtools/ray_tracing.py +497 -0
  149. gammasimtools-0.5.1/simtools/simtel/__init__.py +0 -0
  150. gammasimtools-0.5.1/simtools/simtel/simtel_config_writer.py +214 -0
  151. gammasimtools-0.5.1/simtools/simtel/simtel_events.py +264 -0
  152. gammasimtools-0.5.1/simtools/simtel/simtel_histograms.py +231 -0
  153. gammasimtools-0.5.1/simtools/simtel/simtel_runner.py +243 -0
  154. gammasimtools-0.5.1/simtools/simtel/simtel_runner_array.py +294 -0
  155. gammasimtools-0.5.1/simtools/simtel/simtel_runner_camera_efficiency.py +192 -0
  156. gammasimtools-0.5.1/simtools/simtel/simtel_runner_ray_tracing.py +241 -0
  157. gammasimtools-0.5.1/simtools/simulator.py +795 -0
  158. gammasimtools-0.5.1/simtools/utils/__init__.py +0 -0
  159. gammasimtools-0.5.1/simtools/utils/general.py +938 -0
  160. gammasimtools-0.5.1/simtools/utils/names.py +825 -0
  161. gammasimtools-0.5.1/simtools/version.py +17 -0
  162. gammasimtools-0.5.1/simtools/visualization/__init__.py +0 -0
  163. gammasimtools-0.5.1/simtools/visualization/legend_handlers.py +338 -0
  164. gammasimtools-0.5.1/simtools/visualization/visualize.py +701 -0
  165. gammasimtools-0.5.1/tests/conftest.py +257 -0
  166. gammasimtools-0.5.1/tests/integration_tests/test_applications.py +696 -0
  167. gammasimtools-0.5.1/tests/integration_tests/test_ray_tracing.py +202 -0
  168. gammasimtools-0.5.1/tests/resources/MLTdata-preproduction.ecsv +17 -0
  169. gammasimtools-0.5.1/tests/resources/MLTdata-preproduction.meta.yml +55 -0
  170. gammasimtools-0.5.1/tests/resources/MST_mirror_2f_measurements.schema.yml +39 -0
  171. gammasimtools-0.5.1/tests/resources/array_config_test.yml +10 -0
  172. gammasimtools-0.5.1/tests/resources/gamma_20deg_0deg_run1___cta-prod5-lapalma_desert-2158m-LaPalma-dark.hdata.zst +0 -0
  173. gammasimtools-0.5.1/tests/resources/photons-LST-d12.0-za20.0-off0.000_lst_integral.lis +5558 -0
  174. gammasimtools-0.5.1/tests/resources/prod_config_test.yml +47 -0
  175. gammasimtools-0.5.1/tests/resources/prod_multi_config_test.yml +49 -0
  176. gammasimtools-0.5.1/tests/resources/reference_position_mercator.schema.yml +50 -0
  177. gammasimtools-0.5.1/tests/resources/reference_position_mercator.yml +5 -0
  178. gammasimtools-0.5.1/tests/resources/run1_gamma_za20deg_azm0deg-North-Prod5_test-production-5.hdata.zst +0 -0
  179. gammasimtools-0.5.1/tests/resources/run1_proton_za20deg_azm0deg_North_1LST_test-lst-array.corsika.zst +0 -0
  180. gammasimtools-0.5.1/tests/resources/run201_proton_za20deg_azm0deg_North_TestLayout_test-prod.simtel.zst +0 -0
  181. gammasimtools-0.5.1/tests/resources/run202_proton_za20deg_azm0deg_North_TestLayout_test-prod.simtel.zst +0 -0
  182. gammasimtools-0.5.1/tests/resources/run2_gamma_za20deg_azm0deg-North-Prod5_test-production-5.hdata.zst +0 -0
  183. gammasimtools-0.5.1/tests/resources/tel_output_10GeV-2-gamma-20deg-CTAO-South.corsikaio +0 -0
  184. gammasimtools-0.5.1/tests/resources/telescope_positions-North-utm.ecsv +68 -0
  185. gammasimtools-0.5.1/tests/resources/telescope_positions-North-utm.meta.yml +45 -0
  186. gammasimtools-0.5.1/tests/resources/telescope_positions-South-4MST.ecsv +64 -0
  187. gammasimtools-0.5.1/tests/resources/test_parameters.yml +58 -0
  188. gammasimtools-0.5.1/tests/unit_tests/__init__.py +3 -0
  189. gammasimtools-0.5.1/tests/unit_tests/configuration/test_commandline_parser.py +98 -0
  190. gammasimtools-0.5.1/tests/unit_tests/configuration/test_configurator.py +189 -0
  191. gammasimtools-0.5.1/tests/unit_tests/corsika/test_corsika_config.py +262 -0
  192. gammasimtools-0.5.1/tests/unit_tests/corsika/test_corsika_histograms.py +893 -0
  193. gammasimtools-0.5.1/tests/unit_tests/corsika/test_corsika_histograms_visualize.py +131 -0
  194. gammasimtools-0.5.1/tests/unit_tests/corsika/test_corsika_runner.py +173 -0
  195. gammasimtools-0.5.1/tests/unit_tests/corsika_simtel/test_corsika_simtel_runner.py +191 -0
  196. gammasimtools-0.5.1/tests/unit_tests/data_model/test_metadata_collector.py +266 -0
  197. gammasimtools-0.5.1/tests/unit_tests/data_model/test_metadata_model.py +73 -0
  198. gammasimtools-0.5.1/tests/unit_tests/data_model/test_model_data_writer.py +60 -0
  199. gammasimtools-0.5.1/tests/unit_tests/data_model/test_validate_data.py +410 -0
  200. gammasimtools-0.5.1/tests/unit_tests/data_model/test_validate_schema.py +260 -0
  201. gammasimtools-0.5.1/tests/unit_tests/job_execution/test_job_manager.py +20 -0
  202. gammasimtools-0.5.1/tests/unit_tests/layout/test_layout_array.py +505 -0
  203. gammasimtools-0.5.1/tests/unit_tests/layout/test_telescope_position.py +306 -0
  204. gammasimtools-0.5.1/tests/unit_tests/model/test_array_model.py +76 -0
  205. gammasimtools-0.5.1/tests/unit_tests/model/test_camera_model.py +24 -0
  206. gammasimtools-0.5.1/tests/unit_tests/model/test_mirrors.py +28 -0
  207. gammasimtools-0.5.1/tests/unit_tests/model/test_telescope_model.py +263 -0
  208. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_config_writer.py +51 -0
  209. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_events.py +76 -0
  210. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_histograms.py +33 -0
  211. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_runner.py +27 -0
  212. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_runner_array.py +106 -0
  213. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_runner_camera_efficiency.py +74 -0
  214. gammasimtools-0.5.1/tests/unit_tests/simtel/test_simtel_runner_ray_tracing.py +110 -0
  215. gammasimtools-0.5.1/tests/unit_tests/test_camera_efficiency.py +131 -0
  216. gammasimtools-0.5.1/tests/unit_tests/test_db_handler.py +392 -0
  217. gammasimtools-0.5.1/tests/unit_tests/test_io_handler.py +84 -0
  218. gammasimtools-0.5.1/tests/unit_tests/test_psf_analysis.py +23 -0
  219. gammasimtools-0.5.1/tests/unit_tests/test_ray_tracing.py +72 -0
  220. gammasimtools-0.5.1/tests/unit_tests/test_simulator.py +397 -0
  221. gammasimtools-0.5.1/tests/unit_tests/utils/test_general.py +337 -0
  222. gammasimtools-0.5.1/tests/unit_tests/utils/test_names.py +77 -0
  223. gammasimtools-0.5.1/tests/unit_tests/visualization/test_legend_handlers.py +47 -0
  224. gammasimtools-0.5.1/tests/unit_tests/visualization/test_visualize.py +128 -0
@@ -0,0 +1,10 @@
1
+ # Set update schedule for GitHub Actions
2
+
3
+ version: 2
4
+ updates:
5
+
6
+ - package-ecosystem: "github-actions"
7
+ directory: "/"
8
+ schedule:
9
+ # Check for updates to GitHub Actions every week
10
+ interval: "weekly"
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: CI-docs
3
+ # Build and deploy docs to gh-pages
4
+
5
+ on:
6
+ pull_request:
7
+ branches: [main]
8
+ types: [opened, closed, synchronize]
9
+
10
+ jobs:
11
+
12
+ docs:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: checkout
17
+ uses: actions/checkout@v3
18
+
19
+ - name: Set up Python 3.10.4
20
+ uses: actions/setup-python@v4
21
+ with:
22
+ python-version: 3.10.4
23
+
24
+ - name: Python dependencies
25
+ run: |
26
+ python --version
27
+ pip install '.[doc]'
28
+
29
+ - name: Build docs
30
+ shell: bash -l {0}
31
+ run: |
32
+ make -C docs/ html
33
+ touch docs/build/html/.nojekyll
34
+
35
+ - name: Deploy to gihub pages
36
+ # only run when PR is merged
37
+ if: github.event.pull_request.merged
38
+ uses: JamesIves/github-pages-deploy-action@v4
39
+ with:
40
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
+ BRANCH: gh-pages
42
+ FOLDER: docs/build/html
43
+ CLEAN: true
44
+ SINGLE_COMMIT: true
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: CI-integrationtests
3
+ # Execute integration tests for applications
4
+ #
5
+ env:
6
+ SIMTEL_PATH: ${{ github.workspace }}/
7
+ DB_SERVER: ${{ secrets.DB_SERVER }}
8
+ DB_API_USER: ${{ secrets.DB_API_USER }}
9
+ DB_API_PW: ${{ secrets.DB_API_PW }}
10
+ DB_API_PORT: ${{ secrets.DB_API_PORT }}
11
+
12
+ on:
13
+ pull_request:
14
+ branches: [main]
15
+ types: [opened, synchronize]
16
+ push:
17
+ branches:
18
+ - main
19
+
20
+ jobs:
21
+
22
+ integrationtests:
23
+ runs-on: ${{ matrix.os }}
24
+ strategy:
25
+ matrix:
26
+ include:
27
+ - os: ubuntu-latest
28
+ python-version: "3.9"
29
+ install-method: mamba
30
+
31
+ - os: ubuntu-latest
32
+ python-version: "3.9"
33
+ install-method: pip
34
+
35
+ defaults:
36
+ run:
37
+ shell: bash -leo pipefail {0}
38
+
39
+ steps:
40
+ - name: checkout
41
+ uses: actions/checkout@v3
42
+
43
+ - name: Set up Python ${{ matrix.python-version }}
44
+ uses: actions/setup-python@v4
45
+ with:
46
+ python-version: ${{ matrix.python-version }}
47
+
48
+ - name: Prepare mamba installation
49
+ if: matrix.install-method == 'mamba'
50
+ env:
51
+ PYTHON_VERSION: ${{ matrix.python-version }}
52
+ run: |
53
+ # setup correct python version
54
+ sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
55
+
56
+ - name: Install mamba dependencies
57
+ if: matrix.install-method == 'mamba'
58
+ uses: mamba-org/setup-micromamba@v1
59
+ with:
60
+ environment-file: environment.yml
61
+ create-args: python=${{ matrix.python-version }}
62
+ init-shell: bash
63
+
64
+ - name: Python setup
65
+ if: matrix.install-method == 'pip'
66
+ uses: actions/setup-python@v4
67
+ with:
68
+ python-version: ${{ matrix.python-version }}
69
+ check-latest: true
70
+
71
+ - name: Python dependencies
72
+ run: |
73
+ python --version
74
+ pip install '.[tests,dev,doc]'
75
+
76
+ - name: simteldependencies
77
+ run: |
78
+ sudo apt-get update -y -qq
79
+ sudo apt-get install -y -qq bash build-essential bzip2 csh gfortran gcc g++ git libgsl-dev make wget
80
+
81
+ - name: corsikasimtelpackage
82
+ run: |
83
+ wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets.CLOUD_SIMTEL }}/download
84
+ mv download corsika7.7_simtelarray.tar.gz
85
+ tar -xzf corsika7.7_simtelarray.tar.gz
86
+ ./build_all prod5 qgs2 gsl
87
+
88
+ - name: run sim_telarray
89
+ run: |
90
+ echo "${SIMTEL_PATH}"
91
+ ls "${SIMTEL_PATH}"
92
+
93
+ - name: Integration tests
94
+ shell: bash -l {0}
95
+ run: pytest --color=yes --durations=10 --no-cov tests/integration_tests/
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: CI-unittests
3
+ # Execute unit tests - pyflakes and pytest
4
+ #
5
+ env:
6
+ DB_SERVER: ${{ secrets.DB_SERVER }}
7
+ DB_API_USER: ${{ secrets.DB_API_USER }}
8
+ DB_API_PW: ${{ secrets.DB_API_PW }}
9
+ DB_API_PORT: ${{ secrets.DB_API_PORT }}
10
+
11
+ on:
12
+ pull_request:
13
+ branches: [main]
14
+ types: [opened, synchronize]
15
+ push:
16
+ branches:
17
+ - main
18
+
19
+ jobs:
20
+
21
+ unittests:
22
+ runs-on: ${{ matrix.os }}
23
+ strategy:
24
+ matrix:
25
+ include:
26
+ - os: ubuntu-latest
27
+ python-version: "3.9"
28
+ install-method: mamba
29
+
30
+ - os: ubuntu-latest
31
+ python-version: "3.9"
32
+ install-method: pip
33
+
34
+ - os: macos-latest
35
+ python-version: "3.9"
36
+ install-method: mamba
37
+
38
+ - os: macos-latest
39
+ python-version: "3.9"
40
+ install-method: pip
41
+
42
+ - os: ubuntu-latest
43
+ python-version: "3.10"
44
+ install-method: mamba
45
+
46
+ - os: ubuntu-latest
47
+ python-version: "3.10"
48
+ install-method: pip
49
+
50
+ - os: ubuntu-latest
51
+ python-version: "3.11"
52
+ install-method: mamba
53
+
54
+ - os: ubuntu-latest
55
+ python-version: "3.11"
56
+ install-method: pip
57
+
58
+ defaults:
59
+ run:
60
+ shell: bash -leo pipefail {0}
61
+
62
+ steps:
63
+ - name: checkout
64
+ uses: actions/checkout@v3
65
+
66
+ - name: Set up Python ${{ matrix.python-version }}
67
+ uses: actions/setup-python@v4
68
+ with:
69
+ python-version: ${{ matrix.python-version }}
70
+
71
+ - name: Prepare mamba installation
72
+ if: matrix.install-method == 'mamba'
73
+ env:
74
+ PYTHON_VERSION: ${{ matrix.python-version }}
75
+ run: |
76
+ # setup correct python version
77
+ sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
78
+
79
+ - name: Install mamba dependencies
80
+ if: matrix.install-method == 'mamba'
81
+ uses: mamba-org/setup-micromamba@v1
82
+ with:
83
+ environment-file: environment.yml
84
+ create-args: python=${{ matrix.python-version }}
85
+ init-shell: bash
86
+
87
+ - name: Python setup
88
+ if: matrix.install-method == 'pip'
89
+ uses: actions/setup-python@v4
90
+ with:
91
+ python-version: ${{ matrix.python-version }}
92
+ check-latest: true
93
+
94
+ - if: ${{ matrix.install-method == 'pip' && runner.os == 'macOS' }}
95
+ name: Fix Python PATH on macOS
96
+ # from https://github.com/cta-observatory/ctapipe/blob/cfacbe1eeb2d9a4634980e5f1ef39b944bca6a7a/.github/workflows/ci.yml#L100
97
+ run: |
98
+ tee -a ~/.bash_profile <<<'export PATH="$pythonLocation/bin:$PATH"'
99
+
100
+ - name: Python dependencies
101
+ run: |
102
+ python --version
103
+ pip install '.[tests,dev,doc]'
104
+
105
+ - name: pyflakes liniting
106
+ run: |
107
+ pyflakes .
108
+
109
+ - name: Unit tests
110
+ shell: bash -l {0}
111
+ run: pytest --durations=10 --color=yes --cov --cov-report=xml
112
+
113
+ - uses: codecov/codecov-action@v3.1.4
@@ -0,0 +1,82 @@
1
+ # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
2
+ name: docker-corsika-simtelarray
3
+
4
+ on:
5
+ workflow_dispatch:
6
+
7
+ env:
8
+ REGISTRY: ghcr.io
9
+ IMAGE_NAME: ${{ github.repository }}
10
+
11
+ jobs:
12
+
13
+ corsikasimtelpackage:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: download corsikasimtelpackage
17
+ run: |
18
+ wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets.CLOUD_SIMTEL }}/download
19
+ mv download corsika7.7_simtelarray.tar.gz
20
+
21
+ - name: Publish Artifact
22
+ uses: actions/upload-artifact@v3
23
+ with:
24
+ name: corsika7.7_simtelarray.tar.gz
25
+ path: corsika7.7_simtelarray.tar.gz
26
+ retention-days: 1
27
+
28
+ build-simtools-container:
29
+ needs: corsikasimtelpackage
30
+ runs-on: ubuntu-latest
31
+ permissions:
32
+ contents: read
33
+ packages: write
34
+ strategy:
35
+ matrix:
36
+ type: ['simtelarray']
37
+
38
+ steps:
39
+ - name: Download Artifact
40
+ uses: actions/download-artifact@v3
41
+ with:
42
+ name: corsika7.7_simtelarray.tar.gz
43
+ path: corsika7.7_simtelarray.tar.gz
44
+
45
+ - name: Checkout repository
46
+ uses: actions/checkout@v3
47
+
48
+ - name: Set up QEMU
49
+ uses: docker/setup-qemu-action@v2
50
+
51
+ - name: Set up Docker Buildx
52
+ uses: docker/setup-buildx-action@v2
53
+
54
+ - name: Log in to the Container registry
55
+ uses: docker/login-action@v2
56
+ with:
57
+ registry: ${{ env.REGISTRY }}
58
+ username: ${{ github.actor }}
59
+ password: ${{ secrets.GITHUB_TOKEN }}
60
+
61
+ - name: Extract metadata (tags, labels) for Docker
62
+ id: meta
63
+ uses: docker/metadata-action@v4
64
+ with:
65
+ tags: |
66
+ type=ref,event=pr
67
+ type=semver,pattern={{major}}.{{minor}}.{{patch}}
68
+ type=schedule,pattern={{date 'YYYYMMDD'}}
69
+ type=raw,value={{date 'YYYYMMDD-HHmmss'}}
70
+ images: ${{ env.REGISTRY }}/gammasim/simtools-${{ matrix.type }}
71
+ flavor: latest=true
72
+
73
+ - name: Build and push Docker image
74
+ uses: docker/build-push-action@v4
75
+ with:
76
+ context: .
77
+ platforms: linux/amd64,linux/arm64/v8
78
+ push:
79
+ ${{ github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
80
+ file: ./docker/Dockerfile-${{ matrix.type }}
81
+ tags: ${{ steps.meta.outputs.tags }}
82
+ labels: ${{ steps.meta.outputs.labels }}-${{ matrix.type }}
@@ -0,0 +1,71 @@
1
+ # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
2
+ name: docker-simtools
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ push:
7
+ branches:
8
+ - main
9
+ tags:
10
+ - 'v*'
11
+ pull_request:
12
+ branches: ["main"]
13
+ release:
14
+ types: [published]
15
+ schedule:
16
+ - cron: '0 0 * * 0' # Every Sunday at 00:00 UTC
17
+
18
+ env:
19
+ REGISTRY: ghcr.io
20
+ IMAGE_NAME: ${{ github.repository }}
21
+
22
+ jobs:
23
+
24
+ build-simtools-container:
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: read
28
+ packages: write
29
+ strategy:
30
+ matrix:
31
+ type: ['dev', 'prod']
32
+
33
+ steps:
34
+ - name: Checkout repository
35
+ uses: actions/checkout@v3
36
+
37
+ - name: Set up QEMU
38
+ uses: docker/setup-qemu-action@v2
39
+
40
+ - name: Set up Docker Buildx
41
+ uses: docker/setup-buildx-action@v2
42
+
43
+ - name: Log in to the Container registry
44
+ uses: docker/login-action@v2
45
+ with:
46
+ registry: ${{ env.REGISTRY }}
47
+ username: ${{ github.actor }}
48
+ password: ${{ secrets.GITHUB_TOKEN }}
49
+
50
+ - name: Extract metadata (tags, labels) for Docker
51
+ id: meta
52
+ uses: docker/metadata-action@v4
53
+ with:
54
+ tags: |
55
+ type=ref,event=pr
56
+ type=semver,pattern={{major}}.{{minor}}.{{patch}}
57
+ type=schedule,pattern={{date 'YYYYMMDD'}}
58
+ type=raw,value={{date 'YYYYMMDD-HHmmss'}}
59
+ images: ${{ env.REGISTRY }}/gammasim/simtools-${{ matrix.type }}
60
+ flavor: latest=true
61
+
62
+ - name: Build and push Docker image
63
+ uses: docker/build-push-action@v4
64
+ with:
65
+ context: .
66
+ platforms: linux/amd64,linux/arm64/v8
67
+ push:
68
+ ${{ github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
69
+ file: ./docker/Dockerfile-${{ matrix.type }}
70
+ tags: ${{ steps.meta.outputs.tags }}
71
+ labels: ${{ steps.meta.outputs.labels }}-${{ matrix.type }}
@@ -0,0 +1,33 @@
1
+ # Derived from https://github.com/cta-observatory/project-template-python-pure/blob/main/.github/workflows/pypi.yml
2
+ name: Deploy to PyPi
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - 'v*'
8
+
9
+ jobs:
10
+ deploy:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+
15
+ # make sure we have version info
16
+ - run: git fetch --tags
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: "3.9"
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ python --version
26
+ pip install -U build
27
+ python -m build
28
+
29
+ - name: Publish package
30
+ uses: pypa/gh-action-pypi-publish@release/v1
31
+ with:
32
+ user: __token__
33
+ password: ${{ secrets.pypi_token }}
@@ -0,0 +1,33 @@
1
+ # Compiled files
2
+ *.py[co]
3
+ *.a
4
+ *.o
5
+ *.so
6
+ __pycache__
7
+
8
+ # Sphinx
9
+ docs/build
10
+
11
+ # DB config gfile
12
+ dbDetails.yml
13
+
14
+ # set environment
15
+ set_env_db.sh
16
+
17
+ # Mac users
18
+ .DS_Store
19
+
20
+ telarray_rand.conf*
21
+
22
+ # Distribution / packaging
23
+ build/
24
+ *.egg-info/
25
+ .egg
26
+
27
+ # Generic output path of
28
+ # simtools data products
29
+ simtools-output
30
+
31
+ # Dynamic version file
32
+ # generated by setuptools_scm
33
+ simtools/_version.py
@@ -0,0 +1,3 @@
1
+ RaulRPrado <raul.prado@desy.de> RaulRPrado <raul.prado@usp.br>
2
+ RaulRPrado <raul.prado@desy.de> RaulRPrado <raul.ribeiro.prado@gmail.com>
3
+ RaulRPrado <raul.prado@desy.de> RaulRPrado <32486249+RaulRPrado@users.noreply.github.com>
@@ -0,0 +1,30 @@
1
+ repos:
2
+ # https://pycqa.github.io/isort/docs/configuration/black_compatibility.html#integration-with-pre-commit
3
+ - repo: https://github.com/pycqa/isort
4
+ rev: 5.12.0
5
+ hooks:
6
+ - id: isort
7
+ args: ["--profile", "black", "--filter-files"]
8
+ - repo: https://github.com/psf/black
9
+ rev: 23.7.0
10
+ hooks:
11
+ - id: black
12
+ args: ["--line-length=100"]
13
+ # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#flake8
14
+ - repo: https://github.com/PyCQA/flake8
15
+ rev: 6.1.0
16
+ hooks:
17
+ - id: flake8
18
+ args: ["--max-line-length=100", "--extend-ignore=E203,E712"]
19
+ # https://github.com/pre-commit/pre-commit-hooks
20
+ - repo: https://github.com/pre-commit/pre-commit-hooks
21
+ rev: v4.4.0
22
+ hooks:
23
+ - id: trailing-whitespace
24
+ - id: end-of-file-fixer
25
+ # https://github.com/HunterMcGushion/docstr_coverage
26
+ - repo: https://github.com/HunterMcGushion/docstr_coverage
27
+ rev: v2.3.0 # most recent docstr-coverage release or commit sha
28
+ hooks:
29
+ - id: docstr-coverage
30
+ args: ["--verbose", "2", "--fail-under", "70.", "simtools"]
@@ -0,0 +1,31 @@
1
+ # This CITATION.cff file was generated with cffinit.
2
+ # Visit https://bit.ly/cffinit to generate yours today!
3
+
4
+ cff-version: 1.2.0
5
+ title: >-
6
+ simtools - a prototype implementation of
7
+ tools for the Simulation System of the CTA
8
+ Observatory
9
+ message: Please cite this software using these metadata.
10
+ type: software
11
+ authors:
12
+ - orcid: 'https://orcid.org/0000-0001-9152-2995'
13
+ affiliation: DESY
14
+ given-names: Raul
15
+ name-particle: R.
16
+ family-names: Prado
17
+ - given-names: Orel
18
+ family-names: Gueta
19
+ orcid: 'https://orcid.org/0000-0002-9440-2398'
20
+ affiliation: DESY
21
+ - given-names: Victor
22
+ family-names: Barbosa Martins
23
+ orcid: 'https://orcid.org/0000-0002-5085-8828'
24
+ affiliation: DESY
25
+ - given-names: Gernot
26
+ family-names: Maier
27
+ affiliation: DESY
28
+ orcid: 'https://orcid.org/0000-0001-9868-4700'
29
+ repository-code: 'https://github.com/gammasim/simtools'
30
+ doi: 10.5281/zenodo.6346697
31
+ license: BSD-3-Clause
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2020, gammasim-tools, simtools developers
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.