feat(scenario-builder): implement database support#3020
Conversation
There was a problem hiding this comment.
I think the possibility of having different rulesets and to select the active one among them makes the code harder to understand, the database bigger nad the queries slower. It's not because the simulator allows it that we should continue handle this in the webapp.
To me we should ensure with the users if they really use this feature as it would make the code easier. I asked Alexander and he does not even seem to understand that this is possible, I'll show him tomorrow and I think we should ask Benoit to do a poll in the Teams conversation with the users
|
For 500 recette studies and 650 production ones I only found 2 studies where someone uses a different ruleset than |
# Conflicts: # antarest/study/dao/api/scenario_builder_dao.py # antarest/study/dao/database/database_study_dao.py
MartinBelthle
left a comment
There was a problem hiding this comment.
Idea for a next work: We should add a DAo method that just saves the data for one scenario type, as this would allow the front-end to be way faster when updating the scenario builder as for now we're reading all and saving all
| sa.Column("area_id", sa.String(length=255), nullable=False), | ||
| sa.Column("st_storage_id", sa.String(length=255), nullable=False), | ||
| sa.Column("constraint_id", sa.String(length=255), nullable=False), | ||
| sa.Column("timeseries", sa.JSON(), nullable=False), |
There was a problem hiding this comment.
I discussed the naming timeseries with Sylvain and we don't think it's the right one. Moreover, for hydro levels they do not even represent a mapping towards a timeserie. I don't have an idea for a name though :/
| from antarest.study.business.model.scenario_builder_model import Ruleset, ScenarioType | ||
| from antarest.study.business.model.sts_model import STStorage, STStorageAdditionalConstraint | ||
| from antarest.study.business.model.thermal_cluster_model import ThermalCluster | ||
| from antarest.study.dao.database.database_study_dao import DatabaseStudyDao |
There was a problem hiding this comment.
We should add tests to ensures when deleting a thermal for example, the sc builder is also empty (even if it's by construction it's nice). And also remove the TODOs inside thermal_dao and renewable_dao (at least) saying that we should perhaps do something when deleting
MartinBelthle
left a comment
There was a problem hiding this comment.
I re-discussed the naming with Sylvain and he prefers to name ts_numbers, value to be as general as possible as for hydro levels it does not represent ts_numbers but rather a percentage to follow.
Other than that, we're good to merge
No description provided.