Skip to content

Commit ba09906

Browse files
committed
backports
- e707720 - 169e402
1 parent 22d644c commit ba09906

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

disstans/network.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ def graphical_cme(self,
25312531

25322532
def gui(self,
25332533
station: str | None = None,
2534-
timeseries: list[str] | None = None,
2534+
timeseries: str | list[str] | None = None,
25352535
fit_list: list[str] | None = None,
25362536
sum_models: bool = True,
25372537
verbose: bool = False,
@@ -2580,7 +2580,7 @@ def gui(self,
25802580
station
25812581
Pre-select a station.
25822582
timeseries
2583-
List of strings with the descriptions of the timeseries to plot.
2583+
String or list of strings with the descriptions of the timeseries to plot.
25842584
``None`` defaults to all timeseries.
25852585
fit_list
25862586
List of strings containing the model names of the subset of the models
@@ -2668,6 +2668,15 @@ def gui(self,
26682668
gui_kw_args
26692669
Override default GUI settings of :attr:`~disstans.config.defaults`.
26702670
"""
2671+
2672+
# check the timeseries setting
2673+
if isinstance(timeseries, str):
2674+
timeseries = [timeseries]
2675+
else:
2676+
assert (timeseries is None) or (isinstance(timeseries, list) and
2677+
all([isinstance(t, str) for t in timeseries])), \
2678+
f"'timeseries' must be None, a string, or list of strings, got '{timeseries}'."
2679+
26712680
# create map and timeseries figures
26722681
gui_settings = defaults["gui"].copy()
26732682
gui_settings.update(gui_kw_args)

disstans/solvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ def solve_problem(GtWG, GtWd, pen, num_comps, init_weights, nonneg, nonpos):
10061006
for i in range(n_iters): # always solve at least once
10071007
try:
10081008
problem.solve(enforce_dpp=True, **cvxpy_kw_args)
1009-
except cp.error.SolverError as e:
1009+
except BaseException as e:
10101010
# no solution found, but actually a more serious problem
10111011
warn(str(e), stacklevel=2)
10121012
converged = False

0 commit comments

Comments
 (0)