Skip to content

Commit

Permalink
parameters.yml in class, correct extension: yml and not yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 20, 2024
1 parent 0b3794a commit b5a44c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
namespace Antares::Solver
{

ModelerParameters parseModelerParameters(const std::filesystem::path& path);
ModelerParameters parseModelerParameters(const std::filesystem::path& studyPath);

} // namespace Antares::Solver
4 changes: 2 additions & 2 deletions src/solver/modeler/parameters/parseModelerParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

namespace Antares::Solver
{
ModelerParameters parseModelerParameters(const std::filesystem::path& path)
ModelerParameters parseModelerParameters(const std::filesystem::path& studyPath)
{
const auto contents = Antares::IO::readFile(path);
const auto contents = Antares::IO::readFile(studyPath / "parameters.yml");
YAML::Node root = YAML::Load(contents);
return root.as<ModelerParameters>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_SUITE(read_modeler_parameters)
BOOST_AUTO_TEST_CASE(all_properties_set)
{
const auto working_tmp_dir = CREATE_TMP_DIR_BASED_ON_TEST_NAME();
const auto fileP = working_tmp_dir / "parameters.yaml";
const auto fileP = working_tmp_dir / "parameters.yml";
{
std::ofstream param(fileP);
param << R"(
Expand All @@ -44,7 +44,7 @@ solver-parameters: PRESOLVE 1
no-output: true)";
}

auto params = Antares::Solver::parseModelerParameters(fileP);
auto params = Antares::Solver::parseModelerParameters(working_tmp_dir);
BOOST_CHECK_EQUAL(params.solver, "sirius");
BOOST_CHECK_EQUAL(params.solverLogs, false);
BOOST_CHECK_EQUAL(params.solverParameters, "PRESOLVE 1");
Expand All @@ -54,7 +54,7 @@ no-output: true)";
BOOST_AUTO_TEST_CASE(all_properties_set_out_of_order)
{
const auto working_tmp_dir = CREATE_TMP_DIR_BASED_ON_TEST_NAME();
const auto fileP = working_tmp_dir / "parameters.yaml";
const auto fileP = working_tmp_dir / "parameters.yml";
{
std::ofstream param(fileP);
param << R"(
Expand All @@ -64,7 +64,7 @@ solver-parameters: PRESOLVE 1
no-output: true)";
}

auto params = Antares::Solver::parseModelerParameters(fileP);
auto params = Antares::Solver::parseModelerParameters(working_tmp_dir);
BOOST_CHECK_EQUAL(params.solver, "sirius");
BOOST_CHECK_EQUAL(params.solverLogs, false);
BOOST_CHECK_EQUAL(params.solverParameters, "PRESOLVE 1");
Expand Down

0 comments on commit b5a44c7

Please sign in to comment.