struphy 3.3.0__tar.gz → 3.4.0__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 (466) hide show
  1. {struphy-3.3.0/src/struphy.egg-info → struphy-3.4.0}/PKG-INFO +18 -7
  2. {struphy-3.3.0 → struphy-3.4.0}/README.md +2 -0
  3. {struphy-3.3.0 → struphy-3.4.0}/pyproject.toml +21 -8
  4. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/__init__.py +88 -32
  5. struphy-3.4.0/src/struphy/api/post_processing/__init__.py +3 -0
  6. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/compile_struphy.mk +1 -1
  7. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/compile.py +69 -19
  8. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/format.py +91 -22
  9. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/main.py +43 -18
  10. struphy-3.4.0/src/struphy/console/output.py +47 -0
  11. struphy-3.4.0/src/struphy/console/params.py +69 -0
  12. struphy-3.4.0/src/struphy/console/profile.py +91 -0
  13. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/test.py +2 -0
  14. struphy-3.4.0/src/struphy/console/tests/test_compile.py +214 -0
  15. struphy-3.4.0/src/struphy/console/tests/test_format.py +38 -0
  16. struphy-3.4.0/src/struphy/console/tests/test_params_profile.py +61 -0
  17. struphy-3.4.0/src/struphy/console/tests/test_state.py +22 -0
  18. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/tests/xx_test_console.py +1 -1
  19. struphy-3.4.0/src/struphy/dependencies.py +135 -0
  20. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/dispersion_relations/analytic.py +38 -26
  21. struphy-3.4.0/src/struphy/dispersion_relations/tests/test_analytic.py +80 -0
  22. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/basis_projection_ops.py +26 -24
  23. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/linear_operators.py +2 -0
  24. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/mass.py +169 -136
  25. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/mass_kernels.py +42 -40
  26. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/preconditioner.py +37 -37
  27. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/projectors.py +6 -5
  28. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/psydac_derham.py +66 -14
  29. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_basis_ops.py +126 -1
  30. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_estimate_mem.py +15 -0
  31. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_eval_field.py +40 -0
  32. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_field_init.py +68 -2
  33. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_l2_projectors.py +54 -5
  34. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_local_projectors.py +91 -0
  35. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_mass_matrices.py +258 -0
  36. struphy-3.4.0/src/struphy/feec/tests/test_mass_reassembly.py +41 -0
  37. struphy-3.4.0/src/struphy/feec/tests/test_preconditioner_transpose.py +59 -0
  38. struphy-3.4.0/src/struphy/feec/tests/test_utilities_kernels.py +41 -0
  39. struphy-3.4.0/src/struphy/feec/tests/test_variational_utilities.py +52 -0
  40. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/utilities.py +19 -6
  41. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/utilities_kernels.py +1 -1
  42. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/utilities_local_projectors.py +2 -2
  43. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/variational_utilities.py +14 -0
  44. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/base.py +10 -14
  45. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/coil_fields/coil_fields.py +1 -1
  46. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/equils.py +54 -36
  47. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/projected_equils.py +18 -5
  48. struphy-3.4.0/src/struphy/fields_background/tests/test_adhoc_tokamak_equils.py +45 -0
  49. struphy-3.4.0/src/struphy/fields_background/tests/test_axisymm_gradB.py +36 -0
  50. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/tests/test_generic_equils.py +15 -1
  51. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/tests/test_mhd_equils.py +89 -0
  52. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/base.py +110 -51
  53. struphy-3.4.0/src/struphy/geometry/domains/__init__.py +76 -0
  54. struphy-3.4.0/src/struphy/geometry/domains/colella/__init__.py +18 -0
  55. struphy-3.4.0/src/struphy/geometry/domains/colella/colella.py +51 -0
  56. struphy-3.4.0/src/struphy/geometry/domains/colella/colella_kernels.py +58 -0
  57. struphy-3.4.0/src/struphy/geometry/domains/cuboid/__init__.py +18 -0
  58. struphy-3.4.0/src/struphy/geometry/domains/cuboid/cuboid.py +57 -0
  59. struphy-3.4.0/src/struphy/geometry/domains/cuboid/cuboid_kernels.py +63 -0
  60. struphy-3.4.0/src/struphy/geometry/domains/desc_unit/__init__.py +18 -0
  61. struphy-3.4.0/src/struphy/geometry/domains/desc_unit/desc_unit.py +50 -0
  62. struphy-3.4.0/src/struphy/geometry/domains/gvec_unit/__init__.py +18 -0
  63. struphy-3.4.0/src/struphy/geometry/domains/gvec_unit/gvec_unit.py +64 -0
  64. struphy-3.4.0/src/struphy/geometry/domains/hollow_cylinder/__init__.py +18 -0
  65. struphy-3.4.0/src/struphy/geometry/domains/hollow_cylinder/hollow_cylinder.py +55 -0
  66. struphy-3.4.0/src/struphy/geometry/domains/hollow_cylinder/hollow_cylinder_kernels.py +61 -0
  67. struphy-3.4.0/src/struphy/geometry/domains/hollow_torus/__init__.py +18 -0
  68. struphy-3.4.0/src/struphy/geometry/domains/hollow_torus/hollow_torus.py +114 -0
  69. struphy-3.4.0/src/struphy/geometry/domains/hollow_torus/hollow_torus_kernels.py +160 -0
  70. struphy-3.4.0/src/struphy/geometry/domains/iga_polar_cylinder/__init__.py +18 -0
  71. struphy-3.4.0/src/struphy/geometry/domains/iga_polar_cylinder/iga_polar_cylinder.py +62 -0
  72. struphy-3.4.0/src/struphy/geometry/domains/iga_polar_torus/__init__.py +18 -0
  73. struphy-3.4.0/src/struphy/geometry/domains/iga_polar_torus/iga_polar_torus.py +86 -0
  74. struphy-3.4.0/src/struphy/geometry/domains/orthogonal/__init__.py +18 -0
  75. struphy-3.4.0/src/struphy/geometry/domains/orthogonal/orthogonal.py +51 -0
  76. struphy-3.4.0/src/struphy/geometry/domains/orthogonal/orthogonal_kernels.py +58 -0
  77. struphy-3.4.0/src/struphy/geometry/domains/powered_elliptic_cylinder/__init__.py +18 -0
  78. struphy-3.4.0/src/struphy/geometry/domains/powered_elliptic_cylinder/powered_elliptic_cylinder.py +51 -0
  79. struphy-3.4.0/src/struphy/geometry/domains/powered_elliptic_cylinder/powered_elliptic_cylinder_kernels.py +72 -0
  80. struphy-3.4.0/src/struphy/geometry/domains/shafranov_dshaped_cylinder/__init__.py +20 -0
  81. struphy-3.4.0/src/struphy/geometry/domains/shafranov_dshaped_cylinder/shafranov_dshaped_cylinder.py +60 -0
  82. struphy-3.4.0/src/struphy/geometry/domains/shafranov_dshaped_cylinder/shafranov_dshaped_cylinder_kernels.py +101 -0
  83. struphy-3.4.0/src/struphy/geometry/domains/shafranov_shift_cylinder/__init__.py +18 -0
  84. struphy-3.4.0/src/struphy/geometry/domains/shafranov_shift_cylinder/shafranov_shift_cylinder.py +51 -0
  85. struphy-3.4.0/src/struphy/geometry/domains/shafranov_shift_cylinder/shafranov_shift_cylinder_kernels.py +73 -0
  86. struphy-3.4.0/src/struphy/geometry/domains/shafranov_sqrt_cylinder/__init__.py +18 -0
  87. struphy-3.4.0/src/struphy/geometry/domains/shafranov_sqrt_cylinder/shafranov_sqrt_cylinder.py +51 -0
  88. struphy-3.4.0/src/struphy/geometry/domains/shafranov_sqrt_cylinder/shafranov_sqrt_cylinder_kernels.py +73 -0
  89. struphy-3.4.0/src/struphy/geometry/domains/tokamak/__init__.py +18 -0
  90. struphy-3.4.0/src/struphy/geometry/domains/tokamak/tokamak.py +126 -0
  91. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/evaluation_kernels.py +34 -25
  92. struphy-3.4.0/src/struphy/geometry/spline_mappings_kernels.py +485 -0
  93. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/tests/test_domain.py +197 -0
  94. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/transform_kernels.py +38 -1
  95. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/utilities.py +3 -2
  96. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/base.py +3 -11
  97. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/eigenfunctions.py +2 -2
  98. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/perturbations.py +24 -20
  99. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/tests/test_init_perturbations.py +48 -0
  100. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/io/output_handling.py +19 -18
  101. struphy-3.4.0/src/struphy/io/tests/test_output_handling.py +51 -0
  102. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kernel_arguments/pusher_args_kernels.py +7 -0
  103. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kinetic_background/base.py +45 -27
  104. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kinetic_background/maxwellians.py +55 -38
  105. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kinetic_background/moment_functions.py +1 -1
  106. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kinetic_background/tests/test_base.py +20 -0
  107. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kinetic_background/tests/test_maxwellians.py +67 -0
  108. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/linalg_kron.py +8 -2
  109. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/saddle_point.py +41 -29
  110. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/tests/test_saddlepoint_massmatrices.py +42 -0
  111. struphy-3.4.0/src/struphy/models/__init__.py +138 -0
  112. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/base.py +152 -31
  113. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/drift_kinetic_electrostatic_adiabatic.py +4 -2
  114. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/guiding_center.py +3 -5
  115. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/hasegawa_wakatani.py +3 -16
  116. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_extended_mh_duniform.py +11 -3
  117. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_mhd.py +12 -3
  118. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_mhd_driftkinetic_cc.py +2 -2
  119. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_vlasov_ampere_one_species.py +8 -6
  120. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_vlasov_maxwell_one_species.py +18 -2
  121. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/scalars.py +41 -21
  122. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/species.py +38 -0
  123. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/default_params/test_models.py +16 -0
  124. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/test_examples.py +6 -1
  125. struphy-3.4.0/src/struphy/models/tests/test_hasegawa_wakatani.py +8 -0
  126. struphy-3.4.0/src/struphy/models/tests/test_scalars.py +219 -0
  127. struphy-3.4.0/src/struphy/models/tests/test_variational_dissipation.py +48 -0
  128. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/utils_testing.py +32 -6
  129. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_IncompressibleNavierStokesSPH.py +20 -41
  130. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_LinearMHD.py +43 -45
  131. struphy-3.4.0/src/struphy/models/tests/verification/test_verif_LinearVlasovAmpereOneSpecies.py +212 -0
  132. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_Maxwell.py +58 -44
  133. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_Poisson.py +8 -14
  134. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_ViscousEulerSPH.py +54 -63
  135. struphy-3.4.0/src/struphy/models/tests/verification/test_verif_VlasovMaxwellOneSpecies.py +106 -0
  136. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/variables.py +18 -2
  137. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_mhd_with_p.py +17 -1
  138. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/vlasov_ampere_one_species.py +2 -2
  139. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/vlasov_maxwell_one_species.py +23 -19
  140. struphy-3.4.0/src/struphy/ode/tests/test_butcher.py +48 -0
  141. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/ode/utils.py +15 -1
  142. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/particles/parameters.py +1 -1
  143. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/physics/physics.py +1 -1
  144. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/accum_kernels.py +6 -3
  145. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/accum_kernels_gc.py +7 -2
  146. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/particles_to_grid.py +44 -97
  147. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/base.py +273 -190
  148. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/particles.py +48 -4
  149. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/eval_kernels_gc.py +27 -36
  150. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/eval_kernels_sph.py +65 -33
  151. struphy-3.4.0/src/struphy/pic/pushing/kernel_setup.py +82 -0
  152. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/pusher.py +119 -129
  153. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/pusher_kernels.py +35 -729
  154. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/pusher_kernels_gc.py +50 -7
  155. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/pushing/pusher_kernels_sph.py +18 -22
  156. struphy-3.4.0/src/struphy/pic/pushing/pusher_utilities_kernels.py +194 -0
  157. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sobol_seq.py +3 -2
  158. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sorting.py +5 -9
  159. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sph_eval_kernels.py +5 -4
  160. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sph_smoothing_kernels.py +10 -4
  161. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/_bench_push_vxb_analytic.py +1 -0
  162. struphy-3.4.0/src/struphy/pic/tests/test_accum_gc_gradB.py +78 -0
  163. struphy-3.4.0/src/struphy/pic/tests/test_accum_pressure_coupling.py +70 -0
  164. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_draw_parallel.py +47 -0
  165. struphy-3.4.0/src/struphy/pic/tests/test_gc_epsilon.py +13 -0
  166. struphy-3.4.0/src/struphy/pic/tests/test_kernel_backends.py +406 -0
  167. struphy-3.4.0/src/struphy/pic/tests/test_kernel_setup.py +280 -0
  168. struphy-3.4.0/src/struphy/pic/tests/test_load_external.py +43 -0
  169. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_neighbor_ranks.py +32 -0
  170. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_pushers.py +110 -0
  171. struphy-3.4.0/src/struphy/pic/tests/test_show_distribution.py +76 -0
  172. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_sorting.py +41 -0
  173. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_sph.py +71 -0
  174. struphy-3.4.0/src/struphy/pic/tests/test_utilities.py +45 -0
  175. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/utilities.py +13 -15
  176. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/polar/extraction_operators.py +0 -309
  177. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/polar/linear_operators.py +29 -25
  178. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/polar/tests/test_polar.py +94 -0
  179. struphy-3.4.0/src/struphy/post_processing/arrays.py +229 -0
  180. struphy-3.4.0/src/struphy/post_processing/manifest.py +102 -0
  181. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/orbits/orbits_tools.py +27 -39
  182. struphy-3.4.0/src/struphy/post_processing/output.py +2645 -0
  183. struphy-3.4.0/src/struphy/post_processing/profiling.py +138 -0
  184. struphy-3.4.0/src/struphy/post_processing/si.py +65 -0
  185. struphy-3.4.0/src/struphy/post_processing/store.py +64 -0
  186. struphy-3.4.0/src/struphy/post_processing/tests/test_arrays.py +102 -0
  187. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/tests/test_eval_grids.py +6 -6
  188. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/tests/test_eval_grids_mpi.py +20 -20
  189. struphy-3.4.0/src/struphy/post_processing/tests/test_orbits_tools.py +56 -0
  190. struphy-3.4.0/src/struphy/post_processing/tests/test_output.py +888 -0
  191. struphy-3.4.0/src/struphy/post_processing/tests/test_pproc.py +102 -0
  192. struphy-3.4.0/src/struphy/propagators/__init__.py +156 -0
  193. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/base.py +24 -98
  194. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/curl_curl_solve.py +11 -13
  195. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/current_coupling_5d_curlb.py +13 -6
  196. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/current_coupling_5d_density.py +2 -1
  197. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/current_coupling_5d_gradb.py +40 -16
  198. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/current_coupling_6d_current.py +1 -0
  199. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/efield_weights_coupling.py +8 -4
  200. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/faraday_extended.py +11 -0
  201. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/hasegawa_wakatani_step.py +5 -1
  202. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/implicit_diffusion.py +27 -29
  203. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/magnetosonic.py +7 -2
  204. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/pressure_coupling_6d.py +3 -1
  205. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_deterministic_diffusion.py +1 -0
  206. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_eta.py +2 -1
  207. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_eta_pc.py +1 -0
  208. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_guiding_center_bx_estar.py +115 -102
  209. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_guiding_center_parallel.py +119 -106
  210. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_random_diffusion.py +6 -3
  211. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_v_in_force_field.py +1 -0
  212. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_v_in_sph_pressure.py +7 -5
  213. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_v_in_viscous_potential.py +22 -10
  214. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/push_vxb.py +1 -0
  215. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/tests/test_curl_curl.py +47 -0
  216. struphy-3.4.0/src/struphy/propagators/tests/test_current_coupling_5d.py +61 -0
  217. struphy-3.4.0/src/struphy/propagators/tests/test_current_coupling_5d_options.py +31 -0
  218. struphy-3.4.0/src/struphy/propagators/tests/test_magnetosonic.py +42 -0
  219. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/tests/test_poisson.py +129 -0
  220. struphy-3.4.0/src/struphy/propagators/tests/test_pressure_coupling_6d.py +31 -0
  221. struphy-3.4.0/src/struphy/propagators/tests/test_push_random_diffusion.py +50 -0
  222. struphy-3.4.0/src/struphy/propagators/tests/test_two_fluid_quasi_neutral_full.py +96 -0
  223. struphy-3.4.0/src/struphy/propagators/tests/test_variational_density_evolve.py +49 -0
  224. struphy-3.4.0/src/struphy/propagators/tests/test_variational_mag_field_evolve.py +99 -0
  225. struphy-3.4.0/src/struphy/propagators/tests/test_variational_qb_evolve.py +44 -0
  226. struphy-3.4.0/src/struphy/propagators/tests/test_variational_solver_option.py +49 -0
  227. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/two_fluid_quasi_neutral_full.py +9 -3
  228. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_density_evolve.py +24 -13
  229. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_entropy_evolve.py +1 -4
  230. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_mag_field_evolve.py +2 -5
  231. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_momentum_advection.py +9 -9
  232. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_pb_evolve.py +1 -4
  233. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_qb_evolve.py +3 -5
  234. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_resistivity.py +12 -7
  235. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/variational_viscosity.py +11 -6
  236. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/vlasov_ampere_coupling.py +2 -1
  237. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/simulation/base.py +7 -9
  238. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/simulation/sim.py +440 -147
  239. struphy-3.4.0/src/struphy/simulation/tests/test_output.py +477 -0
  240. struphy-3.4.0/src/struphy/simulation/tests/test_sim_comm_mpi.py +50 -0
  241. struphy-3.4.0/src/struphy/utils/__init__.py +0 -0
  242. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/compiler.py +12 -0
  243. struphy-3.4.0/src/struphy/utils/cuda_arguments.py +212 -0
  244. struphy-3.4.0/src/struphy/utils/ipython_compat.py +31 -0
  245. struphy-3.4.0/src/struphy/utils/kernel_backends.py +233 -0
  246. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/utils.py +38 -8
  247. {struphy-3.3.0 → struphy-3.4.0/src/struphy.egg-info}/PKG-INFO +18 -7
  248. {struphy-3.3.0 → struphy-3.4.0}/src/struphy.egg-info/SOURCES.txt +94 -12
  249. struphy-3.4.0/src/struphy.egg-info/entry_points.txt +2 -0
  250. {struphy-3.3.0 → struphy-3.4.0}/src/struphy.egg-info/requires.txt +17 -6
  251. struphy-3.3.0/src/struphy/api/post_processing/__init__.py +0 -3
  252. struphy-3.3.0/src/struphy/console/params.py +0 -49
  253. struphy-3.3.0/src/struphy/console/profile.py +0 -228
  254. struphy-3.3.0/src/struphy/dependencies.py +0 -96
  255. struphy-3.3.0/src/struphy/diagnostics/console_diagn.py +0 -411
  256. struphy-3.3.0/src/struphy/diagnostics/diagn_tools.py +0 -1088
  257. struphy-3.3.0/src/struphy/diagnostics/paraview/mesh_creator.py +0 -323
  258. struphy-3.3.0/src/struphy/diagnostics/paraview/vtk_writer.py +0 -88
  259. struphy-3.3.0/src/struphy/geometry/domains.py +0 -898
  260. struphy-3.3.0/src/struphy/geometry/mappings_kernels.py +0 -1166
  261. struphy-3.3.0/src/struphy/models/__init__.py +0 -81
  262. struphy-3.3.0/src/struphy/pic/pushing/pusher_utilities_kernels.py +0 -79
  263. struphy-3.3.0/src/struphy/post_processing/cprofile_analyser.py +0 -190
  264. struphy-3.3.0/src/struphy/post_processing/post_processing_tools.py +0 -1580
  265. struphy-3.3.0/src/struphy/post_processing/profile_struphy.py +0 -175
  266. struphy-3.3.0/src/struphy/post_processing/tests/test_pproc.py +0 -108
  267. struphy-3.3.0/src/struphy/propagators/__init__.py +0 -91
  268. struphy-3.3.0/src/struphy/utils/mpi_launch.py +0 -82
  269. struphy-3.3.0/src/struphy.egg-info/entry_points.txt +0 -3
  270. {struphy-3.3.0 → struphy-3.4.0}/LICENSE +0 -0
  271. {struphy-3.3.0 → struphy-3.4.0}/setup.cfg +0 -0
  272. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/__init__.py +0 -0
  273. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/compiler/__init__.py +0 -0
  274. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/domains/__init__.py +0 -0
  275. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/equils/__init__.py +0 -0
  276. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/grids/__init__.py +0 -0
  277. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/maxwellians/__init__.py +0 -0
  278. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/models/__init__.py +0 -0
  279. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/ode/__init__.py +0 -0
  280. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/options/__init__.py +0 -0
  281. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/particles/__init__.py +0 -0
  282. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/perturbations/__init__.py +0 -0
  283. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/api/simulation/__init__.py +0 -0
  284. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/__init__.py +0 -0
  285. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/bsplines.py +0 -0
  286. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/bsplines_kernels.py +0 -0
  287. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/evaluation_kernels_1d.py +0 -0
  288. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/evaluation_kernels_2d.py +0 -0
  289. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/evaluation_kernels_3d.py +0 -0
  290. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/shapefunc_kernels.py +0 -0
  291. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/tests/__init__.py +0 -0
  292. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/tests/test_bsplines_kers.py +0 -0
  293. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/bsplines/tests/test_eval_spline_mpi.py +0 -0
  294. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/conftest.py +0 -0
  295. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/__init__.py +0 -0
  296. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/likwid.py +0 -0
  297. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/console/parsers.py +0 -0
  298. {struphy-3.3.0/src/struphy/diagnostics → struphy-3.4.0/src/struphy/diagnostics/tests}/__init__.py +0 -0
  299. {struphy-3.3.0/src/struphy/diagnostics/paraview → struphy-3.4.0/src/struphy/dispersion_relations}/__init__.py +0 -0
  300. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/dispersion_relations/base.py +0 -0
  301. {struphy-3.3.0/src/struphy/dispersion_relations → struphy-3.4.0/src/struphy/dispersion_relations/tests}/__init__.py +0 -0
  302. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/dispersion_relations/utilities.py +0 -0
  303. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/eigenvalue_solvers/derivatives.py +0 -0
  304. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/examples/_draw_parallel.py +0 -0
  305. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/examples/restelli2018/__init__.py +0 -0
  306. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/examples/restelli2018/callables.py +0 -0
  307. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/__init__.py +0 -0
  308. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/banded_to_stencil_kernels.py +0 -0
  309. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/basis_projection_kernels.py +0 -0
  310. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/boundary_mass.py +0 -0
  311. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/local_projectors_kernels.py +0 -0
  312. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/memory.py +0 -0
  313. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/__init__.py +0 -0
  314. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_boundary_integrals.py +0 -0
  315. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_derham.py +0 -0
  316. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_local_matrix_vector.py +0 -0
  317. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_lowdim_nel_is_1.py +0 -0
  318. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_toarray_struphy.py +0 -0
  319. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/test_tosparse_struphy.py +0 -0
  320. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/feec/tests/xx_test_preconds.py +0 -0
  321. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/__init__.py +0 -0
  322. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/coil_fields/__init__.py +0 -0
  323. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/coil_fields/base.py +0 -0
  324. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/__init__.py +0 -0
  325. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/eqdsk/__init__.py +0 -0
  326. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/eqdsk/data/AUGNLED_g031213.00830.high +0 -0
  327. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/eqdsk/data/__init__.py +0 -0
  328. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/eqdsk/readeqdsk.py +0 -0
  329. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/__init__.py +0 -0
  330. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/output/__init__.py +0 -0
  331. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/output/vtk/__init__.py +0 -0
  332. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_01/CIRCTOK_State_0000_00000000.dat +0 -0
  333. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_01/CIRCTOK_State_0000_00001000.dat +0 -0
  334. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_01/parameter.ini +0 -0
  335. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_02/W7X_State_0000_00000000.dat +0 -0
  336. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_02/W7X_State_0000_00000100.dat +0 -0
  337. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_02/parameter-w7x.ini +0 -0
  338. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_03/NEO-SPITZER_State_0000_00000000.dat +0 -0
  339. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_03/NEO-SPITZER_State_0000_00003307.dat +0 -0
  340. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_03/Neo-spitzer-mirror23-well-opt-1-AR10-1.nc +0 -0
  341. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/gvec/run_03/parameter-fig8.ini +0 -0
  342. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/mhd_equil/vmec/__init__.py +0 -0
  343. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/tests/__init__.py +0 -0
  344. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/tests/test_desc_equil.py +0 -0
  345. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/fields_background/tests/test_numerical_mhd_equil.py +0 -0
  346. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/__init__.py +0 -0
  347. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/map_coef/__init__.py +0 -0
  348. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/tests/__init__.py +0 -0
  349. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/geometry/utilities_kernels.py +0 -0
  350. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/__init__.py +0 -0
  351. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/tests/__init__.py +0 -0
  352. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/initial/utilities.py +0 -0
  353. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/io/__init__.py +0 -0
  354. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/io/options.py +0 -0
  355. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/io/setup.py +0 -0
  356. {struphy-3.3.0/src/struphy/kernel_arguments → struphy-3.4.0/src/struphy/io/tests}/__init__.py +0 -0
  357. {struphy-3.3.0/src/struphy/kinetic_background → struphy-3.4.0/src/struphy/kernel_arguments}/__init__.py +0 -0
  358. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/kernel_arguments/local_projectors_args_kernels.py +0 -0
  359. {struphy-3.3.0/src/struphy/kinetic_background/tests → struphy-3.4.0/src/struphy/kinetic_background}/__init__.py +0 -0
  360. {struphy-3.3.0/src/struphy/linear_algebra → struphy-3.4.0/src/struphy/kinetic_background/tests}/__init__.py +0 -0
  361. {struphy-3.3.0/src/struphy/linear_algebra/tests → struphy-3.4.0/src/struphy/linear_algebra}/__init__.py +0 -0
  362. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/linalg_kernels.py +0 -0
  363. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/schur_solver.py +0 -0
  364. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/solver.py +0 -0
  365. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/stencil_dot_kernels.py +0 -0
  366. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/stencil_transpose_kernels.py +0 -0
  367. {struphy-3.3.0/src/struphy/models → struphy-3.4.0/src/struphy/linear_algebra}/tests/__init__.py +0 -0
  368. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/tests/test_saddle_point_propagator.py +0 -0
  369. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/tests/test_stencil_dot_kers.py +0 -0
  370. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/linear_algebra/tests/test_stencil_transpose_kers.py +0 -0
  371. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/cold_plasma.py +0 -0
  372. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/cold_plasma_vlasov.py +0 -0
  373. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/deterministic_particle_diffusion.py +0 -0
  374. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/incompressible_navier_stokes_sph.py +0 -0
  375. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_mhd_vlasov_cc.py +0 -0
  376. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/linear_mhd_vlasov_pc.py +0 -0
  377. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/maxwell.py +0 -0
  378. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/poisson.py +0 -0
  379. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/pressure_less_sph.py +0 -0
  380. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/random_particle_diffusion.py +0 -0
  381. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/shear_alfven.py +0 -0
  382. {struphy-3.3.0/src/struphy/models/tests/default_params → struphy-3.4.0/src/struphy/models/tests}/__init__.py +0 -0
  383. {struphy-3.3.0/src/struphy/models/tests/verification → struphy-3.4.0/src/struphy/models/tests/default_params}/__init__.py +0 -0
  384. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/test_estimate_mem.py +0 -0
  385. {struphy-3.3.0/src/struphy/ode → struphy-3.4.0/src/struphy/models/tests/verification}/__init__.py +0 -0
  386. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/tests/verification/test_verif_VlasovAmpereOneSpecies.py +0 -0
  387. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/toy_drift.py +0 -0
  388. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/two_fluid_quasi_neutral_toy.py +0 -0
  389. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/utils.py +0 -0
  390. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/variational_barotropic_fluid.py +0 -0
  391. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/variational_compressible_fluid.py +0 -0
  392. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/variational_pressureless_fluid.py +0 -0
  393. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_deltaf_mhd.py +0 -0
  394. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_deltaf_mhd_with_q.py +0 -0
  395. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_linear_mhd.py +0 -0
  396. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_linear_mhd_with_q.py +0 -0
  397. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_mhd.py +0 -0
  398. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/visco_resistive_mhd_with_q.py +0 -0
  399. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/viscous_euler_sph.py +0 -0
  400. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/viscous_fluid.py +0 -0
  401. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/models/vlasov.py +0 -0
  402. {struphy-3.3.0/src/struphy/ode/tests → struphy-3.4.0/src/struphy/ode}/__init__.py +0 -0
  403. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/ode/solvers.py +0 -0
  404. {struphy-3.3.0/src/struphy/particles → struphy-3.4.0/src/struphy/ode/tests}/__init__.py +0 -0
  405. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/ode/tests/test_ode_feec.py +0 -0
  406. {struphy-3.3.0/src/struphy/physics → struphy-3.4.0/src/struphy/particles}/__init__.py +0 -0
  407. {struphy-3.3.0/src/struphy/pic → struphy-3.4.0/src/struphy/physics}/__init__.py +0 -0
  408. {struphy-3.3.0/src/struphy/pic/accumulation → struphy-3.4.0/src/struphy/pic}/__init__.py +0 -0
  409. {struphy-3.3.0/src/struphy/pic/pushing → struphy-3.4.0/src/struphy/pic/accumulation}/__init__.py +0 -0
  410. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/filler_kernels.py +0 -0
  411. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/filter.py +0 -0
  412. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/filter_kernels.py +0 -0
  413. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/accumulation/particle_to_mat_kernels.py +0 -0
  414. {struphy-3.3.0/src/struphy/pic/tests → struphy-3.4.0/src/struphy/pic/pushing}/__init__.py +0 -0
  415. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sampling_kernels.py +0 -0
  416. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/sorting_kernels.py +0 -0
  417. {struphy-3.3.0/src/struphy/polar → struphy-3.4.0/src/struphy/pic/tests}/__init__.py +0 -0
  418. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/bench_openmp_speedup.py +0 -0
  419. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_accum_vec_H1.py +0 -0
  420. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_binning.py +0 -0
  421. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_estimate_mem.py +0 -0
  422. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_mat_vec_filler.py +0 -0
  423. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_pusher_openmp_speedup.py +0 -0
  424. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_set_zero_velocity.py +0 -0
  425. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/tests/test_tesselation.py +0 -0
  426. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/pic/utilities_kernels.py +0 -0
  427. {struphy-3.3.0/src/struphy/polar/tests → struphy-3.4.0/src/struphy/polar}/__init__.py +0 -0
  428. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/polar/basic.py +0 -0
  429. {struphy-3.3.0/src/struphy/post_processing → struphy-3.4.0/src/struphy/polar/tests}/__init__.py +0 -0
  430. {struphy-3.3.0/src/struphy/post_processing/likwid → struphy-3.4.0/src/struphy/post_processing}/__init__.py +0 -0
  431. {struphy-3.3.0/src/struphy/post_processing/orbits → struphy-3.4.0/src/struphy/post_processing/likwid}/__init__.py +0 -0
  432. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/likwid/hardware_dicts.py +0 -0
  433. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/likwid/likwid_parser.py +0 -0
  434. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/likwid/maxplotlylib.py +0 -0
  435. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/likwid/plot_likwidproject.py +0 -0
  436. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/likwid/roofline_plotter.py +0 -0
  437. {struphy-3.3.0/src/struphy/post_processing/tests → struphy-3.4.0/src/struphy/post_processing/orbits}/__init__.py +0 -0
  438. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/post_processing/orbits/orbits_kernels.py +0 -0
  439. {struphy-3.3.0/src/struphy/propagators → struphy-3.4.0/src/struphy/post_processing}/tests/__init__.py +0 -0
  440. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/adiabatic_phi.py +0 -0
  441. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/current_coupling_6d_density.py +0 -0
  442. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/hall.py +0 -0
  443. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/jxb_cold.py +0 -0
  444. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/magnetosonic_uniform.py +0 -0
  445. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/maxwell_weak_ampere.py +0 -0
  446. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/ohm_cold.py +0 -0
  447. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/poisson_adiabatic_gyrokinetic.py +0 -0
  448. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/poisson_solve.py +0 -0
  449. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/shear_alfven_b1.py +0 -0
  450. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/shear_alfven_current_coupling_5d.py +0 -0
  451. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/shear_alfven_propagator.py +0 -0
  452. {struphy-3.3.0/src/struphy/simulation → struphy-3.4.0/src/struphy/propagators/tests}/__init__.py +0 -0
  453. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/tests/test_gyrokinetic_poisson.py +0 -0
  454. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/propagators/time_dependent_source.py +0 -0
  455. {struphy-3.3.0/src/struphy/simulation/tests → struphy-3.4.0/src/struphy/simulation}/__init__.py +0 -0
  456. {struphy-3.3.0/src/struphy/topology → struphy-3.4.0/src/struphy/simulation/tests}/__init__.py +0 -0
  457. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/simulation/tests/test_estimate_mem.py +0 -0
  458. {struphy-3.3.0/src/struphy/utils → struphy-3.4.0/src/struphy/topology}/__init__.py +0 -0
  459. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/topology/grids.py +0 -0
  460. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/clone_config.py +0 -0
  461. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/cupy_vs_numpy.py +0 -0
  462. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/docstring_converter.py +0 -0
  463. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/progress.py +0 -0
  464. {struphy-3.3.0 → struphy-3.4.0}/src/struphy/utils/test_clone_config.py +0 -0
  465. {struphy-3.3.0 → struphy-3.4.0}/src/struphy.egg-info/dependency_links.txt +0 -0
  466. {struphy-3.3.0 → struphy-3.4.0}/src/struphy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: struphy
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: Multi-model plasma physics package
5
5
  Author: Max Planck Institute for Plasma Physics
6
6
  Author-email: stefan.possanner@ipp.mpg.de, max.lindqvist@ipp.mpg.de, eric.sonnendruecker@ipp.mpg.de
@@ -31,20 +31,22 @@ Requires-Python: >=3.10
31
31
  Description-Content-Type: text/markdown
32
32
  License-File: LICENSE
33
33
  Requires-Dist: numpy<=2.5.0
34
- Requires-Dist: cunumpy<=0.1.5,>=0.1.4
34
+ Requires-Dist: cunumpy<=0.2.0,>=0.2.0
35
35
  Requires-Dist: pyccel<=2.2.3,>=2.2.0
36
- Requires-Dist: feectools<=0.1.10,>=0.1.10
36
+ Requires-Dist: feectools<=0.1.11,>=0.1.11
37
37
  Requires-Dist: scipy<=1.18.0
38
38
  Requires-Dist: h5py<=3.16.0
39
+ Requires-Dist: h5netcdf<=1.8.1
40
+ Requires-Dist: xarray<=2026.2.0
39
41
  Requires-Dist: matplotlib<=3.11.0
40
42
  Requires-Dist: pyyaml<=6.0.3
41
43
  Requires-Dist: vtk<=9.7.0
42
44
  Requires-Dist: tqdm<=4.70.0
43
45
  Requires-Dist: argcomplete<=3.7.0
44
46
  Requires-Dist: ipywidgets<=8.1.8
45
- Requires-Dist: plotly<=6.9.0
46
- Requires-Dist: pyvista<=0.48.0
47
- Requires-Dist: trame<=3.13.0
47
+ Requires-Dist: plotly<=7.1.0
48
+ Requires-Dist: pyvista<=0.49.0
49
+ Requires-Dist: trame<=4.0.0
48
50
  Requires-Dist: trame-vtk<=2.11.8
49
51
  Requires-Dist: trame-vuetify<=3.2.2
50
52
  Requires-Dist: nest_asyncio2<=1.7.2
@@ -54,14 +56,19 @@ Requires-Dist: pytest-mpi<=0.6
54
56
  Requires-Dist: pytest-testmon<=2.2.0
55
57
  Requires-Dist: ruff<=0.16.0,==0.15.0
56
58
  Requires-Dist: line_profiler<=5.0.2
57
- Requires-Dist: scope-profiler<=0.5.0,>=0.5.0
59
+ Requires-Dist: scope-profiler<=0.7.2,>=0.5.0
58
60
  Provides-Extra: mpi
59
61
  Requires-Dist: mpi4py<=4.1.1; extra == "mpi"
62
+ Provides-Extra: gpu
63
+ Requires-Dist: cupy-cuda12x; extra == "gpu"
60
64
  Provides-Extra: phys
61
65
  Requires-Dist: gvec<=1.5.0,>=1.1.0; extra == "phys"
62
66
  Requires-Dist: desc-opt<=0.17.1; extra == "phys"
67
+ Provides-Extra: pproc
68
+ Requires-Dist: plasma-plots>=0.1.0; extra == "pproc"
63
69
  Provides-Extra: dev
64
70
  Requires-Dist: struphy[mpi]; extra == "dev"
71
+ Requires-Dist: struphy[pproc]; extra == "dev"
65
72
  Requires-Dist: notebook; extra == "dev"
66
73
  Requires-Dist: autopep8; extra == "dev"
67
74
  Requires-Dist: isort; extra == "dev"
@@ -79,6 +86,7 @@ Requires-Dist: scope-profiler[pproc]; extra == "dev"
79
86
  Requires-Dist: slurm-script-generator>=0.3.6; extra == "dev"
80
87
  Provides-Extra: doc
81
88
  Requires-Dist: struphy[phys]; extra == "doc"
89
+ Requires-Dist: struphy[pproc]; extra == "doc"
82
90
  Requires-Dist: jupyter; extra == "doc"
83
91
  Requires-Dist: nbconvert; extra == "doc"
84
92
  Requires-Dist: ipykernel; extra == "doc"
@@ -100,6 +108,7 @@ Requires-Dist: struphy[dev]; extra == "likwid"
100
108
  Requires-Dist: pylikwid; extra == "likwid"
101
109
  Provides-Extra: all
102
110
  Requires-Dist: struphy[phys]; extra == "all"
111
+ Requires-Dist: struphy[pproc]; extra == "all"
103
112
  Requires-Dist: struphy[dev]; extra == "all"
104
113
  Requires-Dist: struphy[mpi]; extra == "all"
105
114
  Requires-Dist: struphy[doc]; extra == "all"
@@ -158,6 +167,8 @@ This will create `params_Maxwell.py` in your current working directory (cwd). Yo
158
167
 
159
168
  The default output is in `sim_1/` in your cwd. You can change the output path via the class `EnvironmentOptions` in the parameter file.
160
169
 
170
+ For plots and diagnostics of the output, install [plasma-plots](https://struphy-hub.github.io/plasma-plots) with `pip install "struphy[pproc]"`; `Output` loads it automatically, adding `out.plot`, `out.analysis` and `.plasma.plot` on every product.
171
+
161
172
  Parallel simulations are run for example with
162
173
 
163
174
  pip install -U mpi4py
@@ -50,6 +50,8 @@ This will create `params_Maxwell.py` in your current working directory (cwd). Yo
50
50
 
51
51
  The default output is in `sim_1/` in your cwd. You can change the output path via the class `EnvironmentOptions` in the parameter file.
52
52
 
53
+ For plots and diagnostics of the output, install [plasma-plots](https://struphy-hub.github.io/plasma-plots) with `pip install "struphy[pproc]"`; `Output` loads it automatically, adding `out.plot`, `out.analysis` and `.plasma.plot` on every product.
54
+
53
55
  Parallel simulations are run for example with
54
56
 
55
57
  pip install -U mpi4py
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "struphy"
9
- version = "3.3.0"
9
+ version = "3.4.0"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
12
12
  authors = [
@@ -24,20 +24,22 @@ classifiers = [
24
24
  ]
25
25
  dependencies = [
26
26
  "numpy<=2.5.0",
27
- "cunumpy>=0.1.4, <=0.1.5",
27
+ "cunumpy>=0.2.0, <=0.2.0",
28
28
  "pyccel>=2.2.0, <=2.2.3",
29
- "feectools >= 0.1.10, <=0.1.10",
29
+ "feectools >= 0.1.11, <=0.1.11",
30
30
  "scipy<=1.18.0",
31
31
  "h5py<=3.16.0",
32
+ "h5netcdf<=1.8.1",
33
+ "xarray<=2026.2.0",
32
34
  "matplotlib<=3.11.0",
33
35
  "pyyaml<=6.0.3",
34
36
  "vtk<=9.7.0",
35
37
  "tqdm<=4.70.0",
36
38
  "argcomplete<=3.7.0",
37
39
  "ipywidgets<=8.1.8",
38
- "plotly<=6.9.0",
39
- "pyvista<=0.48.0",
40
- "trame<=3.13.0",
40
+ "plotly<=7.1.0",
41
+ "pyvista<=0.49.0",
42
+ "trame<=4.0.0",
41
43
  "trame-vtk<=2.11.8",
42
44
  "trame-vuetify<=3.2.2",
43
45
  "nest_asyncio2<=1.7.2",
@@ -47,7 +49,7 @@ dependencies = [
47
49
  "pytest-testmon<=2.2.0",
48
50
  "ruff==0.15.0, <=0.16.0",
49
51
  "line_profiler<=5.0.2",
50
- "scope-profiler >= 0.5.0, <=0.5.0",
52
+ "scope-profiler>=0.5.0, <=0.7.2",
51
53
  ]
52
54
 
53
55
  [project.license]
@@ -57,12 +59,19 @@ file = "LICENSE"
57
59
  mpi = [
58
60
  "mpi4py<=4.1.1",
59
61
  ]
62
+ gpu = [
63
+ "cupy-cuda12x",
64
+ ]
60
65
  phys = [
61
66
  "gvec>=1.1.0, <=1.5.0",
62
67
  "desc-opt<=0.17.1",
63
68
  ]
69
+ pproc = [
70
+ "plasma-plots>=0.1.0",
71
+ ]
64
72
  dev = [
65
73
  "struphy[mpi]",
74
+ "struphy[pproc]",
66
75
  "notebook",
67
76
  "autopep8",
68
77
  "isort",
@@ -81,6 +90,7 @@ dev = [
81
90
  ]
82
91
  doc = [
83
92
  "struphy[phys]",
93
+ "struphy[pproc]",
84
94
  "jupyter",
85
95
  "nbconvert",
86
96
  "ipykernel",
@@ -104,6 +114,7 @@ likwid = [
104
114
  ]
105
115
  all = [
106
116
  "struphy[phys]",
117
+ "struphy[pproc]",
107
118
  "struphy[dev]",
108
119
  "struphy[mpi]",
109
120
  "struphy[doc]",
@@ -119,7 +130,6 @@ changelog = "https://github.com/struphy-hub/struphy/blob/devel/CHANGELOG.md"
119
130
 
120
131
  [project.scripts]
121
132
  struphy = "struphy.console.main:struphy"
122
- kinetic-diagnostics = "struphy.diagnostics.console_diagn:main"
123
133
 
124
134
  [tool.setuptools.package-data]
125
135
  "struphy.fields_background.mhd_equil.eqdsk" = [
@@ -136,6 +146,8 @@ kinetic-diagnostics = "struphy.diagnostics.console_diagn:main"
136
146
  ]
137
147
  struphy = [
138
148
  "compile_struphy.mk",
149
+ "**/*.cu",
150
+ "**/*.cuh",
139
151
  ]
140
152
 
141
153
  [tool.autopep8]
@@ -179,6 +191,7 @@ markers = [
179
191
  "fluid",
180
192
  "kinetic",
181
193
  "hybrid",
194
+ "toy",
182
195
  "single",
183
196
  "mpi_pic",
184
197
  ]
@@ -3,10 +3,9 @@ import atexit
3
3
  import logging
4
4
  import logging.config
5
5
  import os
6
+ from typing import TYPE_CHECKING
6
7
 
7
- from feectools.ddm.mpi import mpi as MPI
8
-
9
- from struphy.utils.mpi_launch import launched_under_mpi
8
+ from feectools.ddm.mpi import launched_under_mpi
10
9
 
11
10
 
12
11
  class RankZeroFilter(logging.Filter):
@@ -113,7 +112,17 @@ def setup_logging(logging_level: int = logging.WARNING):
113
112
  # variables that are typically set by MPI launchers (like mpirun or mpiexec).
114
113
  if not launched_under_mpi():
115
114
  rank = 0
115
+ # Serial run: tell feectools not to import mpi4py (which initializes MPI and takes
116
+ # ~1 s) and use its MockMPI instead. This is an in-process flag, deliberately not an
117
+ # environment variable, so that it is not inherited by ``mpirun`` subprocesses.
118
+ # It only has an effect if feectools.ddm.mpi has not been imported yet.
119
+ import feectools
120
+
121
+ feectools.use_mpi = False
116
122
  else:
123
+ # deferred: importing feectools (and thereby mpi4py) is expensive
124
+ from feectools.ddm.mpi import mpi as MPI
125
+
117
126
  rank = MPI.COMM_WORLD.Get_rank()
118
127
  rank_filter = RankZeroFilter(rank)
119
128
 
@@ -142,33 +151,65 @@ logger = logging.getLogger("struphy")
142
151
  setup_logging(logging_level=logging.WARNING)
143
152
  logger.info(f"Logging setup complete, log-file at {config['handlers']['file']['filename']}")
144
153
 
145
- # Import API components
146
- from struphy.api.compiler import Compiler
147
- from struphy.api.domains import domains
148
- from struphy.api.equils import equils
149
- from struphy.api.grids import grids
150
- from struphy.api.maxwellians import maxwellians
151
- from struphy.api.ode import ButcherTableau
152
- from struphy.api.options import (
153
- BaseUnits,
154
- DerhamOptions,
155
- EnvironmentOptions,
156
- FieldsBackground,
157
- ProfilingOptions,
158
- Time,
159
- )
160
- from struphy.api.particles import (
161
- BinningPlot,
162
- BoundaryParameters,
163
- KernelDensityPlot,
164
- LoadingParameters,
165
- SavingParameters,
166
- SortingParameters,
167
- WeightsParameters,
168
- )
169
- from struphy.api.perturbations import perturbations
170
- from struphy.api.post_processing import PlottingData, PostProcessor
171
- from struphy.api.simulation import Simulation
154
+ # Public API components.
155
+ #
156
+ # They are resolved lazily (PEP 562): ``import struphy`` stays cheap, and
157
+ # ``from struphy import X`` only imports the module that actually provides ``X``.
158
+ # Importing everything eagerly pulled in the whole package (geometry, models,
159
+ # post-processing, feectools, ...), costing several seconds.
160
+ _LAZY_API = {
161
+ "Compiler": "struphy.api.compiler",
162
+ "domains": "struphy.api.domains",
163
+ "equils": "struphy.api.equils",
164
+ "grids": "struphy.api.grids",
165
+ "maxwellians": "struphy.api.maxwellians",
166
+ "ButcherTableau": "struphy.api.ode",
167
+ "BaseUnits": "struphy.api.options",
168
+ "DerhamOptions": "struphy.api.options",
169
+ "EnvironmentOptions": "struphy.api.options",
170
+ "FieldsBackground": "struphy.api.options",
171
+ "ProfilingOptions": "struphy.api.options",
172
+ "Time": "struphy.api.options",
173
+ "BinningPlot": "struphy.api.particles",
174
+ "BoundaryParameters": "struphy.api.particles",
175
+ "KernelDensityPlot": "struphy.api.particles",
176
+ "LoadingParameters": "struphy.api.particles",
177
+ "SavingParameters": "struphy.api.particles",
178
+ "SortingParameters": "struphy.api.particles",
179
+ "WeightsParameters": "struphy.api.particles",
180
+ "perturbations": "struphy.api.perturbations",
181
+ "Output": "struphy.api.post_processing",
182
+ "open_output": "struphy.api.post_processing",
183
+ "Simulation": "struphy.api.simulation",
184
+ }
185
+
186
+ if TYPE_CHECKING: # static analysis and IDEs see the eager imports
187
+ from struphy.api.compiler import Compiler
188
+ from struphy.api.domains import domains
189
+ from struphy.api.equils import equils
190
+ from struphy.api.grids import grids
191
+ from struphy.api.maxwellians import maxwellians
192
+ from struphy.api.ode import ButcherTableau
193
+ from struphy.api.options import (
194
+ BaseUnits,
195
+ DerhamOptions,
196
+ EnvironmentOptions,
197
+ FieldsBackground,
198
+ ProfilingOptions,
199
+ Time,
200
+ )
201
+ from struphy.api.particles import (
202
+ BinningPlot,
203
+ BoundaryParameters,
204
+ KernelDensityPlot,
205
+ LoadingParameters,
206
+ SavingParameters,
207
+ SortingParameters,
208
+ WeightsParameters,
209
+ )
210
+ from struphy.api.perturbations import perturbations
211
+ from struphy.api.post_processing import Output, open_output
212
+ from struphy.api.simulation import Simulation
172
213
 
173
214
  __all__ = [
174
215
  "Compiler",
@@ -191,7 +232,22 @@ __all__ = [
191
232
  "DerhamOptions",
192
233
  "FieldsBackground",
193
234
  "ButcherTableau",
194
- "PostProcessor",
195
- "PlottingData",
235
+ "Output",
236
+ "open_output",
196
237
  "Simulation",
197
238
  ]
239
+
240
+
241
+ def __getattr__(name: str):
242
+ module_name = _LAZY_API.get(name)
243
+ if module_name is None:
244
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
245
+ import importlib
246
+
247
+ value = getattr(importlib.import_module(module_name), name)
248
+ globals()[name] = value # cache: later lookups bypass __getattr__
249
+ return value
250
+
251
+
252
+ def __dir__():
253
+ return sorted(set(globals()) | set(_LAZY_API))
@@ -0,0 +1,3 @@
1
+ from struphy.post_processing.output import Output, open_output
2
+
3
+ __all__ = ["Output", "open_output"]
@@ -34,7 +34,7 @@ all: $(OUTPUTS)
34
34
  @for dep in $^ ; do \
35
35
  echo $$dep ; \
36
36
  done
37
- pyccel compile -v $(FLAGS) $(FLAGS_openmp) $<
37
+ pyccel compile $(FLAGS) $(FLAGS_openmp) $<
38
38
  @echo ""
39
39
 
40
40
  #--------------------------------------
@@ -54,6 +54,49 @@ def count_compiled_kernels(state):
54
54
  return count_c, count_f90, list_not_compiled
55
55
 
56
56
 
57
+ def collect_kernel_files(libpath=STRUPHY_LIBPATH):
58
+ """Return the sorted list of all Struphy kernel source files (absolute paths) below libpath."""
59
+ tmp = []
60
+ for subdir, dirs, files in os.walk(libpath):
61
+ logger.debug(f"\n{subdir = }")
62
+ if "__pycache__" in subdir or "__pyccel__" in subdir:
63
+ continue
64
+ for file in files:
65
+ logger.debug(f"{file = }")
66
+ if "kernels" in file and file.endswith(".py") and "_tmp.py" not in file and "test" not in file:
67
+ tmp += [os.path.join(subdir, file)]
68
+ return sorted(tmp)
69
+
70
+
71
+ def remove_kernel_artifacts(kernel_py):
72
+ """Remove the compiled extension module, the pyccel lock file and the __pyccel__ sources
73
+ belonging to a (possibly no longer existing) kernel source file."""
74
+ import glob
75
+ import shutil
76
+
77
+ dirname, basename = os.path.split(kernel_py)
78
+ stem = basename[:-3]
79
+
80
+ patterns = [
81
+ os.path.join(dirname, stem + ".*.so"),
82
+ os.path.join(dirname, stem + ".*.pyd"),
83
+ os.path.join(dirname, stem + ".lock"),
84
+ os.path.join(dirname, stem + "_tmp.py"),
85
+ os.path.join(dirname, "__pycache__", stem + ".*.pyc"),
86
+ os.path.join(dirname, "__pyccel__", stem + ".*"),
87
+ os.path.join(dirname, "__pyccel__", stem + "_tmp.*"),
88
+ os.path.join(dirname, "__pyccel__", "bind_c_" + stem + "*"),
89
+ os.path.join(dirname, "__pyccel__", stem + "_wrapper.*"),
90
+ ]
91
+ for pattern in patterns:
92
+ for f in glob.glob(pattern):
93
+ os.remove(f)
94
+
95
+ pyccel_dir = os.path.join(dirname, "__pyccel__")
96
+ if os.path.isdir(pyccel_dir) and not os.listdir(pyccel_dir):
97
+ shutil.rmtree(pyccel_dir)
98
+
99
+
57
100
  def struphy_compile(
58
101
  language,
59
102
  compiler,
@@ -65,6 +108,7 @@ def struphy_compile(
65
108
  dependencies,
66
109
  time_execution,
67
110
  yes,
111
+ jobs=1,
68
112
  ):
69
113
  """Compile Struphy kernels. All files that contain "kernels" are detected automatically and saved to state.yml.
70
114
 
@@ -100,6 +144,9 @@ def struphy_compile(
100
144
 
101
145
  yes : bool
102
146
  Whether to say yes to prompt when changing the language.
147
+
148
+ jobs : int
149
+ Number of kernels compiled in parallel (default=1). Kernels that depend on each other are still compiled in order.
103
150
  """
104
151
 
105
152
  import importlib.metadata
@@ -124,30 +171,30 @@ def struphy_compile(
124
171
  # Read struphy state file
125
172
  state = utils.read_state()
126
173
 
127
- # collect kernels
128
- if "kernels" not in state:
129
- tmp = []
130
- for subdir, dirs, files in os.walk(libpath):
131
- logger.debug(f"\n{subdir = }")
132
- for file in files:
133
- logger.debug(f"{file = }")
134
- if (
135
- "kernels" in file
136
- and ".py" in file
137
- and "_tmp.py" not in file
138
- and "test" not in file
139
- and "__pycache__" not in subdir
140
- and "__pyccel__" not in subdir
141
- ):
142
- tmp += [os.path.join(subdir, file)]
143
-
144
- state["kernels"] = sorted(tmp)
174
+ # collect kernels (always re-scan: kernel files may have been added, moved or removed since the last run)
175
+ kernels_now = collect_kernel_files(libpath)
176
+ kernels_old = state.get("kernels", None)
145
177
 
178
+ if kernels_old is None:
146
179
  # set initial compiler infos to None
147
180
  state["last_used_language"] = None
148
181
  state["last_used_compiler"] = None
149
182
  state["last_used_omp"] = None
150
-
183
+ else:
184
+ removed = sorted(set(kernels_old) - set(kernels_now))
185
+ added = sorted(set(kernels_now) - set(kernels_old))
186
+ if removed:
187
+ print("\nKernel files removed since last compile (deleting stale build artifacts):")
188
+ for ker in removed:
189
+ print(f" {ker}")
190
+ remove_kernel_artifacts(ker)
191
+ if added:
192
+ print("\nNew kernel files detected:")
193
+ for ker in added:
194
+ print(f" {ker}")
195
+
196
+ if kernels_old != kernels_now:
197
+ state["kernels"] = kernels_now
151
198
  utils.save_state(state)
152
199
  # source files
153
200
  sources = " ".join(state["kernels"])
@@ -296,8 +343,11 @@ def struphy_compile(
296
343
  # kernel_file,
297
344
  # "-v",
298
345
  # ]
346
+ # make compiles up to `jobs` kernels at once; the prerequisites computed by
347
+ # dependencies.py (see compile_struphy.mk) ensure that imported kernels are built first
299
348
  cmd = [
300
349
  "make",
350
+ f"-j{jobs}",
301
351
  "-f",
302
352
  "compile_struphy.mk",
303
353
  "sources=" + sources,
@@ -105,6 +105,7 @@ PASS_GREEN = f"{GREEN_COLOR}PASS{BLACK_COLOR}"
105
105
 
106
106
  MODELS_INIT_PATH = os.path.join(LIBPATH, "models/__init__.py")
107
107
  PROPAGATORS_INIT_PATH = os.path.join(LIBPATH, "propagators/__init__.py")
108
+ DOMAINS_INIT_PATH = os.path.join(LIBPATH, "geometry/domains/__init__.py")
108
109
 
109
110
 
110
111
  def check_omp_flags(file_path, verbose=False):
@@ -122,14 +123,18 @@ def check_omp_flags(file_path, verbose=False):
122
123
  """
123
124
  try:
124
125
  with open(file_path, "r", encoding="utf-8") as f:
125
- if verbose:
126
- for iline, line in enumerate(f):
127
- if line.lstrip().startswith("# $"):
128
- print(f"Error on line {iline}: {line}")
129
- return all(not line.lstrip().startswith("# $") for line in f)
126
+ lines = f.readlines()
130
127
  except (IOError, FileNotFoundError) as e:
131
128
  raise ValueError(f"Error reading file: {e}")
132
129
 
130
+ passes = True
131
+ for iline, line in enumerate(lines, start=1):
132
+ if line.lstrip().startswith("# $"):
133
+ passes = False
134
+ if verbose:
135
+ print(f"Error on line {iline}: {line}")
136
+ return passes
137
+
133
138
 
134
139
  def check_ssort(file_path, verbose=False):
135
140
  """Check if a file is sorted according to ssort.
@@ -194,15 +199,20 @@ def check_ruff(file_path, verbose=False):
194
199
 
195
200
  if result.returncode == 0:
196
201
  returncodes.append(0)
202
+ elif command[1] != "format" or result.returncode != 1:
203
+ # Lint errors (e.g. unsorted imports) or ruff failures
204
+ returncodes.append(result.returncode)
197
205
  else:
198
206
  # Default to no error
199
207
  returncode = 0
200
208
  for line in result.stdout.decode("utf-8").split("\n"):
201
209
  # Skip empty lines and filename headers
202
- if not line or line.startswith("+++ "):
210
+ if not line or line.startswith(("+++ ", "--- ")):
203
211
  continue
204
- # Check for lines with actual changes
205
- if line.startswith("+ ") and not line[1:].lstrip().startswith("# $"):
212
+ # Check for lines with actual changes, ignoring the OpenMP flags "#$" -> "# $"
213
+ if line.startswith("+") and not line[1:].lstrip().startswith("# $"):
214
+ returncode = 1
215
+ if line.startswith("-") and not line[1:].lstrip().startswith("#$"):
206
216
  returncode = 1
207
217
  returncodes.append(returncode)
208
218
 
@@ -1284,6 +1294,11 @@ def construct_package_init_file(
1284
1294
  per module, by importing each module and collecting the subclasses of `base_class` that
1285
1295
  are defined in it. Preserves the existing module docstring of the `__init__.py`, if any.
1286
1296
 
1297
+ The generated file resolves the classes lazily (PEP 562 module ``__getattr__``), so that
1298
+ ``from package import SomeClass`` only imports the module defining ``SomeClass`` instead of
1299
+ every module in the package. Importing all of them costs a considerable amount of time and
1300
+ is rarely needed. A ``TYPE_CHECKING`` block keeps static analysis and IDEs working.
1301
+
1287
1302
  Parameters
1288
1303
  ----------
1289
1304
  package_dir : str
@@ -1307,22 +1322,61 @@ def construct_package_init_file(
1307
1322
 
1308
1323
  init_content = f'"""{docstring}"""\n\n' if docstring else ""
1309
1324
  class_names = []
1325
+ class_modules = {}
1310
1326
 
1311
1327
  for file_name in sorted(os.listdir(package_dir)):
1312
- if file_name.endswith(".py") and file_name not in ("__init__.py", *skip):
1328
+ if file_name in ("__init__.py", *skip):
1329
+ continue
1330
+ if file_name.endswith(".py"):
1313
1331
  module_name = file_name[:-3] # strip .py
1314
- module = importlib.import_module(f"{package_name}.{module_name}")
1315
-
1316
- # Loop over all classes in the module
1317
- for _, cls in inspect.getmembers(module, inspect.isclass):
1318
- # Only subclasses of base_class defined in this module
1319
- if issubclass(cls, base_class) and cls.__module__ == module.__name__ and cls != base_class:
1320
- class_name = cls.__name__
1321
- init_content += f"from {package_name}.{module_name} import {class_name}\n"
1322
- class_names.append(class_name)
1323
-
1324
- init_content += "\n\n"
1325
- init_content += f"__all__ = {class_names}\n"
1332
+ elif os.path.isfile(os.path.join(package_dir, file_name, "__init__.py")):
1333
+ module_name = file_name # sub-package laid out as one directory per class
1334
+ else:
1335
+ continue
1336
+ module = importlib.import_module(f"{package_name}.{module_name}")
1337
+
1338
+ # Sub-packages resolve their class lazily via __getattr__; inspect.getmembers would
1339
+ # not see it, so go through __all__ (falling back to what getmembers finds).
1340
+ candidates = [getattr(module, n) for n in getattr(module, "__all__", ())]
1341
+ candidates += [cls for _, cls in inspect.getmembers(module, inspect.isclass)]
1342
+
1343
+ # Loop over all classes in the module
1344
+ for cls in candidates:
1345
+ # Only subclasses of base_class defined in this module (or its sub-modules)
1346
+ if (
1347
+ inspect.isclass(cls)
1348
+ and issubclass(cls, base_class)
1349
+ and cls != base_class
1350
+ and (cls.__module__ == module.__name__ or cls.__module__.startswith(module.__name__ + "."))
1351
+ and cls.__name__ not in class_modules
1352
+ ):
1353
+ class_names.append(cls.__name__)
1354
+ class_modules[cls.__name__] = f"{package_name}.{module_name}"
1355
+
1356
+ init_content += "import importlib\n"
1357
+ init_content += "from typing import TYPE_CHECKING\n\n"
1358
+
1359
+ init_content += "# class name -> module defining it, resolved on first access by __getattr__ below\n"
1360
+ init_content += "_LAZY_IMPORTS = {\n"
1361
+ for class_name in class_names:
1362
+ init_content += f' "{class_name}": "{class_modules[class_name]}",\n'
1363
+ init_content += "}\n\n"
1364
+
1365
+ init_content += "if TYPE_CHECKING: # static analysis and IDEs see the eager imports\n"
1366
+ for class_name in class_names:
1367
+ init_content += f" from {class_modules[class_name]} import {class_name}\n"
1368
+ init_content += "\n"
1369
+
1370
+ init_content += f"__all__ = {class_names}\n\n\n"
1371
+ init_content += "def __getattr__(name: str):\n"
1372
+ init_content += " module_name = _LAZY_IMPORTS.get(name)\n"
1373
+ init_content += " if module_name is None:\n"
1374
+ init_content += ' raise AttributeError(f"module {__name__!r} has no attribute {name!r}")\n'
1375
+ init_content += " value = getattr(importlib.import_module(module_name), name)\n"
1376
+ init_content += " globals()[name] = value # cache: later lookups bypass __getattr__\n"
1377
+ init_content += " return value\n\n\n"
1378
+ init_content += "def __dir__():\n"
1379
+ init_content += " return sorted(set(globals()) | set(_LAZY_IMPORTS))\n"
1326
1380
  return init_content
1327
1381
 
1328
1382
 
@@ -1344,6 +1398,16 @@ def construct_propagators_init_file(propagators_dir: str = "src/struphy/propagat
1344
1398
  return construct_package_init_file(propagators_dir, "struphy.propagators", Propagator)
1345
1399
 
1346
1400
 
1401
+ def construct_domains_init_file(domains_dir: str = "src/struphy/geometry/domains") -> str:
1402
+ """
1403
+ Constructs __init__.py for all domain files by reading actual class names.
1404
+ Skips __init__.py.
1405
+ """
1406
+ from struphy.geometry.base import Domain
1407
+
1408
+ return construct_package_init_file(domains_dir, "struphy.geometry.domains", Domain)
1409
+
1410
+
1347
1411
  def run_formatting_loop(python_files, linters, iterations, verbose):
1348
1412
  """Repeatedly run the given formatters on `python_files` until they are clean.
1349
1413
 
@@ -1481,7 +1545,12 @@ def struphy_build_init_files(config, verbose, yes=False):
1481
1545
  with open(PROPAGATORS_INIT_PATH, "w", encoding="utf-8") as f:
1482
1546
  f.write(propagators_init)
1483
1547
 
1484
- python_files = [MODELS_INIT_PATH, PROPAGATORS_INIT_PATH]
1548
+ print(f"Rewriting {DOMAINS_INIT_PATH}")
1549
+ domains_init = construct_domains_init_file()
1550
+ with open(DOMAINS_INIT_PATH, "w", encoding="utf-8") as f:
1551
+ f.write(domains_init)
1552
+
1553
+ python_files = [MODELS_INIT_PATH, PROPAGATORS_INIT_PATH, DOMAINS_INIT_PATH]
1485
1554
 
1486
1555
  confirm_formatting(python_files, linters, yes)
1487
1556