Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data for modeler (epic 4.1) #2577

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

guilpier-code
Copy link
Contributor

@guilpier-code guilpier-code commented Jan 14, 2025

Associated to epic 4.1.
Associated to ticket ANT-2031

@@ -28,20 +28,33 @@
namespace Antares::Solver::Modeler::Api
{

class LinearProblemData
class ILinearProblemData
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface class ILinearProblemData was created here, but it should be eventually moved in a separate header file.
The current location (solver/modeler/api) seems the right place for this header file, because this interface belongs to and should be defined where the contract it represents is actually required : class LinearProblemBuilder and class LinearProblemFiller

unsigned int hour) = 0;
};

class LinearProblemData : public ILinearProblemData
Copy link
Contributor Author

@guilpier-code guilpier-code Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About where we should put class LinearProblemData (which is a implementation of interface ILinearProblemData) :
We should take this page (see part 3) into account.
Possible location candidates are :

  • src/study/data-series
  • src/data-series

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With legacy code?
I’d rather create a specific implementation in that place.

Copy link
Contributor Author

@guilpier-code guilpier-code Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a target of a new source file architecture here.
I guess handling new modeler data should go to one of sub directory suggested above, whether we mix legacy code or not.
To be decided.

@guilpier-code guilpier-code marked this pull request as draft January 14, 2025 08:40
@a-zakir
Copy link
Contributor

a-zakir commented Jan 14, 2025

It would be a good idea to write some tests that demonstrate the use cases of the new interface.

include/antares/solver/modeler/api/linearProblemFiller.h
include/antares/solver/modeler/api/linearProblemBuilder.h

linearProblemData.cpp
Copy link
Contributor Author

@guilpier-code guilpier-code Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class LinearProblemData was moved from here (src/solver/modeler/api) to src/solver/modeler/dataSeries

namespace Antares::Solver::Modeler::Api
{

class ILinearProblemData
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concrete class LinearProblemData now inherits from abstract class ILinearProblemData

testModelerLinearProblemWithOrtools.cpp
testModelerLPbuilder.cpp
INCLUDE
"${src_solver_optimisation}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src_solver_optimisation does not seem to be useful, we remove it

test_readLinearExpressionVisitor.cpp
test_readLinearConstraintVisitor.cpp
INCLUDE
"${src_solver_optimisation}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src_solver_optimisation does not seem to be useful, we remove it

class DataSeriesRepository
{
public:
void addDataSeries(std::unique_ptr<IDataSeries> dataSeries);
Copy link
Contributor Author

@guilpier-code guilpier-code Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About void addDataSeries(...) : forces to std::move a unique pointer defined outside.
So the client IDataSeries gets empty after this call.
I thought it's suitable, as data series have to end up inside the data series repository and seem useless somewhere else.


namespace Antares::Solver::Modeler::DataSeries
{
class TimeSeriesSet: public IDataSeries
Copy link
Contributor Author

@guilpier-code guilpier-code Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class TimeSeriesSet is supposed to be out of epic 4.1's scope.
But we needed a concrete child of IDataSeries in order to unit test other classes (for instance DataSeriesRepository).
This class can end up not required and removed at some point.
It comes with unit tests (see testTimeSeriesSet.cpp).

@guilpier-code guilpier-code marked this pull request as ready for review January 21, 2025 15:40
#include <antares/solver/modeler/loadFiles/loadFiles.h>
#include <antares/solver/modeler/ortoolsImpl/linearProblem.h>
#include <antares/solver/modeler/parameters/parseModelerParameters.h>
#include <antares/solver/optim-model-filler/ComponentFiller.h>

#include "../optimisation/include/antares/solver/optimisation/LegacyFiller.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We take advantage of resolving conflicts to remove unnecessary code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants