Compare commits

...

5 Commits

Author SHA1 Message Date
Dylan Jeannin a235f61044 PEP8 fixes 2026-05-26 08:15:04 +02:00
Dylan Jeannin 0b80b86d31 Merge branch 'dev_dylan' into scenarios 2026-05-26 08:10:34 +02:00
Dylan Jeannin 0c7ede5f43 Network: Add missing () on method to check if study is editable 2026-05-26 08:06:07 +02:00
Dylan Jeannin 445c1ac7ba Scenario: Add symbol on missing windows when we are not in a leaf scenario 2026-05-26 07:42:08 +02:00
Dylan Jeannin 5fb6fecc24 Scenarios: Set parent to EDIT when deleting current scenario 2026-05-22 17:25:44 +02:00
8 changed files with 4 additions and 14 deletions

View File

@ -546,7 +546,8 @@ class Study(SQLModel):
self.status.scenario = scenario
if reduce(
lambda a, s: a or (s.parent is scenario),
lambda a, s: a or (s.parent is scenario
and not s.is_deleted()),
self.scenarios.lst,
False
):

View File

@ -90,8 +90,6 @@ class BoundaryConditionAdisTSWindow(PamhyrWindow):
self.setup_table()
self.setup_connections()
self.ui.setWindowTitle(self._title)
def setup_table(self):
self._delegate_type = ComboBoxDelegate(
trad=self._trad,

View File

@ -93,8 +93,6 @@ class D90AdisTSWindow(PamhyrWindow):
self.setup_table()
self.ui.setWindowTitle(self._title)
def setup_table(self):
path_icons = os.path.join(self._get_ui_directory(), f"ressources")

View File

@ -91,8 +91,6 @@ class DIFAdisTSWindow(PamhyrWindow):
self.setup_table()
self.ui.setWindowTitle(self._title)
def setup_table(self):
path_icons = os.path.join(self._get_ui_directory(), f"ressources")

View File

@ -107,8 +107,6 @@ class InitialConditionsWindow(PamhyrWindow):
self.setup_connections()
self.setub_dialogs()
self.ui.setWindowTitle(self._title)
def setup_table(self):
table = self.find(QTableView, f"tableView")
self._delegate_rk = ComboBoxDelegate(

View File

@ -100,8 +100,6 @@ class InitialConditionsAdisTSWindow(PamhyrWindow):
self.setup_table()
self.ui.setWindowTitle(self._title)
def setup_table(self):
path_icons = os.path.join(self._get_ui_directory(), f"ressources")

View File

@ -147,7 +147,7 @@ class NetworkWindow(PamhyrWindow):
self._graph_widget.changeEdge.connect(self.update)
self._graph_widget.changeNode.connect(self.update)
if self._study.is_editable:
if self._study.is_editable():
self._nodes_model\
.dataChanged\
.connect(self._graph_widget.rename_nodes)

View File

@ -74,11 +74,10 @@ class DeleteScenariosCommand(QUndoCommand):
self._study.reload_from_scenario(self._scenario)
def redo(self):
self._scenario.set_as_deleted()
if self._reload:
self._study.reload_from_scenario(self._scenario.parent)
self._scenario.set_as_deleted()
class DuplicateScenariosCommand(QUndoCommand):
def __init__(self, study):