OpenPinch 0.4.2__tar.gz → 0.4.3__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.
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_target_accessor.py +6 -4
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_target_dispatch.py +16 -5
- openpinch-0.4.3/OpenPinch/classes/_problem/_target_plan.py +211 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_validation.py +4 -1
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_workspace/views.py +7 -3
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/pinch_problem.py +19 -24
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/zone.py +10 -7
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/03_carnot_hpr_comparison.ipynb +10 -9
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/05_schema_service_and_output_workflows.ipynb +2 -2
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/07_vapour_compression_mvr_cascade_hpr.ipynb +29 -27
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/08_direct_gas_stream_mvr.ipynb +3 -3
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/09_hen_design_service_four_stream.ipynb +3 -3
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/chocolate_factory.json +13 -9
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/crude_preheat_train_multistate.json +2 -2
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/zonal_site_multistate.json +2 -2
- openpinch-0.4.3/OpenPinch/lib/config.py +160 -0
- openpinch-0.4.3/OpenPinch/lib/config_metadata.py +670 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/workspace.py +1 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/unit_system.py +2 -2
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/capital_cost_and_area_targeting.py +8 -7
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/service_orchestration.py +15 -7
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/components/process_mvr.py +4 -2
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/direct_heat_integration/direct_integration_entry.py +8 -6
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/exergy_analysis/exergy_targeting_entry.py +7 -7
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/executor.py +15 -13
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/fake_executor.py +1 -1
- openpinch-0.4.3/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/settings.py +164 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/arrays.py +35 -33
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/pinch_design_snapshot.py +7 -4
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/preprocessing.py +54 -49
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/heat_pump_and_refrigeration_entry.py +49 -31
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/input_data_processing/_canonicalization.py +21 -21
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/input_data_processing/_utility_preparation.py +46 -45
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/input_data_processing/data_preparation.py +8 -8
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/power_cogeneration/power_cogeneration_entry.py +16 -13
- {openpinch-0.4.2 → openpinch-0.4.3}/PKG-INFO +1 -1
- {openpinch-0.4.2 → openpinch-0.4.3}/pyproject.toml +1 -1
- openpinch-0.4.2/OpenPinch/lib/config.py +0 -130
- openpinch-0.4.2/OpenPinch/lib/config_metadata.py +0 -374
- openpinch-0.4.2/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/settings.py +0 -100
- {openpinch-0.4.2 → openpinch-0.4.3}/.gitignore +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/LICENSE +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/__main__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_component_accessor.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_design_accessor.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_loading.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_output.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_plot_accessor.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem/_result_extraction.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem_table/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_problem_table/_problem_table_constants.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_stream_collection/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_stream_collection/_helpers.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_stream_collection/_numeric_view.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_workspace/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_workspace/execution.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/_workspace/payloads.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/heat_exchanger.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/heat_exchanger_network.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/pinch_workspace.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/problem_table.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/stream.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/stream_collection.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/classes/value.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/01_basic_pinch_and_dtcont_sensitivity.ipynb +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/02_total_site_targets_and_sugcc.ipynb +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/04_multistate_targeting_and_state_comparison.ipynb +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/06_energy_transfer_analysis.ipynb +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/basic_pinch.json +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/crude_preheat_train.json +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/heat_pump_targeting.json +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/pulp_mill.json +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/sample_cases/zonal_site.json +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/coolprop_fluids.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/enums.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/heat_exchanger_network_types.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/problem_table_types.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/common.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/graphs.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/hpr.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/io.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/report_units.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/reporting.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/synthesis/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/synthesis/methods.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/synthesis/results.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/synthesis/tasks.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/targets.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/lib/schemas/turbine.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/main.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/resources.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/gcc_manipulation.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/graph_data.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/graph_series_meta.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/miscellaneous.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/problem_table_analysis.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/temperature_driving_force.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/common/utility_targeting.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/components/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/components/direct_mvr/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/components/direct_mvr/direct_gas_mvr.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/components/process_components.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/direct_heat_integration/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/energy_transfer_analysis/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/energy_transfer_analysis/energy_transfer_entry.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/exergy_analysis/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/errors.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/fallbacks.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/execution/task_builders.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/reporting/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/reporting/exports.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/reporting/ranking.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/reporting/verification.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/results/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/results/assembly.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/results/seeds.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/service_context.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/backend.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/dependencies.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/common/solver/extraction.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/heat_exchanger_network_synthesis_entry.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/targeting_services/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/targeting_services/network_evolution_method.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/targeting_services/open_hens_method.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/targeting_services/pinch_design_method.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/targeting_services/thermal_derivative_method.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/unit_models/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/unit_models/base.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/unit_models/pinch_design.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/unit_models/problem.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_exchanger_network_synthesis/unit_models/stagewise.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/_shared/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/_shared/ambient_preallocation.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/_shared/plotting.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/_shared/streams.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/encoding.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/layout.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/postprocessing.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/common/shared.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/brayton.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/cascade_carnot.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/cascade_vapour_compression.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/parallel_carnot.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/parallel_vapour_compression.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/targeting_services/vapour_compression_mvr.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/brayton_heat_pump.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/carnot_cycles.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/cascade_vapour_compression_cycle.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/mechanical_vapour_recompression_cycle.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/parallel_vapour_compression_cycles.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/vapour_compression_cycle.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/heat_pump_integration/unit_models/vapour_compression_mvr_cascade.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/indirect_heat_integration/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/indirect_heat_integration/indirect_integration_entry.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/input_data_processing/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/_dependencies.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/builder.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/constants.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/models.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/renderer.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/network_grid_diagram/service.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/power_cogeneration/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/power_cogeneration/unit_models/multi_stage_steam_turbine.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/services/services_entry.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/streamlit_webviewer/web_graphing.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/_tabular_input.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/__init__.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/bayesian_optimisation.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/cmaes.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/common.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/dual_annealing.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/bb_optimisers/rbf_surrogate.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/blackbox_minimisers.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/costing.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/csv_to_json.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/decorators.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/export.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/heat_exchanger.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/input_validation.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/plots.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/stream_linearisation.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/value_resolution.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/water_properties.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/utils/wkbook_to_json.py +0 -0
- {openpinch-0.4.2 → openpinch-0.4.3}/README.md +0 -0
|
@@ -14,6 +14,7 @@ from ...services import (
|
|
|
14
14
|
indirect_refrigeration_service,
|
|
15
15
|
power_cogeneration_service,
|
|
16
16
|
)
|
|
17
|
+
from ._target_plan import build_targeting_plan
|
|
17
18
|
|
|
18
19
|
if TYPE_CHECKING:
|
|
19
20
|
from ..pinch_problem import PinchProblem
|
|
@@ -34,10 +35,12 @@ class _TargetAccessor:
|
|
|
34
35
|
runtime_options = dict(options or {})
|
|
35
36
|
if state_id is not None:
|
|
36
37
|
runtime_options["state_id"] = state_id
|
|
38
|
+
execution_master_zone = self._problem._build_execution_master_zone()
|
|
39
|
+
plan = build_targeting_plan(execution_master_zone.config)
|
|
37
40
|
return self._problem._run_targeting_for_zone_and_subzones(
|
|
38
|
-
zone=
|
|
39
|
-
direct_service_func=
|
|
40
|
-
indirect_service_func=
|
|
41
|
+
zone=execution_master_zone,
|
|
42
|
+
direct_service_func=plan.composite_direct_service(),
|
|
43
|
+
indirect_service_func=plan.composite_indirect_service(),
|
|
41
44
|
options=runtime_options,
|
|
42
45
|
)
|
|
43
46
|
|
|
@@ -213,7 +216,6 @@ class _TargetAccessor:
|
|
|
213
216
|
) -> BaseTargetModel:
|
|
214
217
|
"""Run exergy targeting on the first compatible base target family."""
|
|
215
218
|
runtime_options = dict(options or {})
|
|
216
|
-
runtime_options["DO_EXERGY_TARGETING"] = True
|
|
217
219
|
if state_id is not None:
|
|
218
220
|
runtime_options["state_id"] = state_id
|
|
219
221
|
return self._problem._execute_exergy_targeting(
|
|
@@ -35,6 +35,12 @@ def _invoke_service(service_func: Callable, zone: Zone, args: dict | None = None
|
|
|
35
35
|
return service_func(zone, args)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
def _service_declares_zone_applicability(service_func: Callable, zone: Zone) -> bool:
|
|
39
|
+
"""Return whether a plan-built callback explicitly applies to ``zone``."""
|
|
40
|
+
zone_applicability = getattr(service_func, "_openpinch_zone_applicability", ())
|
|
41
|
+
return zone.type in zone_applicability
|
|
42
|
+
|
|
43
|
+
|
|
38
44
|
def _invoke_target_handler(
|
|
39
45
|
handler: Callable,
|
|
40
46
|
zone: Zone,
|
|
@@ -58,11 +64,11 @@ def _get_unit_operation_targets(
|
|
|
58
64
|
args: dict | None = None,
|
|
59
65
|
):
|
|
60
66
|
"""Populate a ``Zone`` with detailed unit operation-level pinch targets."""
|
|
61
|
-
if zone.config.
|
|
67
|
+
if zone.config.targeting.direct_operation_enabled:
|
|
62
68
|
if len(zone.subzones) > 0:
|
|
63
69
|
for subzone in zone.subzones.values():
|
|
64
70
|
if subzone.type == ZT.O.value:
|
|
65
|
-
if subzone.config.
|
|
71
|
+
if subzone.config.targeting.direct_operation_enabled:
|
|
66
72
|
if callable(direct_service_func):
|
|
67
73
|
_invoke_service(direct_service_func, subzone, args)
|
|
68
74
|
else:
|
|
@@ -109,9 +115,14 @@ def _get_process_targets(
|
|
|
109
115
|
"other process zones and operation zones."
|
|
110
116
|
)
|
|
111
117
|
|
|
112
|
-
if
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
if (
|
|
119
|
+
callable(indirect_service_func)
|
|
120
|
+
and (
|
|
121
|
+
zone.config.targeting.indirect_process_enabled
|
|
122
|
+
or _service_declares_zone_applicability(indirect_service_func, zone)
|
|
123
|
+
)
|
|
124
|
+
):
|
|
125
|
+
_invoke_service(indirect_service_func, zone, args)
|
|
115
126
|
|
|
116
127
|
if callable(direct_service_func):
|
|
117
128
|
_invoke_service(direct_service_func, zone, args)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"""Targeting selector registry for the default problem targeting entry point."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Callable
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from ...lib.enums import TT, ZT
|
|
10
|
+
from ...services import (
|
|
11
|
+
area_cost_targeting_service,
|
|
12
|
+
direct_heat_integration_service,
|
|
13
|
+
direct_heat_pump_service,
|
|
14
|
+
direct_refrigeration_service,
|
|
15
|
+
exergy_targeting_service,
|
|
16
|
+
indirect_heat_integration_service,
|
|
17
|
+
indirect_heat_pump_service,
|
|
18
|
+
indirect_refrigeration_service,
|
|
19
|
+
power_cogeneration_service,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
TargetingServiceSlot = Literal["direct", "indirect"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class TargetingMethodSpec:
|
|
27
|
+
"""Describe one flat targeting selector and its runtime dispatch service."""
|
|
28
|
+
|
|
29
|
+
selector: str
|
|
30
|
+
service: Callable
|
|
31
|
+
target_type: str
|
|
32
|
+
slot: TargetingServiceSlot
|
|
33
|
+
prerequisites: tuple[str, ...]
|
|
34
|
+
zone_applicability: tuple[str, ...]
|
|
35
|
+
execution_order: int
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass(frozen=True)
|
|
39
|
+
class TargetingPlan:
|
|
40
|
+
"""Ordered targeting services selected from ``config.targeting``."""
|
|
41
|
+
|
|
42
|
+
specs: tuple[TargetingMethodSpec, ...]
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def direct_services(self) -> tuple[Callable, ...]:
|
|
46
|
+
return _unique_services(
|
|
47
|
+
spec.service for spec in self.specs if spec.slot == "direct"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def indirect_services(self) -> tuple[Callable, ...]:
|
|
52
|
+
return _unique_services(
|
|
53
|
+
spec.service for spec in self.specs if spec.slot == "indirect"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def composite_direct_service(self) -> Callable | None:
|
|
57
|
+
return _compose_services(
|
|
58
|
+
spec for spec in self.specs if spec.slot == "direct"
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
def composite_indirect_service(self) -> Callable | None:
|
|
62
|
+
return _compose_services(
|
|
63
|
+
spec for spec in self.specs if spec.slot == "indirect"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
TARGETING_METHOD_SPECS: tuple[TargetingMethodSpec, ...] = (
|
|
68
|
+
TargetingMethodSpec(
|
|
69
|
+
selector="TARGETING_DIRECT_SITE_ENABLED",
|
|
70
|
+
service=direct_heat_integration_service,
|
|
71
|
+
target_type=TT.DI.value,
|
|
72
|
+
slot="direct",
|
|
73
|
+
prerequisites=(),
|
|
74
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
75
|
+
execution_order=10,
|
|
76
|
+
),
|
|
77
|
+
TargetingMethodSpec(
|
|
78
|
+
selector="TARGETING_DIRECT_OPERATION_ENABLED",
|
|
79
|
+
service=direct_heat_integration_service,
|
|
80
|
+
target_type=TT.DI.value,
|
|
81
|
+
slot="direct",
|
|
82
|
+
prerequisites=(),
|
|
83
|
+
zone_applicability=(ZT.O.value,),
|
|
84
|
+
execution_order=20,
|
|
85
|
+
),
|
|
86
|
+
TargetingMethodSpec(
|
|
87
|
+
selector="TARGETING_INDIRECT_PROCESS_ENABLED",
|
|
88
|
+
service=indirect_heat_integration_service,
|
|
89
|
+
target_type=TT.TS.value,
|
|
90
|
+
slot="indirect",
|
|
91
|
+
prerequisites=(TT.DI.value,),
|
|
92
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
93
|
+
execution_order=30,
|
|
94
|
+
),
|
|
95
|
+
TargetingMethodSpec(
|
|
96
|
+
selector="TARGETING_PROCESS_HP_ENABLED",
|
|
97
|
+
service=direct_heat_pump_service,
|
|
98
|
+
target_type=TT.DHP.value,
|
|
99
|
+
slot="direct",
|
|
100
|
+
prerequisites=(TT.DI.value,),
|
|
101
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
102
|
+
execution_order=40,
|
|
103
|
+
),
|
|
104
|
+
TargetingMethodSpec(
|
|
105
|
+
selector="TARGETING_PROCESS_RFRG_ENABLED",
|
|
106
|
+
service=direct_refrigeration_service,
|
|
107
|
+
target_type=TT.DR.value,
|
|
108
|
+
slot="direct",
|
|
109
|
+
prerequisites=(TT.DI.value,),
|
|
110
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
111
|
+
execution_order=50,
|
|
112
|
+
),
|
|
113
|
+
TargetingMethodSpec(
|
|
114
|
+
selector="TARGETING_UTILITY_HP_ENABLED",
|
|
115
|
+
service=indirect_heat_pump_service,
|
|
116
|
+
target_type=TT.IHP.value,
|
|
117
|
+
slot="indirect",
|
|
118
|
+
prerequisites=(TT.TS.value,),
|
|
119
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
120
|
+
execution_order=60,
|
|
121
|
+
),
|
|
122
|
+
TargetingMethodSpec(
|
|
123
|
+
selector="TARGETING_UTILITY_RFRG_ENABLED",
|
|
124
|
+
service=indirect_refrigeration_service,
|
|
125
|
+
target_type=TT.IR.value,
|
|
126
|
+
slot="indirect",
|
|
127
|
+
prerequisites=(TT.TS.value,),
|
|
128
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
129
|
+
execution_order=70,
|
|
130
|
+
),
|
|
131
|
+
TargetingMethodSpec(
|
|
132
|
+
selector="TARGETING_TURBINE_ENABLED",
|
|
133
|
+
service=power_cogeneration_service,
|
|
134
|
+
target_type="Cogeneration",
|
|
135
|
+
slot="direct",
|
|
136
|
+
prerequisites=(TT.DI.value, TT.TS.value),
|
|
137
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
138
|
+
execution_order=80,
|
|
139
|
+
),
|
|
140
|
+
TargetingMethodSpec(
|
|
141
|
+
selector="TARGETING_EXERGY_ENABLED",
|
|
142
|
+
service=exergy_targeting_service,
|
|
143
|
+
target_type="Exergy Analysis",
|
|
144
|
+
slot="direct",
|
|
145
|
+
prerequisites=(TT.DI.value, TT.TS.value),
|
|
146
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
147
|
+
execution_order=90,
|
|
148
|
+
),
|
|
149
|
+
TargetingMethodSpec(
|
|
150
|
+
selector="TARGETING_AREA_COST_ENABLED",
|
|
151
|
+
service=area_cost_targeting_service,
|
|
152
|
+
target_type=TT.DI.value,
|
|
153
|
+
slot="direct",
|
|
154
|
+
prerequisites=(TT.DI.value,),
|
|
155
|
+
zone_applicability=(ZT.S.value, ZT.P.value),
|
|
156
|
+
execution_order=100,
|
|
157
|
+
),
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def build_targeting_plan(config) -> TargetingPlan:
|
|
162
|
+
"""Build the default service plan from ``Configuration.targeting`` flags."""
|
|
163
|
+
selected = [
|
|
164
|
+
spec
|
|
165
|
+
for spec in TARGETING_METHOD_SPECS
|
|
166
|
+
if _selector_enabled(config, spec.selector)
|
|
167
|
+
]
|
|
168
|
+
return TargetingPlan(
|
|
169
|
+
specs=tuple(sorted(selected, key=lambda spec: spec.execution_order))
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _selector_enabled(config, selector: str) -> bool:
|
|
174
|
+
field_name = selector.removeprefix("TARGETING_").removesuffix("_ENABLED").lower()
|
|
175
|
+
return bool(getattr(config.targeting, f"{field_name}_enabled", False))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _unique_services(services) -> tuple[Callable, ...]:
|
|
179
|
+
unique: list[Callable] = []
|
|
180
|
+
seen: set[int] = set()
|
|
181
|
+
for service in services:
|
|
182
|
+
marker = id(service)
|
|
183
|
+
if marker in seen:
|
|
184
|
+
continue
|
|
185
|
+
seen.add(marker)
|
|
186
|
+
unique.append(service)
|
|
187
|
+
return tuple(unique)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _compose_services(specs) -> Callable | None:
|
|
191
|
+
selected = tuple(specs)
|
|
192
|
+
if not selected:
|
|
193
|
+
return None
|
|
194
|
+
|
|
195
|
+
def _composite(zone, args=None):
|
|
196
|
+
zone_type = getattr(zone, "type", None)
|
|
197
|
+
invoked_services: set[int] = set()
|
|
198
|
+
for spec in selected:
|
|
199
|
+
if zone_type not in spec.zone_applicability:
|
|
200
|
+
continue
|
|
201
|
+
marker = id(spec.service)
|
|
202
|
+
if marker in invoked_services:
|
|
203
|
+
continue
|
|
204
|
+
invoked_services.add(marker)
|
|
205
|
+
spec.service(zone, args)
|
|
206
|
+
return zone
|
|
207
|
+
|
|
208
|
+
_composite._openpinch_zone_applicability = frozenset(
|
|
209
|
+
zone_type for spec in selected for zone_type in spec.zone_applicability
|
|
210
|
+
)
|
|
211
|
+
return _composite
|
|
@@ -9,6 +9,7 @@ from typing import Any, Optional
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
from pydantic import ValidationError
|
|
11
11
|
|
|
12
|
+
from ...lib.config_metadata import CONFIG_FIELD_SPECS, input_unit_options_to_map
|
|
12
13
|
from ...lib.enums import ST
|
|
13
14
|
from ...lib.schemas.io import TargetInput
|
|
14
15
|
from ...lib.schemas.workspace import ValidationIssue, ValidationReport
|
|
@@ -160,7 +161,9 @@ def semantic_issues(
|
|
|
160
161
|
"""Return semantic validation issues for one validated problem definition."""
|
|
161
162
|
issues: list[ValidationIssue] = []
|
|
162
163
|
options = problem_inputs.options if isinstance(problem_inputs.options, dict) else {}
|
|
163
|
-
input_unit_config =
|
|
164
|
+
input_unit_config = input_unit_options_to_map(
|
|
165
|
+
{name: spec.default for name, spec in CONFIG_FIELD_SPECS.items()} | options
|
|
166
|
+
)
|
|
164
167
|
|
|
165
168
|
if len(problem_inputs.streams) == 0:
|
|
166
169
|
issues.append(
|
|
@@ -141,10 +141,12 @@ def configuration_field_metadata() -> list[ConfigurationFieldMetadata]:
|
|
|
141
141
|
label=name.replace("_", " ").title(),
|
|
142
142
|
field_type=field_type,
|
|
143
143
|
group=spec.group,
|
|
144
|
+
config_path=list(spec.config_path),
|
|
144
145
|
support_level=configuration_field_support_level(name),
|
|
145
146
|
runtime_status=spec.runtime_status,
|
|
146
147
|
enum_choices=[str(item.value) for item in enum_cls] if enum_cls else [],
|
|
147
148
|
numeric_min=spec.numeric_min,
|
|
149
|
+
numeric_max=spec.numeric_max,
|
|
148
150
|
multiple=multiple,
|
|
149
151
|
)
|
|
150
152
|
)
|
|
@@ -298,9 +300,11 @@ def summary_metric_deltas(
|
|
|
298
300
|
base_value=base_value,
|
|
299
301
|
variant_value=variant_value,
|
|
300
302
|
unit=unit,
|
|
301
|
-
delta=
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
delta=(
|
|
304
|
+
numeric_delta(base_value, variant_value)
|
|
305
|
+
if units_match
|
|
306
|
+
else None
|
|
307
|
+
),
|
|
304
308
|
)
|
|
305
309
|
)
|
|
306
310
|
return deltas
|
|
@@ -576,26 +576,16 @@ class PinchProblem:
|
|
|
576
576
|
]
|
|
577
577
|
unit_columns = {col: f"{col} (unit)" for col in columns}
|
|
578
578
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
{
|
|
590
|
-
col: other_row.get(col)
|
|
591
|
-
for col in [*columns, *unit_columns.values()]
|
|
592
|
-
},
|
|
593
|
-
name=other_label,
|
|
594
|
-
),
|
|
595
|
-
]
|
|
596
|
-
)
|
|
597
|
-
|
|
598
|
-
change_row: dict[str, object] = {}
|
|
579
|
+
row_columns = [*columns, *unit_columns.values()]
|
|
580
|
+
base_payload = {
|
|
581
|
+
"Target": str(base_row["Target"]),
|
|
582
|
+
**{col: base_row.get(col) for col in row_columns},
|
|
583
|
+
}
|
|
584
|
+
other_payload = {
|
|
585
|
+
"Target": str(other_row["Target"]),
|
|
586
|
+
**{col: other_row.get(col) for col in row_columns},
|
|
587
|
+
}
|
|
588
|
+
change_row: dict[str, object] = {"Target": str(base_row["Target"])}
|
|
599
589
|
for col in columns:
|
|
600
590
|
unit_col = unit_columns[col]
|
|
601
591
|
base_unit = base_row.get(unit_col)
|
|
@@ -612,10 +602,15 @@ class PinchProblem:
|
|
|
612
602
|
change_row[col] = None
|
|
613
603
|
change_row[unit_col] = None
|
|
614
604
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
605
|
+
return pd.DataFrame.from_dict(
|
|
606
|
+
{
|
|
607
|
+
base_label: base_payload,
|
|
608
|
+
other_label: other_payload,
|
|
609
|
+
"Change": change_row,
|
|
610
|
+
},
|
|
611
|
+
orient="index",
|
|
612
|
+
columns=["Target", *row_columns],
|
|
613
|
+
)
|
|
619
614
|
|
|
620
615
|
def _data_preprocessing(self) -> "Zone":
|
|
621
616
|
if isinstance(self._validated_data, TargetInput) and isinstance(
|
|
@@ -31,14 +31,14 @@ class Zone:
|
|
|
31
31
|
self,
|
|
32
32
|
name: str = "Zone",
|
|
33
33
|
type: str = ZT.P.value,
|
|
34
|
-
|
|
34
|
+
config: Optional[Configuration] = None,
|
|
35
35
|
parent_zone: "Zone" = None,
|
|
36
36
|
):
|
|
37
37
|
"""Initialise an empty zone with stream, target, and graph containers."""
|
|
38
38
|
# === Metadata ===
|
|
39
39
|
self._name = name
|
|
40
40
|
self._type = type
|
|
41
|
-
self._config =
|
|
41
|
+
self._config = config or Configuration()
|
|
42
42
|
self._parent_zone = parent_zone
|
|
43
43
|
self._dt_cont_multiplier = (
|
|
44
44
|
parent_zone.dt_cont_multiplier
|
|
@@ -56,14 +56,17 @@ class Zone:
|
|
|
56
56
|
self._weights = parent_zone._weights
|
|
57
57
|
else:
|
|
58
58
|
self._state_ids = (
|
|
59
|
-
{
|
|
60
|
-
|
|
59
|
+
{
|
|
60
|
+
state_id: idx
|
|
61
|
+
for idx, state_id in enumerate(self._config.problem.state_ids)
|
|
62
|
+
}
|
|
63
|
+
if isinstance(self._config.problem.state_ids, list | tuple)
|
|
61
64
|
else {"0": 0}
|
|
62
65
|
)
|
|
63
66
|
self._num_states = len(self._state_ids)
|
|
64
|
-
if isinstance(self._config.
|
|
65
|
-
if len(self._config.
|
|
66
|
-
self._weights = self._config.
|
|
67
|
+
if isinstance(self._config.problem.state_weights, np.ndarray | list):
|
|
68
|
+
if len(self._config.problem.state_weights) == self._num_states:
|
|
69
|
+
self._weights = self._config.problem.state_weights
|
|
67
70
|
else:
|
|
68
71
|
self._weights = np.ones(len(self._state_ids), dtype=float)
|
|
69
72
|
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"from OpenPinch.utils import get_scalar_value\n",
|
|
35
35
|
"\n",
|
|
36
36
|
"PROJECT_NAME = \"Chocolate factory\"\n",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
37
|
+
"LOAD_SHARE = 1.0\n",
|
|
38
|
+
"MULTISTART_COUNT = 10\n",
|
|
39
|
+
"CONDENSER_COUNT = 3\n",
|
|
40
|
+
"EVAPORATOR_COUNT = 3\n",
|
|
41
41
|
"\n",
|
|
42
42
|
"WORKFLOWS = {\n",
|
|
43
43
|
" \"direct_heat_pump\": {\n",
|
|
@@ -79,10 +79,11 @@
|
|
|
79
79
|
" case.update_options(\n",
|
|
80
80
|
" {\n",
|
|
81
81
|
" \"HPR_TYPE\": cycle.value,\n",
|
|
82
|
-
" \"
|
|
83
|
-
" \"
|
|
84
|
-
" \"
|
|
85
|
-
" \"
|
|
82
|
+
" \"HPR_LOAD_MODE\": \"fraction\",\n",
|
|
83
|
+
" \"HPR_LOAD_FRACTION\": LOAD_SHARE,\n",
|
|
84
|
+
" \"HPR_MAX_MULTISTART\": MULTISTART_COUNT,\n",
|
|
85
|
+
" \"HPR_N_COND\": CONDENSER_COUNT,\n",
|
|
86
|
+
" \"HPR_N_EVAP\": EVAPORATOR_COUNT,\n",
|
|
86
87
|
" }\n",
|
|
87
88
|
" )\n",
|
|
88
89
|
" case_matrix.append(\n",
|
|
@@ -339,7 +340,7 @@
|
|
|
339
340
|
"name": "python",
|
|
340
341
|
"nbconvert_exporter": "python",
|
|
341
342
|
"pygments_lexer": "ipython3",
|
|
342
|
-
"version": "3.14.
|
|
343
|
+
"version": "3.14.2"
|
|
343
344
|
}
|
|
344
345
|
},
|
|
345
346
|
"nbformat": 4,
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"source": [
|
|
195
195
|
"workspace.set_variant_payload(\n",
|
|
196
196
|
" \"tight_dt\",\n",
|
|
197
|
-
" {\"options\": {\"
|
|
197
|
+
" {\"options\": {\"THERMAL_DT_CONT\": 8.0}},\n",
|
|
198
198
|
" base=\"baseline\",\n",
|
|
199
199
|
")\n",
|
|
200
200
|
"\n",
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"name": "python",
|
|
268
268
|
"nbconvert_exporter": "python",
|
|
269
269
|
"pygments_lexer": "ipython3",
|
|
270
|
-
"version": "3.14.
|
|
270
|
+
"version": "3.14.2"
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
273
|
"nbformat": 4,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"metadata": {},
|
|
47
47
|
"source": [
|
|
48
48
|
"## Configure public HPR targeting cases\n",
|
|
49
|
-
"The VC+MVR backend is selected through the normal `HPR_TYPE` option. `
|
|
49
|
+
"The VC+MVR backend is selected through the normal `HPR_TYPE` option. `HPR_N_COND` and `HPR_N_EVAP` define the low-stage vapour-compression placement dimensions; `HPR_MVR_COUNT` defines the MVR high-stage count. `HPR_MVR_FLUIDS` is independent from the low-stage `HPR_REFRIGERANTS` list. The reference case uses `HPRcycle.ParallelCarnot`, the current staged Carnot screening name."
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -61,29 +61,31 @@
|
|
|
61
61
|
"carnot_case = workspace.copy_case(\"baseline\", \"reference_parallel_carnot\", activate=False)\n",
|
|
62
62
|
"carnot_options = {\n",
|
|
63
63
|
" \"HPR_TYPE\": HPRcycle.ParallelCarnot.value,\n",
|
|
64
|
-
" \"
|
|
65
|
-
" \"
|
|
66
|
-
" \"
|
|
67
|
-
" \"
|
|
64
|
+
" \"HPR_LOAD_MODE\": \"fraction\",\n",
|
|
65
|
+
" \"HPR_LOAD_FRACTION\": 0.10,\n",
|
|
66
|
+
" \"HPR_MAX_MULTISTART\": 5,\n",
|
|
67
|
+
" \"HPR_N_COND\": 1,\n",
|
|
68
|
+
" \"HPR_N_EVAP\": 1,\n",
|
|
68
69
|
"}\n",
|
|
69
70
|
"carnot_case.update_options(carnot_options)\n",
|
|
70
71
|
"\n",
|
|
71
72
|
"vc_mvr_case = workspace.copy_case(\"baseline\", \"vc_mvr_cascade\", activate=False)\n",
|
|
72
73
|
"vc_mvr_options = {\n",
|
|
73
74
|
" \"HPR_TYPE\": HPRcycle.VapourCompMVR.value,\n",
|
|
74
|
-
" \"
|
|
75
|
-
" \"
|
|
76
|
-
" \"
|
|
77
|
-
" \"
|
|
78
|
-
" \"
|
|
79
|
-
" \"
|
|
80
|
-
" \"
|
|
81
|
-
" \"
|
|
82
|
-
" \"
|
|
83
|
-
" \"
|
|
84
|
-
" \"
|
|
85
|
-
" \"
|
|
86
|
-
" \"
|
|
75
|
+
" \"HPR_LOAD_MODE\": \"fraction\",\n",
|
|
76
|
+
" \"HPR_LOAD_FRACTION\": 0.10,\n",
|
|
77
|
+
" \"HPR_MAX_MULTISTART\": 1,\n",
|
|
78
|
+
" \"HPR_N_COND\": 1,\n",
|
|
79
|
+
" \"HPR_N_EVAP\": 1,\n",
|
|
80
|
+
" \"HPR_MVR_COUNT\": 1,\n",
|
|
81
|
+
" \"HPR_REFRIGERANTS\": [\"R245FA\"],\n",
|
|
82
|
+
" \"HPR_MVR_FLUIDS\": [\"Water\"],\n",
|
|
83
|
+
" \"HPR_ETA_COMP\": 0.75,\n",
|
|
84
|
+
" \"HPR_MVR_ETA_COMP\": 0.72,\n",
|
|
85
|
+
" \"HPR_MVR_ETA_MOTOR\": 0.95,\n",
|
|
86
|
+
" \"HPR_DT_CASCADE_HX\": 5.0,\n",
|
|
87
|
+
" \"HPR_INITIALISE_SIMULATED_CYCLE\": False,\n",
|
|
88
|
+
" \"HPR_BB_MINIMISER\": \"rbf_surrogate\",\n",
|
|
87
89
|
"}\n",
|
|
88
90
|
"vc_mvr_case.update_options(vc_mvr_options)\n",
|
|
89
91
|
"\n",
|
|
@@ -92,16 +94,16 @@
|
|
|
92
94
|
" {\n",
|
|
93
95
|
" \"case\": \"reference_parallel_carnot\",\n",
|
|
94
96
|
" \"HPR_TYPE\": carnot_options[\"HPR_TYPE\"],\n",
|
|
95
|
-
" \"
|
|
96
|
-
" \"
|
|
97
|
-
" \"
|
|
97
|
+
" \"HPR_N_COND\": carnot_options[\"HPR_N_COND\"],\n",
|
|
98
|
+
" \"HPR_N_EVAP\": carnot_options[\"HPR_N_EVAP\"],\n",
|
|
99
|
+
" \"HPR_MVR_COUNT\": None,\n",
|
|
98
100
|
" },\n",
|
|
99
101
|
" {\n",
|
|
100
102
|
" \"case\": \"vc_mvr_cascade\",\n",
|
|
101
103
|
" \"HPR_TYPE\": vc_mvr_options[\"HPR_TYPE\"],\n",
|
|
102
|
-
" \"
|
|
103
|
-
" \"
|
|
104
|
-
" \"
|
|
104
|
+
" \"HPR_N_COND\": vc_mvr_options[\"HPR_N_COND\"],\n",
|
|
105
|
+
" \"HPR_N_EVAP\": vc_mvr_options[\"HPR_N_EVAP\"],\n",
|
|
106
|
+
" \"HPR_MVR_COUNT\": vc_mvr_options[\"HPR_MVR_COUNT\"],\n",
|
|
105
107
|
" },\n",
|
|
106
108
|
" ]\n",
|
|
107
109
|
")\n"
|
|
@@ -113,7 +115,7 @@
|
|
|
113
115
|
"metadata": {},
|
|
114
116
|
"source": [
|
|
115
117
|
"## Standalone MVR thermodynamics\n",
|
|
116
|
-
"The MVR model accepts any CoolProp-compatible fluid and defaults to water. The inlet is saturated or superheated vapour at `T_evap`, the outlet is a real compressor discharge at condenser pressure, and the condenser outlet is saturated or subcooled liquid. `
|
|
118
|
+
"The MVR model accepts any CoolProp-compatible fluid and defaults to water. The inlet is saturated or superheated vapour at `T_evap`, the outlet is a real compressor discharge at condenser pressure, and the condenser outlet is saturated or subcooled liquid. `HPR_MVR_ETA_MOTOR` converts shaft work to electrical work."
|
|
117
119
|
]
|
|
118
120
|
},
|
|
119
121
|
{
|
|
@@ -327,7 +329,7 @@
|
|
|
327
329
|
" rows.append(\n",
|
|
328
330
|
" {\n",
|
|
329
331
|
" \"case\": case_name,\n",
|
|
330
|
-
" \"HPR_TYPE\": problem.master_zone.config.
|
|
332
|
+
" \"HPR_TYPE\": problem.master_zone.config.hpr.type,\n",
|
|
331
333
|
" \"hpr_success\": getattr(target, \"hpr_success\", None),\n",
|
|
332
334
|
" \"hpr_work\": get_scalar_value(getattr(target, \"hpr_work\", None)),\n",
|
|
333
335
|
" \"hpr_cop\": get_scalar_value(getattr(target, \"hpr_cop\", None)),\n",
|
|
@@ -376,7 +378,7 @@
|
|
|
376
378
|
"metadata": {},
|
|
377
379
|
"source": [
|
|
378
380
|
"## Interpretation\n",
|
|
379
|
-
"Use the deterministic unit-model cells to check thermodynamic accounting and internal heat routing before running a full placement solve. When moving to the public target, start with one VC stage and one MVR stage, keep `
|
|
381
|
+
"Use the deterministic unit-model cells to check thermodynamic accounting and internal heat routing before running a full placement solve. When moving to the public target, start with one VC stage and one MVR stage, keep `MULTISTART_COUNT` low while tuning fluids and load fraction, then increase stage counts and multistart effort once the temperature ranges are physically feasible."
|
|
380
382
|
]
|
|
381
383
|
}
|
|
382
384
|
],
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
" ],\n",
|
|
49
49
|
" },\n",
|
|
50
50
|
" \"options\": {\n",
|
|
51
|
-
" \"
|
|
52
|
-
" \"
|
|
53
|
-
" \"
|
|
51
|
+
" \"PROBLEM_TOP_ZONE_NAME\": \"Demo Site\",\n",
|
|
52
|
+
" \"PROBLEM_TOP_ZONE_IDENTIFIER\": ZT.S.value,\n",
|
|
53
|
+
" \"TARGETING_DIRECT_SITE_ENABLED\": True,\n",
|
|
54
54
|
" },\n",
|
|
55
55
|
" \"streams\": [\n",
|
|
56
56
|
" {\n",
|
{openpinch-0.4.2 → openpinch-0.4.3}/OpenPinch/data/notebooks/09_hen_design_service_four_stream.ipynb
RENAMED
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
" ],\n",
|
|
54
54
|
" },\n",
|
|
55
55
|
" \"options\": {\n",
|
|
56
|
-
" \"
|
|
57
|
-
" \"
|
|
58
|
-
" \"
|
|
56
|
+
" \"COSTING_HX_AREA_EXP\": 1.0,\n",
|
|
57
|
+
" \"COSTING_HX_UNIT_COST\": 5500.0,\n",
|
|
58
|
+
" \"COSTING_HX_AREA_COEFF\": 150.0,\n",
|
|
59
59
|
" \"HENS_APPROACH_TEMPERATURES\": [10.0, 14.0, 18.0],\n",
|
|
60
60
|
" \"HENS_DERIVATIVE_THRESHOLDS\": [0.5],\n",
|
|
61
61
|
" \"HENS_STAGE_SELECTION\": [3],\n",
|
|
@@ -1804,15 +1804,19 @@
|
|
|
1804
1804
|
}
|
|
1805
1805
|
],
|
|
1806
1806
|
"options": {
|
|
1807
|
-
"
|
|
1808
|
-
"
|
|
1807
|
+
"TARGETING_PROCESS_HP_ENABLED": true,
|
|
1808
|
+
"TARGETING_UTILITY_HP_ENABLED": true,
|
|
1809
1809
|
"HPR_TYPE": "Parallel vapour compression cycles",
|
|
1810
|
-
"
|
|
1811
|
-
"
|
|
1812
|
-
"
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
"
|
|
1810
|
+
"HPR_LOAD_MODE": "fraction",
|
|
1811
|
+
"HPR_LOAD_FRACTION": 1.0,
|
|
1812
|
+
"HPR_REFRIGERANTS": [
|
|
1813
|
+
"R601",
|
|
1814
|
+
"R600"
|
|
1815
|
+
],
|
|
1816
|
+
"HPR_N_COND": 2,
|
|
1817
|
+
"HPR_N_EVAP": 1,
|
|
1818
|
+
"HPR_ETA_COMP": 0.7,
|
|
1819
|
+
"HPR_DT_CONT": 4,
|
|
1820
|
+
"HPR_DT_IHX": 20
|
|
1817
1821
|
}
|
|
1818
1822
|
}
|