Skip to content

Commit 948e1fb

Browse files
committed
Remove unnecessary helper function
1 parent 2fb8ae1 commit 948e1fb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cpp/memilio/io/result_io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ IOResult<void> save_result_with_params(const std::vector<TimeSeries<ScalarType>>
117117
BOOST_OUTCOME_TRY(create_directory(result_dir_run.string()));
118118
BOOST_OUTCOME_TRY(save_result(result, county_ids, (int)(size_t)params[0].parameters.get_num_groups(),
119119
(result_dir_run / "Result.h5").string()));
120-
BOOST_OUTCOME_TRY(write_graph(create_graph_without_edges<Model, MobilityParameters<ScalarType>>(params, county_ids),
120+
BOOST_OUTCOME_TRY(write_graph(Graph<Model, MobilityParameters<ScalarType>>(county_ids, params),
121121
result_dir_run.string(), IOF_OmitDistributions));
122122
return success();
123123
}
@@ -212,7 +212,7 @@ IOResult<void> save_results(const std::vector<std::vector<TimeSeries<ScalarType>
212212
auto ensemble_params_p95 = ensemble_params_percentile(ensemble_params, 0.95);
213213

214214
auto make_graph = [&county_ids](auto&& params) {
215-
return create_graph_without_edges<Model, MobilityParameters<ScalarType>>(params, county_ids);
215+
return Graph<Model, MobilityParameters<ScalarType>>(county_ids, params);
216216
};
217217
BOOST_OUTCOME_TRY(
218218
write_graph(make_graph(ensemble_params_p05), result_dir_p05.string(), IOF_OmitDistributions));

cpp/tests/test_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ TEST(TestGraph, graph_without_edges)
146146
std::vector<MockModel> models = {MockModel(), MockModel()};
147147
std::vector<int> ids = {1, 2};
148148

149-
auto g = mio::create_graph_without_edges<MockModel, MockMobility>(models, ids);
150-
149+
mio::Graph<MockModel, MockMobility> g(ids, models);
150+
151151
EXPECT_EQ(g.edges().size(), 0);
152152
EXPECT_EQ(g.nodes().size(), 2);
153153
EXPECT_EQ(g.nodes()[0].id, 1);

cpp/tests/test_save_parameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ TEST(TestSaveParameters, read_graph_without_edges)
255255
std::vector<mio::osecir::Model<double>> models = {model, model};
256256
std::vector<int> ids = {0, 1};
257257
auto graph_no_edges =
258-
mio::create_graph_without_edges<mio::osecir::Model<double>, mio::MobilityParameters<double>>(models, ids);
258+
mio::Graph<mio::osecir::Model<double>, mio::MobilityParameters<double>>(ids, models);
259259
auto write_status = mio::write_graph(graph_no_edges, tmp_results_dir);
260260
ASSERT_THAT(print_wrap(write_status), IsSuccess());
261261

0 commit comments

Comments
 (0)