Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
axelvonkamp committed Jul 3, 2024
1 parent b76d21b commit 7be3f40
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 58 deletions.
34 changes: 18 additions & 16 deletions cnapy/gui_elements/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,25 +376,25 @@ def __init__(self, appdata: AppData):
load_modes_action.triggered.connect(self.load_modes)

self.sd_menu = self.analysis_menu.addMenu("Computational Strain Design")
self.sd_action = QAction("Compute Minimal Cut Sets...", self)
self.sd_action.triggered.connect(self.mcs)
self.sd_menu.addAction(self.sd_action)
self.mcs_dialog = None

load_mcs_action = QAction("Load Minimal Cut Sets...", self)
self.sd_menu.addAction(load_mcs_action)
load_mcs_action.triggered.connect(self.load_mcs)

self.sd_action = QAction("Compute Strain Designs...", self)
self.sd_action.triggered.connect(self.strain_design)
self.sd_menu.addAction(self.sd_action)
sd_action = QAction("Compute Strain Designs...", self)
sd_action.triggered.connect(self.strain_design)
self.sd_menu.addAction(sd_action)
self.sd_dialog = None
self.sd_sols = None

load_sd_action = QAction("Load Strain Designs...", self)
self.sd_menu.addAction(load_sd_action)
load_sd_action.triggered.connect(self.load_strain_designs)

sd_action = QAction("Compute Minimal Cut Sets (legacy)...", self)
sd_action.triggered.connect(self.mcs)
self.sd_menu.addAction(sd_action)
self.mcs_dialog = None

load_mcs_action = QAction("Load Minimal Cut Sets (legacy)...", self)
self.sd_menu.addAction(load_mcs_action)
load_mcs_action.triggered.connect(self.load_mcs)

self.flux_optimization_action = QAction(
"Flux optimization...", self)
self.flux_optimization_action.triggered.connect(self.optimize_flux)
Expand Down Expand Up @@ -747,7 +747,7 @@ def show_strain_designs_with_setup(self, solutions_with_setup):
self.show_strain_designs(solutions_with_setup, with_setup=True)

@Slot(bytes)
def show_strain_designs(self,solutions, with_setup=False):
def show_strain_designs(self, solutions, with_setup=False):
self.sd_sols = SDViewer(self.appdata, solutions, with_setup)
self.sd_sols.show()
self.centralWidget().update_mode()
Expand Down Expand Up @@ -785,6 +785,9 @@ def show_config_cobrapy_dialog(self):
if self.mcs_dialog is not None:
dialog.optlang_solver_set.connect(self.mcs_dialog.set_optlang_solver_text)
dialog.optlang_solver_set.connect(self.mcs_dialog.configure_solver_options)
if self.sd_dialog is not None:
dialog.optlang_solver_set.connect(self.sd_dialog.set_optlang_solver_text)
dialog.optlang_solver_set.connect(self.sd_dialog.configure_solver_options)
dialog.exec_()

@Slot()
Expand Down Expand Up @@ -1362,9 +1365,8 @@ def close_project_dialogs(self):
if self.mcs_dialog is not None:
self.mcs_dialog.close()
self.mcs_dialog = None
if self.sd_dialog:
if self.sd_dialog.__weakref__:
del self.sd_dialog
if self.sd_dialog is not None:
self.sd_dialog.close()
self.sd_dialog = None
if self.make_scenario_feasible_dialog is not None:
self.make_scenario_feasible_dialog.close()
Expand Down
8 changes: 8 additions & 0 deletions cnapy/gui_elements/solver_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ def get_solver_buttons(appdata) -> Tuple[QVBoxLayout, QButtonGroup]:
r'(https://github.com/scipopt/PySCIPOpt')
solver_buttons_layout.addWidget(solver_buttons[SCIP])
solver_buttons["group"].addButton(solver_buttons[SCIP])
# optlang_enumerator
solver_buttons['OPTLANG'] = QRadioButton()
solver_buttons['OPTLANG'].setProperty('name','OPTLANG')
solver_buttons['OPTLANG'].setToolTip('optlang_enumerator supports calculation of reaction MCS only.\n'+\
'Reaction knock-ins and setting of intervention costs are possible.\n'+\
'The solver can be changed via COBRApy settings.')
solver_buttons_layout.addWidget(solver_buttons['OPTLANG'])
solver_buttons["group"].addButton(solver_buttons['OPTLANG'])
# check best available solver
if avail_solvers:
# Set cobrapy default solver if available
Expand Down
Loading

0 comments on commit 7be3f40

Please sign in to comment.