Skip to content

refactoring to exclude solver from the base class#14150

Draft
RiccardoRossi wants to merge 5 commits intomasterfrom
changing_analysis_stage
Draft

refactoring to exclude solver from the base class#14150
RiccardoRossi wants to merge 5 commits intomasterfrom
changing_analysis_stage

Conversation

@RiccardoRossi
Copy link
Member

📝 Description
modifying the base class analysis stage so that it can be run without solver, and defining a derived class "with solver" which replicates the current behaviour

@RiccardoRossi
Copy link
Member Author

this is an attempt of the first step of modification of the AnalysisStage base class, to make the Solver optional.

a derived class AnalysisStageWithSolver is created to replace the current behaviour and used everywhere so that in principle the current behaviour is unmodified

@RiccardoRossi
Copy link
Member Author

ok, i am convinced what is now in the PR is 100% compatible with what we had before.

the one thing is that there are still two empty "placeholder" calls which we need to reproduce the current behaviour:

        self.InitializeSolver() #DOES NOTHING in the base class
        self.ModifyAfterSolverInitialize() #DOES NOTHING in the base class

all the rest is in principle a straightforward change (except obviously that it is now possible to define an AnalysisStage without solver!)

@rubenzorrilla
Copy link
Member

Wouldn't it be easier to add if hasattr(self, '_solver'): clauses in all the methods and make the create solver to return None in the base class. I think that with this we will achieve the very same without the need of having the intermediate class. Besides avoiding changing all the current stages.

@RiccardoRossi
Copy link
Member Author

@rubenzorrilla honestly i think that the solution i am posting here is cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants