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.
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab-ci.yml +19 -9
- {physioblocks-1.2.0 → physioblocks-2.0.0}/PKG-INFO +6 -6
- {physioblocks-1.2.0 → physioblocks-2.0.0}/README.md +3 -3
- physioblocks-2.0.0/doc/.gitignore +2 -0
- physioblocks-1.2.0/doc/source/api_reference/io.rst → physioblocks-2.0.0/doc/source/api_reference.rst +8 -15
- physioblocks-2.0.0/doc/source/conf.py +200 -0
- physioblocks-2.0.0/doc/source/examples/aliases/flow_pulse_function.json +7 -0
- physioblocks-2.0.0/doc/source/examples/aliases/simple_circulation_net.json +29 -0
- physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/create_simulation/simple_circulation.jsonc +144 -0
- physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/1_synthetic_data.jsonc +73 -0
- physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/2_state_estimation.jsonc +103 -0
- physioblocks-2.0.0/doc/source/examples/configurations/user_guide/level_2/estimation/3_parameter_estimation.jsonc +105 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/index.rst +0 -1
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/installation.rst +4 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/presentation.rst +9 -6
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1/launch_simulation.rst +16 -15
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1/launcher.rst +2 -2
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/aliases.rst +49 -41
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/create_net.rst +47 -47
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/create_simulation.rst +283 -162
- physioblocks-2.0.0/doc/source/user_guide/level_2/estimation.rst +537 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2/overview.rst +10 -10
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_2.rst +4 -2
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_definition.rst +40 -32
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_test.rst +60 -29
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/overview.rst +19 -19
- physioblocks-2.0.0/doc/source/user_guide/level_3/filters.rst +137 -0
- physioblocks-2.0.0/doc/source/user_guide/level_3/functions.rst +110 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/processes.rst +14 -9
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/specific_installations.rst +9 -4
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3.rst +7 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/__init__.py +2 -2
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/function_factories.py +11 -9
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/operators.py +5 -15
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/registers.py +33 -31
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/computing/__init__.py +1 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/computing/assembling.py +111 -109
- physioblocks-2.0.0/physioblocks/computing/models.py +803 -0
- physioblocks-2.0.0/physioblocks/computing/quantities.py +1016 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/__init__.py +2 -4
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/aliases.py +60 -35
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/base.py +35 -27
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/computing/__init__.py +2 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/computing/quantities.py +30 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/constants.py +39 -7
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/__init__.py +1 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/blocks.py +70 -17
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/description/nets.py +48 -30
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/functions.py +194 -172
- physioblocks-2.0.0/physioblocks/configuration/io.py +126 -0
- physioblocks-2.0.0/physioblocks/configuration/migrations.py +250 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/configuration/simulation/__init__.py +4 -3
- physioblocks-2.0.0/physioblocks/configuration/simulation/_migrations/__init__.py +27 -0
- physioblocks-2.0.0/physioblocks/configuration/simulation/_migrations/_v2_0_0.py +267 -0
- physioblocks-2.0.0/physioblocks/configuration/simulation/functions.py +107 -0
- physioblocks-2.0.0/physioblocks/configuration/simulation/observer.py +77 -0
- physioblocks-2.0.0/physioblocks/configuration/simulation/simulations.py +364 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/__init__.py +1 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/blocks.py +278 -182
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/flux.py +69 -43
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/description/nets.py +426 -214
- {physioblocks-1.2.0/physioblocks/library/functions → physioblocks-2.0.0/physioblocks/io}/__init__.py +1 -1
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/io/aliases.py +18 -11
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/io/configuration.py +34 -28
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/__main__.py +37 -31
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/configuration.py +70 -37
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/configure/__main__.py +4 -7
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/constants.py +4 -7
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/files.py +59 -31
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/launcher/series.py +114 -43
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/__init__.py +1 -1
- physioblocks-1.2.0/physioblocks/simulation/constants.py → physioblocks-2.0.0/physioblocks/library/aliases/__init__.py +4 -3
- physioblocks-2.0.0/physioblocks/library/aliases/flux/__init__.py +43 -0
- physioblocks-2.0.0/physioblocks/library/aliases/nets/__init__.py +110 -0
- physioblocks-2.0.0/physioblocks/library/aliases/plots/plot_pv_loop.json +29 -0
- physioblocks-2.0.0/physioblocks/library/aliases/plots/subplots_estimation.json +51 -0
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/__init__.py +305 -0
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/circulation_alone_estimation_ukf.jsonc +159 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/circulation_alone_forward_simulation.jsonc +24 -27
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_estimation_simulation.jsonc +25 -0
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_forward_simulation.jsonc +23 -0
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/default_time.jsonc +7 -0
- physioblocks-2.0.0/physioblocks/library/aliases/simulations/spherical_heart_estimation_ukf.jsonc +411 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/spherical_heart_forward_simulation.jsonc +117 -83
- physioblocks-2.0.0/physioblocks/library/blocks/__init__.py +27 -0
- physioblocks-2.0.0/physioblocks/library/blocks/capacitances.py +672 -0
- physioblocks-2.0.0/physioblocks/library/blocks/cavity.py +322 -0
- physioblocks-2.0.0/physioblocks/library/blocks/valves.py +329 -0
- physioblocks-2.0.0/physioblocks/library/filters/__init__.py +26 -0
- physioblocks-2.0.0/physioblocks/library/filters/discrepancies.py +107 -0
- physioblocks-2.0.0/physioblocks/library/filters/kalman_filter.py +190 -0
- physioblocks-2.0.0/physioblocks/library/filters/sigmas.py +309 -0
- physioblocks-2.0.0/physioblocks/library/filters/unscented_kalman_filter.py +330 -0
- {physioblocks-1.2.0/physioblocks/utils → physioblocks-2.0.0/physioblocks/library/functions}/__init__.py +1 -1
- physioblocks-2.0.0/physioblocks/library/functions/base_operations.py +189 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/first_order.py +42 -14
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/piecewise.py +127 -43
- physioblocks-2.0.0/physioblocks/library/functions/transform.py +278 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/functions/trigonometric.py +40 -17
- physioblocks-2.0.0/physioblocks/library/functions/watchers.py +86 -0
- {physioblocks-1.2.0/physioblocks/library/blocks → physioblocks-2.0.0/physioblocks/library/model_components}/__init__.py +1 -1
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/model_components/active_law.py +205 -92
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/model_components/dynamics.py +508 -348
- physioblocks-2.0.0/physioblocks/library/model_components/rheology.py +319 -0
- physioblocks-2.0.0/physioblocks/library/model_components/velocity_law.py +217 -0
- {physioblocks-1.2.0/physioblocks/io → physioblocks-2.0.0/physioblocks/library/processes}/__init__.py +1 -3
- physioblocks-2.0.0/physioblocks/library/processes/_migrations/__init__.py +27 -0
- physioblocks-2.0.0/physioblocks/library/processes/_migrations/_v2_0_0.py +71 -0
- physioblocks-2.0.0/physioblocks/library/processes/computing_processes.py +358 -0
- physioblocks-2.0.0/physioblocks/library/processes/espvr_edpvr_process.py +134 -0
- physioblocks-2.0.0/physioblocks/library/processes/file_processes.py +237 -0
- physioblocks-2.0.0/physioblocks/library/processes/plot_processes.py +214 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/__init__.py +1 -3
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/load_function_register.py +33 -24
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/save_function_register.py +43 -30
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/registers/type_register.py +51 -27
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/__init__.py +5 -11
- physioblocks-2.0.0/physioblocks/simulation/_filter_functions.py +149 -0
- physioblocks-2.0.0/physioblocks/simulation/base.py +1203 -0
- physioblocks-2.0.0/physioblocks/simulation/estimation.py +1019 -0
- physioblocks-2.0.0/physioblocks/simulation/forward.py +205 -0
- physioblocks-2.0.0/physioblocks/simulation/functions.py +252 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/process.py +105 -64
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/saved_quantities.py +42 -36
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/simulation/solvers.py +102 -45
- physioblocks-2.0.0/physioblocks/simulation/time_manager.py +265 -0
- physioblocks-2.0.0/physioblocks/utils/__init__.py +27 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/utils/dynamic_import_utils.py +13 -15
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/utils/exceptions_utils.py +97 -30
- physioblocks-2.0.0/physioblocks/utils/gradient_test_utils.py +320 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/pyproject.toml +1 -1
- physioblocks-2.0.0/references/circulation_alone_estimation_sim.jsonc +29 -0
- physioblocks-2.0.0/references/circulation_alone_forward_sim.jsonc +15 -0
- physioblocks-2.0.0/references/full_configurations/circulation_alone_estimation_sim.jsonc +336 -0
- physioblocks-2.0.0/references/full_configurations/circulation_alone_forward_sim.jsonc +189 -0
- physioblocks-2.0.0/references/full_configurations/spherical_heart_estimation_sim.jsonc +749 -0
- 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
- physioblocks-2.0.0/references/spherical_heart_estimation_sim.jsonc +36 -0
- physioblocks-2.0.0/references/spherical_heart_forward_sim.jsonc +20 -0
- physioblocks-2.0.0/references/synthetic_data/circulation_alone_measurements.csv +10002 -0
- physioblocks-2.0.0/references/synthetic_data/spherical_heart_measurements.csv +10001 -0
- physioblocks-2.0.0/ruff.toml +15 -0
- 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
- physioblocks-2.0.0/tests/tests_computing/test_models.py +364 -0
- physioblocks-2.0.0/tests/tests_computing/test_quantities.py +874 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/test_generic_save_load.py +2 -1
- physioblocks-2.0.0/tests/tests_config/test_io.py +115 -0
- physioblocks-2.0.0/tests/tests_config/test_migrations.py +186 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_blocks.py +1 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_boundary_condition.py +1 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/test_config_nets.py +26 -35
- physioblocks-2.0.0/tests/tests_config/tests_simulation/test_config_simulation.py +260 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/test_config_solvers.py +1 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/test_functions.py +3 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_blocks.py +20 -14
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_nets.py +139 -119
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/test_relations.py +15 -9
- physioblocks-2.0.0/tests/tests_launcher/test_configuration.py +123 -0
- physioblocks-2.0.0/tests/tests_launcher/test_files.py +201 -0
- physioblocks-2.0.0/tests/tests_launcher/test_main.py +125 -0
- physioblocks-2.0.0/tests/tests_launcher/test_series.py +199 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_capacitances.py +4 -5
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_cavity.py +3 -4
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_blocks/test_valves.py +4 -5
- physioblocks-2.0.0/tests/tests_library/tests_filters/test_kalman_filters.py +225 -0
- physioblocks-2.0.0/tests/tests_library/tests_filters/test_sigma_points.py +116 -0
- physioblocks-2.0.0/tests/tests_library/tests_functions/test_base_operations_functions.py +80 -0
- 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
- physioblocks-2.0.0/tests/tests_library/tests_functions/test_watch_functions.py +41 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_active_law.py +18 -5
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_dynamics_block.py +49 -5
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_rheology.py +3 -4
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_model_components/test_velocity_law_hht.py +2 -3
- 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
- physioblocks-2.0.0/tests/tests_library/tests_processes/test_espvr_edpvr_process.py +185 -0
- physioblocks-2.0.0/tests/tests_library/tests_processes/test_file_processes.py +133 -0
- physioblocks-2.0.0/tests/tests_library/tests_processes/test_plot_processes.py +130 -0
- physioblocks-2.0.0/tests/tests_references/.gitignore +1 -0
- physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_estimation_sim.jsonc +71 -0
- physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_estimation_sim_compare_reference.jsonc +19 -0
- physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_forward_sim_compare_reference.jsonc +19 -0
- physioblocks-2.0.0/tests/tests_references/circulation_alone/circulation_alone_model_gradient_test.json +49 -0
- physioblocks-2.0.0/tests/tests_references/circulation_alone/ref_circulation_alone_estimation_ukf_sim.csv +10002 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/compare.py +12 -3
- physioblocks-2.0.0/tests/tests_references/functions.py +195 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_estimation_sim.csv +4 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_estimation_sim_espvr_edpvr.csv +1302 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/ref_spherical_heart_sim.csv +10002 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_estimation_sim_compare_reference.jsonc +31 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_forward_sim_compare_reference.jsonc +31 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/spherical_heart_model_gradient_test.json +148 -0
- physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0/references/ref_spherical_heart_sim_espvr_edpvr.csv +1302 -0
- physioblocks-2.0.0/tests/tests_references/test_circulation_alone.py +102 -0
- physioblocks-2.0.0/tests/tests_references/test_spherical_heart.py +139 -0
- physioblocks-2.0.0/tests/tests_simulation/test_base.py +393 -0
- physioblocks-2.0.0/tests/tests_simulation/test_estimation.py +233 -0
- physioblocks-2.0.0/tests/tests_simulation/test_forward.py +118 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/test_solvers.py +5 -5
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/test_time_manager.py +49 -73
- physioblocks-2.0.0/tests/tests_utils/test_dynamic_import_utils.py +160 -0
- physioblocks-2.0.0/tests/tests_utils/test_gradient_test_utils.py +148 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tox.toml +9 -1
- physioblocks-1.2.0/doc/.gitignore +0 -1
- physioblocks-1.2.0/doc/source/api_reference/base.rst +0 -52
- physioblocks-1.2.0/doc/source/api_reference/computing.rst +0 -55
- physioblocks-1.2.0/doc/source/api_reference/configuration.rst +0 -50
- physioblocks-1.2.0/doc/source/api_reference/description.rst +0 -51
- physioblocks-1.2.0/doc/source/api_reference/registers.rst +0 -51
- physioblocks-1.2.0/doc/source/api_reference/simulation.rst +0 -83
- physioblocks-1.2.0/doc/source/api_reference/utils.rst +0 -56
- physioblocks-1.2.0/doc/source/api_reference.rst +0 -44
- physioblocks-1.2.0/doc/source/conf.py +0 -53
- physioblocks-1.2.0/doc/source/library/aliases/blocks.rst +0 -112
- physioblocks-1.2.0/doc/source/library/aliases/model_components.rst +0 -99
- physioblocks-1.2.0/doc/source/library/aliases/nets.rst +0 -161
- physioblocks-1.2.0/doc/source/library/aliases/simulation.rst +0 -219
- physioblocks-1.2.0/doc/source/library/aliases.rst +0 -43
- physioblocks-1.2.0/doc/source/library/blocks.rst +0 -50
- physioblocks-1.2.0/doc/source/library/configuration/functions.rst +0 -289
- physioblocks-1.2.0/doc/source/library/configuration/net.rst +0 -234
- physioblocks-1.2.0/doc/source/library/configuration/simulation.rst +0 -167
- physioblocks-1.2.0/doc/source/library/configuration.rst +0 -40
- physioblocks-1.2.0/doc/source/library/functions.rst +0 -65
- physioblocks-1.2.0/doc/source/library/model_components.rst +0 -56
- physioblocks-1.2.0/doc/source/library/processes.rst +0 -46
- physioblocks-1.2.0/doc/source/library.rst +0 -48
- physioblocks-1.2.0/physioblocks/computing/models.py +0 -1123
- physioblocks-1.2.0/physioblocks/computing/quantities.py +0 -354
- physioblocks-1.2.0/physioblocks/configuration/simulation/simulations.py +0 -305
- physioblocks-1.2.0/physioblocks/library/aliases/simulations/default_forward_simulation.jsonc +0 -14
- physioblocks-1.2.0/physioblocks/library/aliases/simulations/default_time.jsonc +0 -8
- physioblocks-1.2.0/physioblocks/library/aliases/simulations/spherical_heart_with_respiration_forward_simulation.jsonc +0 -48
- physioblocks-1.2.0/physioblocks/library/blocks/capacitances.py +0 -464
- physioblocks-1.2.0/physioblocks/library/blocks/cavity.py +0 -233
- physioblocks-1.2.0/physioblocks/library/blocks/valves.py +0 -254
- physioblocks-1.2.0/physioblocks/library/functions/base_operations.py +0 -129
- physioblocks-1.2.0/physioblocks/library/functions/watchers.py +0 -113
- physioblocks-1.2.0/physioblocks/library/model_components/__init__.py +0 -27
- physioblocks-1.2.0/physioblocks/library/model_components/rheology.py +0 -233
- physioblocks-1.2.0/physioblocks/library/model_components/velocity_law.py +0 -169
- physioblocks-1.2.0/physioblocks/library/processes/__init__.py +0 -3
- physioblocks-1.2.0/physioblocks/library/processes/conversion_process.py +0 -74
- physioblocks-1.2.0/physioblocks/library/processes/espvr_edpvr_process.py +0 -145
- physioblocks-1.2.0/physioblocks/library/processes/file_processes.py +0 -128
- physioblocks-1.2.0/physioblocks/library/processes/plot_processes.py +0 -183
- physioblocks-1.2.0/physioblocks/simulation/functions.py +0 -71
- physioblocks-1.2.0/physioblocks/simulation/runtime.py +0 -552
- physioblocks-1.2.0/physioblocks/simulation/setup.py +0 -585
- physioblocks-1.2.0/physioblocks/simulation/state.py +0 -403
- physioblocks-1.2.0/physioblocks/simulation/time_manager.py +0 -354
- physioblocks-1.2.0/physioblocks/utils/gradient_test_utils.py +0 -317
- physioblocks-1.2.0/physioblocks/utils/math_utils.py +0 -109
- physioblocks-1.2.0/references/spherical_heart_respiration_sim.jsonc +0 -28
- physioblocks-1.2.0/ruff.toml +0 -7
- physioblocks-1.2.0/tests/helpers/assertion_helpers.py +0 -85
- physioblocks-1.2.0/tests/tests_computing/test_models.py +0 -520
- physioblocks-1.2.0/tests/tests_computing/test_quantities.py +0 -353
- physioblocks-1.2.0/tests/tests_config/tests_simulation/simulation_reference.json +0 -73
- physioblocks-1.2.0/tests/tests_config/tests_simulation/test_config_simulation.py +0 -301
- physioblocks-1.2.0/tests/tests_config/tests_simulation/test_config_time.py +0 -71
- physioblocks-1.2.0/tests/tests_library/tests_processes/test_conversion_process.py +0 -157
- physioblocks-1.2.0/tests/tests_library/tests_processes/test_espvr_edpvr_process.py +0 -132
- physioblocks-1.2.0/tests/tests_library/tests_processes/test_plot_processes.py +0 -244
- physioblocks-1.2.0/tests/tests_references/circulation_alone/circulation_alone_sim_compare_reference.jsonc +0 -8
- physioblocks-1.2.0/tests/tests_references/circulation_alone/circulation_alone_sim_gradient_test.json +0 -24
- physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_respiration_sim_compare_reference.jsonc +0 -10
- physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_sim_compare_reference.jsonc +0 -10
- physioblocks-1.2.0/tests/tests_references/spherical_heart/spherical_heart_sim_gradient_test.json +0 -55
- physioblocks-1.2.0/tests/tests_references/test_circulation_alone.py +0 -73
- physioblocks-1.2.0/tests/tests_references/test_spherical_heart.py +0 -142
- physioblocks-1.2.0/tests/tests_simulation/test_runtime.py +0 -284
- physioblocks-1.2.0/tests/tests_simulation/test_setup.py +0 -206
- physioblocks-1.2.0/tests/tests_simulation/test_state.py +0 -242
- physioblocks-1.2.0/tests/tests_utils/test_math_utils.py +0 -64
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/documentation.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitignore +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Bug.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Documentation.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/.gitlab/issue_templates/Feature.md +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/Makefile +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/make.bat +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/assembling_example_scheme.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/circulation_net_scheme.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/circulation_net_scheme_heart.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/model_heart_circulation_0D.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/simple_circulation_model.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/simple_circulation_model_heart.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/schemes/spherical_heart_net_scheme.tex +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_1.rst +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks/block_configuration.rst +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide/level_3/blocks.rst +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/doc/source/user_guide.rst +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/docker/latex/Dockerfile +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/docker/pyenv/Dockerfile +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/licenses/GPL-3.0-only.txt +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/licenses/LGPL-3.0-only.txt +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/base/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/c_block.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/rc_block.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/rcr_block.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/spherical_cavity_block.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/blocks/valve_rl_block.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/flux/heart_flux_dof_couples.jsonc +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/active_law_macro_huxley_two_moments.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/rheology_fiber_additive.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/spherical_dynamics.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/model_components/velocity_law_hht.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/nets/circulation_alone_net.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/nets/spherical_heart_net.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/physioblocks/library/aliases/simulations/newton_method_solver.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/helpers/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_base/test_function_factories.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_base/test_register.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_computing/test_assembling.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/test_definitions.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_alias/test_alias.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_description/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_config/tests_simulation/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_description/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/__init__.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/alt_config_file_path.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/commented_config_file_path.jsonc +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/references/configuration.json +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/test_aliases.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_io/test_configuration.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_first_order_functions.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_piecewise_functions.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_library/tests_functions/test_trigonometric_functions.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/__init__.py +0 -0
- /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
- {physioblocks-1.2.0/references → physioblocks-2.0.0/tests/tests_references/circulation_alone/v1.2.0}/circulation_alone_sim.jsonc +0 -0
- /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
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/conftest.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_references/spherical_heart/ref_spherical_heart_sim_espvr_edpvr.csv +0 -0
- {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
- {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
- {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
- {physioblocks-1.2.0/references → physioblocks-2.0.0/tests/tests_references/spherical_heart/v1.2.0}/spherical_heart_sim.jsonc +0 -0
- /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
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_load_register.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_save_register.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_registers/test_type_register.py +0 -0
- {physioblocks-1.2.0 → physioblocks-2.0.0}/tests/tests_simulation/__init__.py +0 -0
- {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/
|
|
84
|
-
- python -m physioblocks.launcher tests/tests_references/
|
|
85
|
-
- python -m physioblocks.launcher tests/tests_references/spherical_heart/
|
|
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/
|
|
107
|
-
- python -m physioblocks.launcher tests/tests_references/
|
|
108
|
-
- python -m physioblocks.launcher tests/tests_references/spherical_heart/
|
|
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
|
-
-
|
|
123
|
-
-
|
|
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.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: physioblocks
|
|
3
|
-
Version:
|
|
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
|
|
70
|
+
__Level 1:__ Configure and run a simulation: JSON
|
|
71
71
|
* Update the model parameters
|
|
72
72
|
|
|
73
|
-
__Level 2:__ Create Nets
|
|
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
|
|
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
|
|
21
|
+
__Level 1:__ Configure and run a simulation: JSON
|
|
22
22
|
* Update the model parameters
|
|
23
23
|
|
|
24
|
-
__Level 2:__ Create Nets
|
|
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
|
|
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.
|
physioblocks-1.2.0/doc/source/api_reference/io.rst → physioblocks-2.0.0/doc/source/api_reference.rst
RENAMED
|
@@ -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
|
-
|
|
32
|
-
|
|
29
|
+
#############
|
|
30
|
+
API Reference
|
|
31
|
+
#############
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
.. autosummary::
|
|
34
|
+
:toctree: _autosummary
|
|
35
|
+
:recursive:
|
|
36
36
|
|
|
37
|
-
|
|
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,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
|
+
}
|