Skip to content

Commit 57f924a

Browse files
committed
fix merge conflicts
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
2 parents 028fa15 + 0187d85 commit 57f924a

File tree

13 files changed

+549
-398
lines changed

13 files changed

+549
-398
lines changed

docs/user_manual/components.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,11 +885,12 @@ Valid combinations of `power_sigma`, `p_sigma` and `q_sigma` are:
885885
| | | | &#10060; |
886886

887887
```{note}
888-
1. If both `p_sigma` and `q_sigma` are provided, they represent the standard deviation of the active and reactive power,
889-
respectively, and the value of `power_sigma` is ignored. Any infinite component invalidates the entire measurement.
888+
1. If both `p_sigma` and `q_sigma` are provided (i.e., not NaN), they represent the standard deviation of the active and
889+
reactive power, respectively, and the value of `power_sigma` is ignored. Any infinite component disables the entire
890+
measurement.
890891
891892
2. If neither `p_sigma` nor `q_sigma` are provided, `power_sigma` represents the standard deviation of the apparent
892-
power.
893+
power. In this case, infinite value of `power_sigma` disables the entire measurement.
893894
894895
3. Providing only one of `p_sigma` and `q_sigma` results in undefined behaviour.
895896
```

power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/dataset.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ template <dataset_type_tag dataset_type_> class Dataset {
490490
result.add_buffer(component_info.component->name, size, size, nullptr, nullptr);
491491
for (auto const& attribute_buffer : buffer.attributes) {
492492
result.add_attribute_buffer(component_info.component->name, attribute_buffer.meta_attribute->name,
493-
static_cast<Data*>(static_cast<AdvanceablePtr>(attribute_buffer.data)));
493+
static_cast<Data*>(static_cast<AdvanceablePtr>(attribute_buffer.data) +
494+
attribute_buffer.meta_attribute->size * offset));
494495
}
495496
} else {
496497
Data* data = component_info.component->advance_ptr(buffer.data, offset);

power_grid_model_c/power_grid_model/include/power_grid_model/job_adapter.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ class JobDispatchAdapter<MainModel, ComponentList<ComponentType...>>
6767
// to call derived-class implementation details as part of the CRTP pattern.
6868
friend class JobDispatchInterface<JobDispatchAdapter>;
6969

70-
static constexpr Idx ignore_output{-1};
71-
7270
std::unique_ptr<MainModel> model_;
7371
std::reference_wrapper<MainModelOptions const> options_;
7472

@@ -82,7 +80,7 @@ class JobDispatchAdapter<MainModel, ComponentList<ComponentType...>>
8280
std::mutex calculation_info_mutex_;
8381

8482
void calculate_impl(MutableDataset const& result_data, Idx scenario_idx) const {
85-
MainModel::calculator(options_.get(), *model_, result_data, scenario_idx);
83+
MainModel::calculator(options_.get(), *model_, result_data.get_individual_scenario(scenario_idx), false);
8684
}
8785

8886
void cache_calculate_impl() const {
@@ -95,7 +93,7 @@ class JobDispatchAdapter<MainModel, ComponentList<ComponentType...>>
9593
"sym_output",
9694
model_->meta_data(),
9795
},
98-
ignore_output);
96+
true);
9997
} catch (SparseMatrixError const&) { // NOLINT(bugprone-empty-catch) // NOSONAR
10098
// missing entries are provided in the update data
10199
} catch (NotObservableError const&) { // NOLINT(bugprone-empty-catch) // NOSONAR

power_grid_model_c/power_grid_model/include/power_grid_model/job_dispatch.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#pragma once
66

7+
#include "batch_parameter.hpp"
78
#include "job_interface.hpp"
89

910
#include "main_core/calculation_info.hpp"
@@ -14,7 +15,6 @@ namespace power_grid_model {
1415

1516
class JobDispatch {
1617
public:
17-
static constexpr Idx ignore_output{-1};
1818
static constexpr Idx sequential{-1};
1919

2020
// TODO(figueroa1395): add generic template parameters for update_data and result_data
@@ -80,12 +80,16 @@ class JobDispatch {
8080
adapter.winddown();
8181
};
8282

83-
auto recover_from_bad = [&adapter, &copy_adapter_functor, &thread_info]() {
84-
main_core::merge_into(thread_info, adapter.get_calculation_info());
83+
auto recover_from_bad = [&adapter, &copy_adapter_functor]() {
84+
// TODO(figueroa1395): Time this step
85+
// how do we want to deal with exceptions and timing?
8586
adapter = copy_adapter_functor();
8687
};
8788

88-
auto run = [&adapter, &result_data](Idx scenario_idx) { adapter.calculate(result_data, scenario_idx); };
89+
auto run = [&adapter, &result_data, &thread_info](Idx scenario_idx) {
90+
adapter.calculate(result_data, scenario_idx);
91+
main_core::merge_into(thread_info, adapter.get_calculation_info());
92+
};
8993

9094
auto calculate_scenario = JobDispatch::call_with<Idx>(
9195
std::move(run), std::move(setup), std::move(winddown),
@@ -97,7 +101,6 @@ class JobDispatch {
97101
}
98102

99103
t_total.stop();
100-
main_core::merge_into(thread_info, adapter.get_calculation_info());
101104
base_adapter.thread_safe_add_calculation_info(thread_info);
102105
};
103106
}

0 commit comments

Comments
 (0)