physioblocks 1.2.0__tar.gz → 2.0.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 (348) hide show
  1. {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab-ci.yml +19 -9
  2. {physioblocks-1.2.0 → physioblocks-2.0.0}/PKG-INFO +6 -6
  3. {physioblocks-1.2.0 → physioblocks-2.0.0}/README.md +3 -3
  4. physioblocks-2.0.0/doc/.gitignore +2 -0
  5. physioblocks-1.2.0/doc/source/api_reference/io.rst → physioblocks-2.0.0/doc/source/api_reference.rst +8 -15
  6. physioblocks-2.0.0/doc/source/conf.py +200 -0
  7. physioblocks-2.0.0/doc/source/examples/aliases/flow_pulse_function.json +7 -0
  8. physioblocks-2.0.0/doc/source/examples/aliases/simple_circulation_net.json +29 -0
  9. physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/create_simulation/simple_circulation.jsonc +144 -0
  10. physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/1_synthetic_data.jsonc +73 -0
  11. physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/2_state_estimation.jsonc +103 -0
  12. physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/3_parameter_estimation.jsonc +105 -0
  13. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/index.rst +0 -1
  14. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/installation.rst +4 -3
  15. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/presentation.rst +9 -6
  16. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1/launch_simulation.rst +16 -15
  17. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1/launcher.rst +2 -2
  18. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/aliases.rst +49 -41
  19. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/create_net.rst +47 -47
  20. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/create_simulation.rst +283 -162
  21. physioblocks-2.0.0/doc/source/user_guide/level_2/estimation.rst +537 -0
  22. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/overview.rst +10 -10
  23. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2.rst +4 -2
  24. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_definition.rst +40 -32
  25. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_test.rst +60 -29
  26. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/overview.rst +19 -19
  27. physioblocks-2.0.0/doc/source/user_guide/level_3/filters.rst +137 -0
  28. physioblocks-2.0.0/doc/source/user_guide/level_3/functions.rst +110 -0
  29. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/processes.rst +14 -9
  30. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/specific_installations.rst +9 -4
  31. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3.rst +7 -3
  32. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/__init__.py +2 -2
  33. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/function_factories.py +11 -9
  34. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/operators.py +5 -15
  35. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/registers.py +33 -31
  36. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/computing/__init__.py +1 -3
  37. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/computing/assembling.py +111 -109
  38. physioblocks-2.0.0/physioblocks/computing/models.py +803 -0
  39. physioblocks-2.0.0/physioblocks/computing/quantities.py +1016 -0
  40. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/__init__.py +2 -4
  41. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/aliases.py +60 -35
  42. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/base.py +35 -27
  43. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/computing/__init__.py +2 -0
  44. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/computing/quantities.py +30 -0
  45. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/constants.py +39 -7
  46. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/__init__.py +1 -3
  47. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/blocks.py +70 -17
  48. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/nets.py +48 -30
  49. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/functions.py +194 -172
  50. physioblocks-2.0.0/physioblocks/configuration/io.py +126 -0
  51. physioblocks-2.0.0/physioblocks/configuration/migrations.py +250 -0
  52. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/simulation/__init__.py +4 -3
  53. physioblocks-2.0.0/physioblocks/configuration/simulation/_migrations/__init__.py +27 -0
  54. physioblocks-2.0.0/physioblocks/configuration/simulation/_migrations/_v2_0_0.py +267 -0
  55. physioblocks-2.0.0/physioblocks/configuration/simulation/functions.py +107 -0
  56. physioblocks-2.0.0/physioblocks/configuration/simulation/observer.py +77 -0
  57. physioblocks-2.0.0/physioblocks/configuration/simulation/simulations.py +364 -0
  58. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/__init__.py +1 -3
  59. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/blocks.py +278 -182
  60. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/flux.py +69 -43
  61. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/nets.py +426 -214
  62. {physioblocks-1.2.0/physioblocks/library/functions → physioblocks-2.0.0/physioblocks/io}/__init__.py +1 -1
  63. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/io/aliases.py +18 -11
  64. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/io/configuration.py +34 -28
  65. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/__main__.py +37 -31
  66. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/configuration.py +70 -37
  67. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/configure/__main__.py +4 -7
  68. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/constants.py +4 -7
  69. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/files.py +59 -31
  70. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/series.py +114 -43
  71. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/__init__.py +1 -1
  72. physioblocks-1.2.0/physioblocks/simulation/constants.py → physioblocks-2.0.0/physioblocks/library/aliases/__init__.py +4 -3
  73. physioblocks-2.0.0/physioblocks/library/aliases/flux/__init__.py +43 -0
  74. physioblocks-2.0.0/physioblocks/library/aliases/nets/__init__.py +110 -0
  75. physioblocks-2.0.0/physioblocks/library/aliases/plots/plot_pv_loop.json +29 -0
  76. physioblocks-2.0.0/physioblocks/library/aliases/plots/subplots_estimation.json +51 -0
  77. physioblocks-2.0.0/physioblocks/library/aliases/simulations/__init__.py +305 -0
  78. physioblocks-2.0.0/physioblocks/library/aliases/simulations/circulation_alone_estimation_ukf.jsonc +159 -0
  79. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/circulation_alone_forward_simulation.jsonc +24 -27
  80. physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_estimation_simulation.jsonc +25 -0
  81. physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_forward_simulation.jsonc +23 -0
  82. physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_time.jsonc +7 -0
  83. physioblocks-2.0.0/physioblocks/library/aliases/simulations/spherical_heart_estimation_ukf.jsonc +411 -0
  84. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/spherical_heart_forward_simulation.jsonc +117 -83
  85. physioblocks-2.0.0/physioblocks/library/blocks/__init__.py +27 -0
  86. physioblocks-2.0.0/physioblocks/library/blocks/capacitances.py +672 -0
  87. physioblocks-2.0.0/physioblocks/library/blocks/cavity.py +322 -0
  88. physioblocks-2.0.0/physioblocks/library/blocks/valves.py +329 -0
  89. physioblocks-2.0.0/physioblocks/library/filters/__init__.py +26 -0
  90. physioblocks-2.0.0/physioblocks/library/filters/discrepancies.py +107 -0
  91. physioblocks-2.0.0/physioblocks/library/filters/kalman_filter.py +190 -0
  92. physioblocks-2.0.0/physioblocks/library/filters/sigmas.py +309 -0
  93. physioblocks-2.0.0/physioblocks/library/filters/unscented_kalman_filter.py +330 -0
  94. {physioblocks-1.2.0/physioblocks/utils → physioblocks-2.0.0/physioblocks/library/functions}/__init__.py +1 -1
  95. physioblocks-2.0.0/physioblocks/library/functions/base_operations.py +189 -0
  96. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/first_order.py +42 -14
  97. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/piecewise.py +127 -43
  98. physioblocks-2.0.0/physioblocks/library/functions/transform.py +278 -0
  99. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/trigonometric.py +40 -17
  100. physioblocks-2.0.0/physioblocks/library/functions/watchers.py +86 -0
  101. {physioblocks-1.2.0/physioblocks/library/blocks → physioblocks-2.0.0/physioblocks/library/model_components}/__init__.py +1 -1
  102. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/model_components/active_law.py +205 -92
  103. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/model_components/dynamics.py +508 -348
  104. physioblocks-2.0.0/physioblocks/library/model_components/rheology.py +319 -0
  105. physioblocks-2.0.0/physioblocks/library/model_components/velocity_law.py +217 -0
  106. {physioblocks-1.2.0/physioblocks/io → physioblocks-2.0.0/physioblocks/library/processes}/__init__.py +1 -3
  107. physioblocks-2.0.0/physioblocks/library/processes/_migrations/__init__.py +27 -0
  108. physioblocks-2.0.0/physioblocks/library/processes/_migrations/_v2_0_0.py +71 -0
  109. physioblocks-2.0.0/physioblocks/library/processes/computing_processes.py +358 -0
  110. physioblocks-2.0.0/physioblocks/library/processes/espvr_edpvr_process.py +134 -0
  111. physioblocks-2.0.0/physioblocks/library/processes/file_processes.py +237 -0
  112. physioblocks-2.0.0/physioblocks/library/processes/plot_processes.py +214 -0
  113. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/__init__.py +1 -3
  114. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/load_function_register.py +33 -24
  115. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/save_function_register.py +43 -30
  116. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/type_register.py +51 -27
  117. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/__init__.py +5 -11
  118. physioblocks-2.0.0/physioblocks/simulation/_filter_functions.py +149 -0
  119. physioblocks-2.0.0/physioblocks/simulation/base.py +1203 -0
  120. physioblocks-2.0.0/physioblocks/simulation/estimation.py +1019 -0
  121. physioblocks-2.0.0/physioblocks/simulation/forward.py +205 -0
  122. physioblocks-2.0.0/physioblocks/simulation/functions.py +252 -0
  123. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/process.py +105 -64
  124. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/saved_quantities.py +42 -36
  125. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/solvers.py +102 -45
  126. physioblocks-2.0.0/physioblocks/simulation/time_manager.py +265 -0
  127. physioblocks-2.0.0/physioblocks/utils/__init__.py +27 -0
  128. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/utils/dynamic_import_utils.py +13 -15
  129. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/utils/exceptions_utils.py +97 -30
  130. physioblocks-2.0.0/physioblocks/utils/gradient_test_utils.py +320 -0
  131. {physioblocks-1.2.0 → physioblocks-2.0.0}/pyproject.toml +1 -1
  132. physioblocks-2.0.0/references/circulation_alone_estimation_sim.jsonc +29 -0
  133. physioblocks-2.0.0/references/circulation_alone_forward_sim.jsonc +15 -0
  134. physioblocks-2.0.0/references/full_configurations/circulation_alone_estimation_sim.jsonc +336 -0
  135. physioblocks-2.0.0/references/full_configurations/circulation_alone_forward_sim.jsonc +189 -0
  136. physioblocks-2.0.0/references/full_configurations/spherical_heart_estimation_sim.jsonc +749 -0
  137. physioblocks-1.2.0/references/full_configurations/spherical_heart_respiration_sim.jsonc → physioblocks-2.0.0/references/full_configurations/spherical_heart_forward_sim.jsonc +238 -203
  138. physioblocks-2.0.0/references/spherical_heart_estimation_sim.jsonc +36 -0
  139. physioblocks-2.0.0/references/spherical_heart_forward_sim.jsonc +20 -0
  140. physioblocks-2.0.0/references/synthetic_data/circulation_alone_measurements.csv +10002 -0
  141. physioblocks-2.0.0/references/synthetic_data/spherical_heart_measurements.csv +10001 -0
  142. physioblocks-2.0.0/ruff.toml +15 -0
  143. physioblocks-1.2.0/tests/tests_library/tests_functions/test_base_operations_functions.py → physioblocks-2.0.0/tests/helpers/assertion_helpers.py +16 -25
  144. physioblocks-2.0.0/tests/tests_computing/test_models.py +364 -0
  145. physioblocks-2.0.0/tests/tests_computing/test_quantities.py +874 -0
  146. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/test_generic_save_load.py +2 -1
  147. physioblocks-2.0.0/tests/tests_config/test_io.py +115 -0
  148. physioblocks-2.0.0/tests/tests_config/test_migrations.py +186 -0
  149. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_blocks.py +1 -0
  150. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_boundary_condition.py +1 -0
  151. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_nets.py +26 -35
  152. physioblocks-2.0.0/tests/tests_config/tests_simulation/test_config_simulation.py +260 -0
  153. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/test_config_solvers.py +1 -0
  154. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/test_functions.py +3 -0
  155. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_blocks.py +20 -14
  156. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_nets.py +139 -119
  157. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_relations.py +15 -9
  158. physioblocks-2.0.0/tests/tests_launcher/test_configuration.py +123 -0
  159. physioblocks-2.0.0/tests/tests_launcher/test_files.py +201 -0
  160. physioblocks-2.0.0/tests/tests_launcher/test_main.py +125 -0
  161. physioblocks-2.0.0/tests/tests_launcher/test_series.py +199 -0
  162. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_capacitances.py +4 -5
  163. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_cavity.py +3 -4
  164. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_valves.py +4 -5
  165. physioblocks-2.0.0/tests/tests_library/tests_filters/test_kalman_filters.py +225 -0
  166. physioblocks-2.0.0/tests/tests_library/tests_filters/test_sigma_points.py +116 -0
  167. physioblocks-2.0.0/tests/tests_library/tests_functions/test_base_operations_functions.py +80 -0
  168. physioblocks-1.2.0/tests/tests_library/tests_functions/test_watch_functions.py → physioblocks-2.0.0/tests/tests_library/tests_functions/test_transformations.py +32 -25
  169. physioblocks-2.0.0/tests/tests_library/tests_functions/test_watch_functions.py +41 -0
  170. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_active_law.py +18 -5
  171. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_dynamics_block.py +49 -5
  172. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_rheology.py +3 -4
  173. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_velocity_law_hht.py +2 -3
  174. physioblocks-1.2.0/tests/tests_library/tests_processes/test_file_processes.py → physioblocks-2.0.0/tests/tests_library/tests_processes/test_computing_processes.py +245 -1
  175. physioblocks-2.0.0/tests/tests_library/tests_processes/test_espvr_edpvr_process.py +185 -0
  176. physioblocks-2.0.0/tests/tests_library/tests_processes/test_file_processes.py +133 -0
  177. physioblocks-2.0.0/tests/tests_library/tests_processes/test_plot_processes.py +130 -0
  178. physioblocks-2.0.0/tests/tests_references/.gitignore +1 -0
  179. physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_estimation_sim.jsonc +71 -0
  180. physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_estimation_sim_compare_reference.jsonc +19 -0
  181. physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_forward_sim_compare_reference.jsonc +19 -0
  182. physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_model_gradient_test.json +49 -0
  183. physioblocks-2.0.0/tests/tests_references/circulation_alone/ref_circulation_alone_estimation_ukf_sim.csv +10002 -0
  184. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/compare.py +12 -3
  185. physioblocks-2.0.0/tests/tests_references/functions.py +195 -0
  186. physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_estimation_sim.csv +4 -0
  187. physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_estimation_sim_espvr_edpvr.csv +1302 -0
  188. physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_sim.csv +10002 -0
  189. physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_estimation_sim_compare_reference.jsonc +31 -0
  190. physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_forward_sim_compare_reference.jsonc +31 -0
  191. physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_model_gradient_test.json +148 -0
  192. physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/references/ref_spherical_heart_sim_espvr_edpvr.csv +1302 -0
  193. physioblocks-2.0.0/tests/tests_references/test_circulation_alone.py +102 -0
  194. physioblocks-2.0.0/tests/tests_references/test_spherical_heart.py +139 -0
  195. physioblocks-2.0.0/tests/tests_simulation/test_base.py +393 -0
  196. physioblocks-2.0.0/tests/tests_simulation/test_estimation.py +233 -0
  197. physioblocks-2.0.0/tests/tests_simulation/test_forward.py +118 -0
  198. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/test_solvers.py +5 -5
  199. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/test_time_manager.py +49 -73
  200. physioblocks-2.0.0/tests/tests_utils/test_dynamic_import_utils.py +160 -0
  201. physioblocks-2.0.0/tests/tests_utils/test_gradient_test_utils.py +148 -0
  202. {physioblocks-1.2.0 → physioblocks-2.0.0}/tox.toml +9 -1
  203. physioblocks-1.2.0/doc/.gitignore +0 -1
  204. physioblocks-1.2.0/doc/source/api_reference/base.rst +0 -52
  205. physioblocks-1.2.0/doc/source/api_reference/computing.rst +0 -55
  206. physioblocks-1.2.0/doc/source/api_reference/configuration.rst +0 -50
  207. physioblocks-1.2.0/doc/source/api_reference/description.rst +0 -51
  208. physioblocks-1.2.0/doc/source/api_reference/registers.rst +0 -51
  209. physioblocks-1.2.0/doc/source/api_reference/simulation.rst +0 -83
  210. physioblocks-1.2.0/doc/source/api_reference/utils.rst +0 -56
  211. physioblocks-1.2.0/doc/source/api_reference.rst +0 -44
  212. physioblocks-1.2.0/doc/source/conf.py +0 -53
  213. physioblocks-1.2.0/doc/source/library/aliases/blocks.rst +0 -112
  214. physioblocks-1.2.0/doc/source/library/aliases/model_components.rst +0 -99
  215. physioblocks-1.2.0/doc/source/library/aliases/nets.rst +0 -161
  216. physioblocks-1.2.0/doc/source/library/aliases/simulation.rst +0 -219
  217. physioblocks-1.2.0/doc/source/library/aliases.rst +0 -43
  218. physioblocks-1.2.0/doc/source/library/blocks.rst +0 -50
  219. physioblocks-1.2.0/doc/source/library/configuration/functions.rst +0 -289
  220. physioblocks-1.2.0/doc/source/library/configuration/net.rst +0 -234
  221. physioblocks-1.2.0/doc/source/library/configuration/simulation.rst +0 -167
  222. physioblocks-1.2.0/doc/source/library/configuration.rst +0 -40
  223. physioblocks-1.2.0/doc/source/library/functions.rst +0 -65
  224. physioblocks-1.2.0/doc/source/library/model_components.rst +0 -56
  225. physioblocks-1.2.0/doc/source/library/processes.rst +0 -46
  226. physioblocks-1.2.0/doc/source/library.rst +0 -48
  227. physioblocks-1.2.0/physioblocks/computing/models.py +0 -1123
  228. physioblocks-1.2.0/physioblocks/computing/quantities.py +0 -354
  229. physioblocks-1.2.0/physioblocks/configuration/simulation/simulations.py +0 -305
  230. physioblocks-1.2.0/physioblocks/library/aliases/simulations/default_forward_simulation.jsonc +0 -14
  231. physioblocks-1.2.0/physioblocks/library/aliases/simulations/default_time.jsonc +0 -8
  232. physioblocks-1.2.0/physioblocks/library/aliases/simulations/spherical_heart_with_respiration_forward_simulation.jsonc +0 -48
  233. physioblocks-1.2.0/physioblocks/library/blocks/capacitances.py +0 -464
  234. physioblocks-1.2.0/physioblocks/library/blocks/cavity.py +0 -233
  235. physioblocks-1.2.0/physioblocks/library/blocks/valves.py +0 -254
  236. physioblocks-1.2.0/physioblocks/library/functions/base_operations.py +0 -129
  237. physioblocks-1.2.0/physioblocks/library/functions/watchers.py +0 -113
  238. physioblocks-1.2.0/physioblocks/library/model_components/__init__.py +0 -27
  239. physioblocks-1.2.0/physioblocks/library/model_components/rheology.py +0 -233
  240. physioblocks-1.2.0/physioblocks/library/model_components/velocity_law.py +0 -169
  241. physioblocks-1.2.0/physioblocks/library/processes/__init__.py +0 -3
  242. physioblocks-1.2.0/physioblocks/library/processes/conversion_process.py +0 -74
  243. physioblocks-1.2.0/physioblocks/library/processes/espvr_edpvr_process.py +0 -145
  244. physioblocks-1.2.0/physioblocks/library/processes/file_processes.py +0 -128
  245. physioblocks-1.2.0/physioblocks/library/processes/plot_processes.py +0 -183
  246. physioblocks-1.2.0/physioblocks/simulation/functions.py +0 -71
  247. physioblocks-1.2.0/physioblocks/simulation/runtime.py +0 -552
  248. physioblocks-1.2.0/physioblocks/simulation/setup.py +0 -585
  249. physioblocks-1.2.0/physioblocks/simulation/state.py +0 -403
  250. physioblocks-1.2.0/physioblocks/simulation/time_manager.py +0 -354
  251. physioblocks-1.2.0/physioblocks/utils/gradient_test_utils.py +0 -317
  252. physioblocks-1.2.0/physioblocks/utils/math_utils.py +0 -109
  253. physioblocks-1.2.0/references/spherical_heart_respiration_sim.jsonc +0 -28
  254. physioblocks-1.2.0/ruff.toml +0 -7
  255. physioblocks-1.2.0/tests/helpers/assertion_helpers.py +0 -85
  256. physioblocks-1.2.0/tests/tests_computing/test_models.py +0 -520
  257. physioblocks-1.2.0/tests/tests_computing/test_quantities.py +0 -353
  258. physioblocks-1.2.0/tests/tests_config/tests_simulation/simulation_reference.json +0 -73
  259. physioblocks-1.2.0/tests/tests_config/tests_simulation/test_config_simulation.py +0 -301
  260. physioblocks-1.2.0/tests/tests_config/tests_simulation/test_config_time.py +0 -71
  261. physioblocks-1.2.0/tests/tests_library/tests_processes/test_conversion_process.py +0 -157
  262. physioblocks-1.2.0/tests/tests_library/tests_processes/test_espvr_edpvr_process.py +0 -132
  263. physioblocks-1.2.0/tests/tests_library/tests_processes/test_plot_processes.py +0 -244
  264. physioblocks-1.2.0/tests/tests_references/circulation_alone/circulation_alone_sim_compare_reference.jsonc +0 -8
  265. physioblocks-1.2.0/tests/tests_references/circulation_alone/circulation_alone_sim_gradient_test.json +0 -24
  266. physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_respiration_sim_compare_reference.jsonc +0 -10
  267. physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_sim_compare_reference.jsonc +0 -10
  268. physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_sim_gradient_test.json +0 -55
  269. physioblocks-1.2.0/tests/tests_references/test_circulation_alone.py +0 -73
  270. physioblocks-1.2.0/tests/tests_references/test_spherical_heart.py +0 -142
  271. physioblocks-1.2.0/tests/tests_simulation/test_runtime.py +0 -284
  272. physioblocks-1.2.0/tests/tests_simulation/test_setup.py +0 -206
  273. physioblocks-1.2.0/tests/tests_simulation/test_state.py +0 -242
  274. physioblocks-1.2.0/tests/tests_utils/test_math_utils.py +0 -64
  275. {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  276. {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/documentation.md +0 -0
  277. {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  278. {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitignore +0 -0
  279. {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Bug.md +0 -0
  280. {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Documentation.md +0 -0
  281. {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Feature.md +0 -0
  282. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/Makefile +0 -0
  283. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/make.bat +0 -0
  284. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/assembling_example_scheme.tex +0 -0
  285. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/circulation_net_scheme.tex +0 -0
  286. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/circulation_net_scheme_heart.tex +0 -0
  287. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/model_heart_circulation_0D.tex +0 -0
  288. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/simple_circulation_model.tex +0 -0
  289. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/simple_circulation_model_heart.tex +0 -0
  290. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/spherical_heart_net_scheme.tex +0 -0
  291. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1.rst +0 -0
  292. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_configuration.rst +0 -0
  293. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks.rst +0 -0
  294. {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide.rst +0 -0
  295. {physioblocks-1.2.0 → physioblocks-2.0.0}/docker/latex/Dockerfile +0 -0
  296. {physioblocks-1.2.0 → physioblocks-2.0.0}/docker/pyenv/Dockerfile +0 -0
  297. {physioblocks-1.2.0 → physioblocks-2.0.0}/licenses/GPL-3.0-only.txt +0 -0
  298. {physioblocks-1.2.0 → physioblocks-2.0.0}/licenses/LGPL-3.0-only.txt +0 -0
  299. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/__init__.py +0 -0
  300. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/c_block.json +0 -0
  301. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/rc_block.json +0 -0
  302. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/rcr_block.json +0 -0
  303. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/spherical_cavity_block.json +0 -0
  304. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/valve_rl_block.json +0 -0
  305. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/flux/heart_flux_dof_couples.jsonc +0 -0
  306. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/active_law_macro_huxley_two_moments.json +0 -0
  307. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/rheology_fiber_additive.json +0 -0
  308. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/spherical_dynamics.json +0 -0
  309. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/velocity_law_hht.json +0 -0
  310. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/nets/circulation_alone_net.json +0 -0
  311. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/nets/spherical_heart_net.json +0 -0
  312. {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/newton_method_solver.json +0 -0
  313. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/__init__.py +0 -0
  314. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/helpers/__init__.py +0 -0
  315. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_base/test_function_factories.py +0 -0
  316. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_base/test_register.py +0 -0
  317. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_computing/test_assembling.py +0 -0
  318. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/__init__.py +0 -0
  319. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/test_definitions.py +0 -0
  320. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_alias/test_alias.py +0 -0
  321. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/__init__.py +0 -0
  322. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/__init__.py +0 -0
  323. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/__init__.py +0 -0
  324. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/__init__.py +0 -0
  325. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/alt_config_file_path.json +0 -0
  326. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/commented_config_file_path.jsonc +0 -0
  327. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/configuration.json +0 -0
  328. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/test_aliases.py +0 -0
  329. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/test_configuration.py +0 -0
  330. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_first_order_functions.py +0 -0
  331. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_piecewise_functions.py +0 -0
  332. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_trigonometric_functions.py +0 -0
  333. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/__init__.py +0 -0
  334. /physioblocks-1.2.0/tests/tests_references/circulation_alone/ref_circulation_alone_sim.csv → /physioblocks-2.0.0/tests/tests_references/circulation_alone/ref_circulation_alone_forward_sim.csv +0 -0
  335. {physioblocks-1.2.0/references → physioblocks-2.0.0/tests/tests_references/circulation_alone/v1.2.0}/circulation_alone_sim.jsonc +0 -0
  336. /physioblocks-1.2.0/references/full_configurations/circulation_alone_sim.jsonc → /physioblocks-2.0.0/tests/tests_references/circulation_alone/v1.2.0/circulation_alone_sim_full.jsonc +0 -0
  337. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/conftest.py +0 -0
  338. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/spherical_heart/ref_spherical_heart_sim_espvr_edpvr.csv +0 -0
  339. {physioblocks-1.2.0/tests/tests_references/spherical_heart → physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/references}/ref_spherical_heart_respiration_sim.csv +0 -0
  340. {physioblocks-1.2.0/tests/tests_references/spherical_heart → physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/references}/ref_spherical_heart_respiration_sim_espvr_edpvr.csv +0 -0
  341. {physioblocks-1.2.0/tests/tests_references/spherical_heart → physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/references}/ref_spherical_heart_sim.csv +0 -0
  342. {physioblocks-1.2.0/references → physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0}/spherical_heart_sim.jsonc +0 -0
  343. /physioblocks-1.2.0/references/full_configurations/spherical_heart_sim.jsonc → /physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/spherical_heart_sim_full_configuration.jsonc +0 -0
  344. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_load_register.py +0 -0
  345. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_save_register.py +0 -0
  346. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_type_register.py +0 -0
  347. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/__init__.py +0 -0
  348. {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/test_process.py +0 -0
@@ -67,8 +67,11 @@ test debian:
67
67
  - pip install .[tox]
68
68
  - tox
69
69
  artifacts:
70
+ when: always
70
71
  paths:
71
72
  - htmlcov
73
+ - tests/tests_references/artifacts
74
+ - doc/build/html
72
75
 
73
76
  # Run reference simulation and trace the comparison with the reference
74
77
  test references debian:
@@ -80,9 +83,10 @@ test references debian:
80
83
  script:
81
84
  - pip install .
82
85
  - python -m physioblocks.launcher.configure -d ./launcher
83
- - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_sim_compare_reference.jsonc -d launcher -s Circulation
84
- - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_sim_compare_reference.jsonc -d launcher -s SphericalHeart
85
- - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_respiration_sim_compare_reference.jsonc -d launcher -s SphericalHeartRespiration
86
+ - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_forward_sim_compare_reference.jsonc -d launcher -s Circulation
87
+ - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_estimation_sim_compare_reference.jsonc -d launcher -s CirculationEstimation
88
+ - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_forward_sim_compare_reference.jsonc -d launcher -s SphericalHeart
89
+ - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_estimation_sim_compare_reference.jsonc -d launcher -s SphericalHeartEstimation
86
90
  artifacts:
87
91
  paths:
88
92
  - launcher/simulations
@@ -94,6 +98,12 @@ test windows:
94
98
  script:
95
99
  - pip install .[tox]
96
100
  - tox
101
+ artifacts:
102
+ when: always
103
+ paths:
104
+ - htmlcov
105
+ - tests/tests_references/artifacts
106
+ - doc/build/html
97
107
 
98
108
  # Run reference simulation and trace the comparison with the reference
99
109
  test references windows:
@@ -103,9 +113,10 @@ test references windows:
103
113
  script:
104
114
  - pip install .
105
115
  - python -m physioblocks.launcher.configure -d ./launcher
106
- - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_sim_compare_reference.jsonc -d launcher -s Circulation
107
- - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_sim_compare_reference.jsonc -d launcher -s SphericalHeart
108
- - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_respiration_sim_compare_reference.jsonc -d launcher -s SphericalHeartRespiration
116
+ - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_forward_sim_compare_reference.jsonc -d launcher -s Circulation
117
+ - python -m physioblocks.launcher tests/tests_references/circulation_alone/circulation_alone_estimation_sim_compare_reference.jsonc -d launcher -s CirculationEstimation
118
+ - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_forward_sim_compare_reference.jsonc -d launcher -s SphericalHeart
119
+ - python -m physioblocks.launcher tests/tests_references/spherical_heart/spherical_heart_estimation_sim_compare_reference.jsonc -d launcher -s SphericalHeartEstimation
109
120
  artifacts:
110
121
  paths:
111
122
  - launcher/simulations
@@ -119,9 +130,8 @@ pages:
119
130
  - large
120
131
  script:
121
132
  - pip install .[doc]
122
- - cd doc
123
- - make html
124
- - mv build/html ../public/
133
+ - sphinx-build -b html doc/source/ doc/build/html/
134
+ - mv doc/build/html public/
125
135
  artifacts:
126
136
  paths:
127
137
  - public
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: physioblocks
3
- Version: 1.2.0
3
+ Version: 2.0.0
4
4
  Dynamic: Author
5
5
  Dynamic: Author-email
6
6
  Dynamic: License
@@ -34,8 +34,8 @@ Requires-Dist: regex
34
34
  Requires-Dist: rich
35
35
  Requires-Dist: scipy
36
36
  Provides-Extra: doc
37
+ Requires-Dist: pydata-sphinx-theme; extra == 'doc'
37
38
  Requires-Dist: sphinx; extra == 'doc'
38
- Requires-Dist: sphinx-rtd-theme; extra == 'doc'
39
39
  Requires-Dist: sphinxcontrib-tikz; extra == 'doc'
40
40
  Provides-Extra: quality
41
41
  Requires-Dist: mypy; extra == 'quality'
@@ -67,10 +67,10 @@ They are several use cases for PhysioBlocks depending on the user profile:
67
67
 
68
68
  ## Interactions
69
69
 
70
- __Level 1:__ Configure and run a simulation : JSON
70
+ __Level 1:__ Configure and run a simulation: JSON
71
71
  * Update the model parameters
72
72
 
73
- __Level 2:__ Create Nets : JSON
73
+ __Level 2:__ Create Nets: JSON
74
74
  * Declare the nodes, the blocks, and the block - nodes connections
75
75
 
76
76
  __Level 3:__ Write and add models to the library: Python
@@ -122,7 +122,7 @@ python -m physioblocks.launcher references/spherical_heart_sim.jsonc -v -s Quick
122
122
  ```
123
123
 
124
124
 
125
- Results will be available in the `$LAUNCHER_FOLDER_PATH$/simulations/QuickStart` series folder:
125
+ Results will be available in the `$LAUNCHER_FOLDER_PATH/simulations/QuickStart` series folder:
126
126
  * the csv files contain the simulation results.
127
127
  * the html files allow you to visualize the results.
128
128
  * the log and json files are here for debug purposes.
@@ -18,10 +18,10 @@ They are several use cases for PhysioBlocks depending on the user profile:
18
18
 
19
19
  ## Interactions
20
20
 
21
- __Level 1:__ Configure and run a simulation : JSON
21
+ __Level 1:__ Configure and run a simulation: JSON
22
22
  * Update the model parameters
23
23
 
24
- __Level 2:__ Create Nets : JSON
24
+ __Level 2:__ Create Nets: JSON
25
25
  * Declare the nodes, the blocks, and the block - nodes connections
26
26
 
27
27
  __Level 3:__ Write and add models to the library: Python
@@ -73,7 +73,7 @@ python -m physioblocks.launcher references/spherical_heart_sim.jsonc -v -s Quick
73
73
  ```
74
74
 
75
75
 
76
- Results will be available in the `$LAUNCHER_FOLDER_PATH$/simulations/QuickStart` series folder:
76
+ Results will be available in the `$LAUNCHER_FOLDER_PATH/simulations/QuickStart` series folder:
77
77
  * the csv files contain the simulation results.
78
78
  * the html files allow you to visualize the results.
79
79
  * the log and json files are here for debug purposes.
@@ -0,0 +1,2 @@
1
+ build
2
+ simulations_results
@@ -24,21 +24,14 @@
24
24
  .. You should have received a copy of the GNU Lesser General Public License along with
25
25
  .. PhysioBlocks. If not, see <https://www.gnu.org/licenses/>.
26
26
 
27
- *********
28
- IO Module
29
- *********
27
+ .. _api_reference :
30
28
 
31
- .. automodule:: physioblocks.io
32
- :members:
29
+ #############
30
+ API Reference
31
+ #############
33
32
 
34
- Configuration
35
- =============
33
+ .. autosummary::
34
+ :toctree: _autosummary
35
+ :recursive:
36
36
 
37
- .. automodule:: physioblocks.io.configuration
38
- :members:
39
-
40
- Aliases
41
- =======
42
-
43
- .. automodule:: physioblocks.io.aliases
44
- :members:
37
+ physioblocks
@@ -0,0 +1,200 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ import shutil
10
+ import subprocess
11
+ import sys
12
+ import warnings
13
+ from pathlib import Path
14
+
15
+ from sphinx.application import Sphinx
16
+
17
+ import physioblocks
18
+ from physioblocks.launcher.constants import (
19
+ LAUNCHER_SERIES_DIR_NAME,
20
+ LAUNCHER_USER_ALIASES_DIR_NAME,
21
+ LAUNCHER_USER_LIBRARY_DIR_NAME,
22
+ )
23
+
24
+ project = physioblocks.__name__
25
+ copyright = physioblocks.__copyright__
26
+ author = str(physioblocks.__authors__)
27
+ release = physioblocks.__version__
28
+
29
+ # -- General configuration ---------------------------------------------------
30
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
31
+
32
+
33
+ extensions = [
34
+ "sphinx.ext.autodoc",
35
+ "sphinx.ext.autosummary",
36
+ "sphinx.ext.napoleon",
37
+ "sphinx.ext.intersphinx",
38
+ "sphinxcontrib.tikz",
39
+ ]
40
+ autosummary_generate = True
41
+ autodoc_default_options = {
42
+ "members": True,
43
+ "member-order": "bysource",
44
+ "ignore-module-all": True,
45
+ }
46
+ autosummary_ignore_module_all = True
47
+
48
+ # Mappings for sphinx.ext.intersphinx. Projects have to have Sphinx-generated doc!
49
+ intersphinx_mapping = {
50
+ "python": ("https://docs.python.org/3/", None),
51
+ "numpy": ("https://numpy.org/doc/stable/", None),
52
+ }
53
+
54
+ tikz_latex_preamble = "\\usepackage[siunitx, RPvoltages]{circuitikz}"
55
+
56
+ add_module_names = False
57
+ pygments_style = "sphinx"
58
+ exclude_patterns = []
59
+ mathjax3_config = {"chtml": {"displayAlign": "center"}}
60
+
61
+ napoleon_custom_sections = [
62
+ "Scheme",
63
+ "Fluxes",
64
+ "Discretization",
65
+ "Internal Equations",
66
+ "Saved Quantities",
67
+ "Configuration",
68
+ "Aliases",
69
+ ]
70
+
71
+ # -- Options for HTML output -------------------------------------------------
72
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
73
+
74
+ html_theme = "pydata_sphinx_theme"
75
+ html_static_path = ["_static"]
76
+
77
+
78
+ # NamedTuple fields are already documented in the "Attributes" section.
79
+ def _skip_namedtuple_fields(app, what, name, obj, skip, options):
80
+ if (obj.__doc__ or "").startswith("Alias for field number"):
81
+ return True
82
+ return None
83
+
84
+
85
+ def _on_builder_inited(app: Sphinx):
86
+ # Generate the example results if 'run-example' is set to true. Default is True
87
+ if app.config.run_examples:
88
+ _run_examples(app.srcdir, app.outdir)
89
+
90
+
91
+ def _run_examples(exec_dir: Path, out_dir: Path):
92
+ # Initialize the launcher folder
93
+ temp_launcher_folder = exec_dir / "_simulations"
94
+ _initialize_launcher_folder(exec_dir, temp_launcher_folder)
95
+
96
+ try:
97
+ # Initialize example folder
98
+ example_configurations_folder = exec_dir / "examples" / "configurations"
99
+ example_configurations_folder.mkdir(exist_ok=True)
100
+
101
+ example_library_folder = exec_dir / "examples" / "library"
102
+ example_library_folder.mkdir(exist_ok=True)
103
+ shutil.copytree(
104
+ example_library_folder,
105
+ temp_launcher_folder / LAUNCHER_USER_LIBRARY_DIR_NAME,
106
+ dirs_exist_ok=True,
107
+ )
108
+
109
+ example_aliases_folder = exec_dir / "examples" / "aliases"
110
+ example_aliases_folder.mkdir(exist_ok=True)
111
+ shutil.copytree(
112
+ example_aliases_folder,
113
+ temp_launcher_folder / LAUNCHER_USER_ALIASES_DIR_NAME,
114
+ dirs_exist_ok=True,
115
+ )
116
+
117
+ output_simulation_folder = out_dir
118
+
119
+ # run example simulations
120
+ _generate_simulation_results(
121
+ exec_dir,
122
+ example_configurations_folder,
123
+ temp_launcher_folder,
124
+ output_simulation_folder,
125
+ )
126
+
127
+ finally:
128
+ shutil.rmtree(temp_launcher_folder)
129
+
130
+
131
+ def _initialize_launcher_folder(exec_dir: Path, path: Path):
132
+ # Initialized a result folder
133
+ exit_code = subprocess.call(
134
+ [
135
+ sys.executable,
136
+ "-m",
137
+ "physioblocks.launcher.configure",
138
+ "-d",
139
+ str(path),
140
+ ],
141
+ cwd=exec_dir,
142
+ )
143
+ if exit_code != 0:
144
+ warnings.warn("Launcher configuration failed", stacklevel=2)
145
+
146
+
147
+ def _generate_simulation_results(
148
+ exec_dir: Path,
149
+ configurations_folder: Path,
150
+ launcher_folder: Path,
151
+ output_folder: Path,
152
+ ):
153
+ configurations = [
154
+ file
155
+ for file in configurations_folder.rglob("*")
156
+ if file.suffix in {".json", ".jsonc"}
157
+ ]
158
+ for configuration in sorted(configurations):
159
+ series_name = configuration.name.removesuffix(configuration.suffix)
160
+ series_path = launcher_folder / LAUNCHER_SERIES_DIR_NAME / series_name
161
+
162
+ # Run simulation
163
+ exit_code = subprocess.call(
164
+ [
165
+ sys.executable,
166
+ "-m",
167
+ "physioblocks.launcher",
168
+ str(configuration),
169
+ "-d",
170
+ str(launcher_folder),
171
+ "-s",
172
+ series_name,
173
+ ],
174
+ cwd=exec_dir,
175
+ )
176
+ if exit_code != 0:
177
+ warnings.warn(
178
+ f"Simulation for configuration at {configuration} failed",
179
+ stacklevel=2,
180
+ )
181
+
182
+ # copy the html to the output folder
183
+ rel_config = configuration.relative_to(configurations_folder)
184
+ html_folder: Path = output_folder / rel_config.with_suffix("")
185
+ html_folder.mkdir(exist_ok=True, parents=True)
186
+ for file in series_path.rglob("*"):
187
+ if file.suffix == ".html":
188
+ shutil.copy(file, html_folder)
189
+
190
+
191
+ def setup(app: Sphinx):
192
+ app.add_config_value(
193
+ "run_examples",
194
+ default=True,
195
+ rebuild="html",
196
+ types=(bool),
197
+ description="Generate the simulations results for documentation examples.",
198
+ )
199
+ app.connect("autodoc-skip-member", _skip_namedtuple_fields)
200
+ app.connect("builder-inited", _on_builder_inited)
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "piecewise_linear_periodic",
3
+ "evaluation_quantities": {"time": "time"},
4
+ "period": 1.0,
5
+ "points_abscissas": [0.0, 0.075, 0.135, 0.140, 0.275],
6
+ "points_ordinates": [0.0, 0.0, 0.5e-3, 0.5e-3, 0.0]
7
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "type": "net",
3
+ "nodes": ["A", "B", "C"],
4
+ "flux_dof_definitions": {"flow": "pressure"},
5
+ "blocks": {
6
+ "RC_1": {
7
+ "type": "rc_block",
8
+ "flux_type": "flow",
9
+ "resistance": "Ra",
10
+ "capacitance": "Ca",
11
+ "nodes":
12
+ {
13
+ "1": "B",
14
+ "2": "A"
15
+ }
16
+ },
17
+ "RC_2": {
18
+ "type": "rc_block",
19
+ "flux_type": "flow",
20
+ "resistance": "Rb",
21
+ "capacitance": "Cb",
22
+ "nodes":
23
+ {
24
+ "1": "C",
25
+ "2": "B"
26
+ }
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "type": "forward_simulation",
3
+ "solver": {
4
+ "type": "newton_solver",
5
+ "tolerance": 1e-9,
6
+ "iteration_max": 2
7
+ },
8
+ "time": {
9
+ "type": "range",
10
+ "start": 0.0,
11
+ "length": 30.0,
12
+ "step_size": 0.001
13
+ },
14
+ "simulation_options": {
15
+ "min_step": 6.25e-5
16
+ },
17
+ "net": {
18
+ "type": "net",
19
+ "flux_dof_definitions": {
20
+ "flow": "pressure"
21
+ },
22
+ "nodes": ["A", "B", "C"],
23
+ "blocks": {
24
+ "RC_1": {
25
+ "type": "rc_block",
26
+ "flux_type": "flow",
27
+ "resistance": "Ra",
28
+ "capacitance": "Ca",
29
+ "nodes":
30
+ {
31
+ "1": "B",
32
+ "2": "A"
33
+ }
34
+ },
35
+ "RC_2": {
36
+ "type": "rc_block",
37
+ "flux_type": "flow",
38
+ "resistance": "Rb",
39
+ "capacitance": "Cb",
40
+ "nodes":
41
+ {
42
+ "1": "C",
43
+ "2": "B"
44
+ }
45
+ }
46
+ },
47
+ "boundaries_conditions": {
48
+ "C": [
49
+ {
50
+ "type": "condition",
51
+ "condition_type": "pressure",
52
+ "condition_id": "C.pressure"
53
+ }
54
+ ],
55
+ "A": [
56
+ {
57
+ "type": "condition",
58
+ "condition_type": "flow",
59
+ "condition_id": "A.flow"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ "state": {
65
+ "A.pressure": {
66
+ "type": "quantity",
67
+ "value": 8e3,
68
+ "magnitude": 1e5
69
+ },
70
+ "B.pressure": {
71
+ "type": "quantity",
72
+ "value": 8e3,
73
+ "magnitude": 1e5
74
+ }
75
+ },
76
+ "parameters": {
77
+ "Ca": 2.0e-10,
78
+ "Ra": 8.0e6,
79
+ "Cb": 1.7e-08,
80
+ "Rb": 1.0e8,
81
+ "C.pressure": 1.6e3,
82
+ "sin_period": 0.80
83
+ },
84
+ "update_functions": {
85
+ "A.flow": {
86
+ "type": "sinus_offset",
87
+ "evaluation_quantities": {"time": "time"},
88
+ "offset_value": 1.0e-3,
89
+ "amplitude": 1.0e-3,
90
+ "frequency": {
91
+ "type": "product",
92
+ "factors": [1.0],
93
+ "inverses": ["sin_period"]
94
+ },
95
+ "phase_shift": 0.0
96
+ }
97
+ },
98
+ "output_functions":{
99
+ "A.flow": {"type": "watch_quantity", "evaluation_quantities": {"quantity": "A.flow"}},
100
+ "Ca.volume_stored": {
101
+ "type": "product",
102
+ "factors": ["Ca", "A.pressure"],
103
+ "evaluation_quantities": {"A.pressure": "A.pressure"}
104
+ }
105
+ },
106
+ // We did not define preprocesses for the simulation.
107
+ // "preprocesses": {}
108
+ "postprocesses": {
109
+ "conversion": {
110
+ "type": "conversion_process",
111
+ "conversion_factors": {
112
+ "A.flow": 1.0e6, // from m3/s to mL/s
113
+ "Ca.volume_stored": 1.0e6, // from m3 to mL
114
+ "A.pressure": 0.00750062, // from Pa to mmHg
115
+ "B.pressure": 0.00750062 // from Pa to mmHg
116
+ },
117
+ "inputs": ["main"],
118
+ "outputs": ["main_medical_units"]
119
+ }
120
+ },
121
+ "plots": {
122
+ "pressures": {
123
+ "type": "plot",
124
+ "abscissas": "time",
125
+ "subplots": ["A.pressure", "B.pressure"],
126
+ "inputs": ["main_medical_units"]
127
+ },
128
+ "main_medical_units": {
129
+ "type": "plot",
130
+ "abscissas": "time",
131
+ "inputs": ["main_medical_units"],
132
+ "layout": {
133
+ "xaxis1_title": "time (s)",
134
+ "yaxis1_title": "pressure (mmHg)",
135
+ "xaxis2_title": "time (s)",
136
+ "yaxis2_title": "pressure (mmHg)",
137
+ "xaxis3_title": "time (s)",
138
+ "yaxis3_title": "flux (mL/s)",
139
+ "xaxis4_title": "time (s)",
140
+ "yaxis4_title": "pressure (mL)"
141
+ }
142
+ }
143
+ }
144
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "type": "default_forward_simulation",
3
+ "solver": {"type": "linear_solver"},
4
+ "time": {
5
+ "start": -10.0,
6
+ "step_size": 0.001,
7
+ "length": 20.0
8
+ },
9
+ "net": {
10
+ "type": "simple_circulation_net",
11
+ "boundaries_conditions": {
12
+ "C": [{
13
+ "type": "condition",
14
+ "condition_type": "pressure",
15
+ "condition_id": "C.pressure"
16
+ }],
17
+ "A": [{
18
+ "type": "condition",
19
+ "condition_type": "flow",
20
+ "condition_id": "A.flow"
21
+ }]
22
+ }
23
+ },
24
+ "state": {
25
+ "A.pressure": {
26
+ "type": "quantity",
27
+ "value": 8e3,
28
+ "magnitude": 1e5
29
+ },
30
+ "B.pressure": {
31
+ "type": "quantity",
32
+ "value": 8e3,
33
+ "magnitude": 1e5
34
+ }
35
+ },
36
+ "parameters": {
37
+ "Ca": 2.0e-10,
38
+ "Ra": 8.0e6,
39
+ "Cb": 1.7e-08,
40
+ "Rb": 1.0e8,
41
+ "C.pressure": 1.6e3
42
+ },
43
+ "update_functions": {
44
+ "A.flow": {"type": "flow_pulse_function"}
45
+ },
46
+ "postprocesses": {
47
+ "remove_transition": {
48
+ "type": "drop_process",
49
+ "inputs": ["main"],
50
+ "outputs": ["synthetic_data"],
51
+ "columns":["B.pressure"],
52
+ "abscissas_name": "time",
53
+ "abscissas_interval": [-10.0001, -0.0001]
54
+ },
55
+ "copy": {
56
+ "type": "write_process",
57
+ "inputs": ["synthetic_data"],
58
+ "destinations": ["simulations_results/user_guide/level_2/estimation/1_synthetic_data/synthetic_data.csv"]
59
+ }
60
+ },
61
+ "plots": {
62
+ "synthetic_data": {
63
+ "type": "plot",
64
+ "abscissas": "time",
65
+ "inputs": ["synthetic_data"],
66
+ "subplots": ["A.pressure"],
67
+ "layout": {
68
+ "xaxis_title": "time (s)",
69
+ "yaxis_title": "pressure (Pa)"
70
+ }
71
+ }
72
+ }
73
+ }