mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a6349cd9c | ||
|
|
e9c998fec8 | ||
|
|
290b8918fc | ||
|
|
0e6de5d0f0 | ||
|
|
98d30a326e | ||
|
|
5f64499984 | ||
|
|
6e32c740ae | ||
|
|
e0721715d0 |
No files matched your search
@@ -1069,6 +1069,12 @@ gitlab-ci.
|
||||
sudo python3 -m pip install pyinstaller
|
||||
#+end_src
|
||||
|
||||
In addition, you must install Glab[fn:glab] to allow the runner to
|
||||
proceed with the publication.
|
||||
|
||||
[fn:glab] The Gitlab cli releases page:
|
||||
https://gitlab.com/gitlab-org/cli/-/releases
|
||||
|
||||
*** Windows (Wine) {{{windows}}}
|
||||
|
||||
The ci-runner environment for Wine need at least wine version 8, let
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ PyQt5-sip==12.18.0
|
||||
#PyQtWebEngine==5.15.6
|
||||
QScintilla>=2.14.1
|
||||
pyqtgraph>=0.12.1
|
||||
matplotlib==3.8.3
|
||||
matplotlib==3.10.8
|
||||
numpy>=1.24.2
|
||||
colorama>=0.4.3
|
||||
pyinstaller>=5.11.0
|
||||
|
||||
@@ -436,9 +436,11 @@ class Results(SQLSubModel):
|
||||
solver_name TEXT NOT NULL,
|
||||
solver_type TEXT NOT NULL,
|
||||
study_revision INTEGER NOT NULL,
|
||||
creation_data DATE NOT NULL,
|
||||
creation_date DATE NOT NULL,
|
||||
nb_timestamps INTEGER NOT NULL,
|
||||
timestamps BLOB NOT NULL,
|
||||
seed INTEGER,
|
||||
number_of_run INTEGER,
|
||||
{Scenario.create_db_add_scenario()},
|
||||
{Scenario.create_db_add_scenario_fk()},
|
||||
PRIMARY KEY(pamhyr_id, scenario)
|
||||
@@ -464,6 +466,21 @@ class Results(SQLSubModel):
|
||||
cls._db_create(execute)
|
||||
create = True
|
||||
|
||||
if major == "0" and int(minor) <= 2:
|
||||
if int(release) < 9 and not create:
|
||||
execute(
|
||||
"ALTER TABLE results ADD COLUMN " +
|
||||
"seed INTEGER"
|
||||
)
|
||||
execute(
|
||||
"ALTER TABLE results ADD COLUMN " +
|
||||
"number_of_run INTEGER"
|
||||
)
|
||||
execute(
|
||||
"ALTER TABLE results RENAME COLUMN " +
|
||||
"creation_data TO creation_date"
|
||||
)
|
||||
|
||||
return cls._update_submodel(execute, version, data)
|
||||
|
||||
@classmethod
|
||||
@@ -476,7 +493,9 @@ class Results(SQLSubModel):
|
||||
|
||||
table = execute(
|
||||
"SELECT pamhyr_id, solver_name, solver_type, " +
|
||||
"study_revision, creation_data, nb_timestamps, timestamps, " +
|
||||
"study_revision, creation_date, " +
|
||||
"seed, number_of_run, " +
|
||||
"nb_timestamps, timestamps, " +
|
||||
"scenario " +
|
||||
"FROM results " +
|
||||
f"WHERE scenario = {scenario.id}"
|
||||
@@ -496,6 +515,8 @@ class Results(SQLSubModel):
|
||||
solver_type = next(it)
|
||||
revision = next(it)
|
||||
creation_date = next(it)
|
||||
seed = next(it)
|
||||
number_of_run = next(it)
|
||||
nb_timestamps = next(it)
|
||||
timestamps_bytes = next(it)
|
||||
owner_scenario = next(it)
|
||||
@@ -506,6 +527,9 @@ class Results(SQLSubModel):
|
||||
new_results.set("solver_type", solver_type)
|
||||
new_results.set("study_revision", revision)
|
||||
new_results.set("creation_date", creation_date)
|
||||
if seed is not None:
|
||||
new_results.set("seed", seed)
|
||||
new_results.set("number_of_run", number_of_run)
|
||||
|
||||
data["result_pid"] = pid
|
||||
data["result"] = new_results
|
||||
@@ -598,15 +622,25 @@ class Results(SQLSubModel):
|
||||
ts = sorted(self.get("timestamps"))
|
||||
sf = ">" + ''.join(itertools.repeat("d", len(ts)))
|
||||
|
||||
if "seed" in self._meta_data:
|
||||
seed = int(self.get("seed"))
|
||||
number_of_run = int(self.get("number_of_run"))
|
||||
else:
|
||||
seed = None
|
||||
number_of_run = None
|
||||
|
||||
execute(
|
||||
"INSERT INTO " +
|
||||
"results (pamhyr_id, solver_name, solver_type, " +
|
||||
"study_revision, creation_data, " +
|
||||
"study_revision, creation_date, " +
|
||||
"seed, number_of_run, " +
|
||||
"nb_timestamps, timestamps, " +
|
||||
"scenario) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
"scenario) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
self._pamhyr_id, solver_name, solver_type,
|
||||
self._status.version, self.get("creation_date"),
|
||||
len(ts), struct.pack(sf, *ts), self._owner_scenario
|
||||
seed, number_of_run,
|
||||
len(ts), struct.pack(sf, *ts),
|
||||
self._owner_scenario
|
||||
)
|
||||
|
||||
data["result"] = self._pamhyr_id
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ logger = logging.getLogger()
|
||||
|
||||
|
||||
class Study(SQLModel):
|
||||
_version = "0.2.8"
|
||||
_version = "0.2.9"
|
||||
|
||||
_sub_classes = [
|
||||
Scenario,
|
||||
|
||||
@@ -86,12 +86,14 @@ class EnsembleEditDialog(PamhyrDialog):
|
||||
self._ensemble = ensemble
|
||||
self._target_data = None
|
||||
|
||||
self._tree = self.find(QTreeWidget, "treeWidget_target_data")
|
||||
self._tg_group_box = self.find(QGroupBox, "groupBox_target_data")
|
||||
|
||||
self._init_tree()
|
||||
self._init_default_values()
|
||||
self._init_connection()
|
||||
|
||||
def _init_tree(self):
|
||||
self._tree = self.find(QTreeWidget, "treeWidget_target_data")
|
||||
self._tree.setColumnCount(1)
|
||||
self._tree.setHeaderLabels(["Name"])
|
||||
|
||||
@@ -107,6 +109,10 @@ class EnsembleEditDialog(PamhyrDialog):
|
||||
self._ensemble.target_data
|
||||
)
|
||||
|
||||
self._tg_group_box.setTitle(
|
||||
self._format_target_data(self._target_data)
|
||||
)
|
||||
|
||||
item = stricklers.find_item_by_value(self._target_data)
|
||||
if item:
|
||||
self._tree.setCurrentItem(item)
|
||||
@@ -142,6 +148,13 @@ class EnsembleEditDialog(PamhyrDialog):
|
||||
if type(item) is StricklersCoefModelItem:
|
||||
self._target_data = item.get_value()
|
||||
|
||||
self._tg_group_box.setTitle(
|
||||
self._format_target_data(self._target_data)
|
||||
)
|
||||
|
||||
def _format_target_data(self, data):
|
||||
return f" Selection: {str(data[1])}, {data[0]}"
|
||||
|
||||
def update_distribution(self, txt):
|
||||
# txt = self.get_combobox_text("comboBox_distribution")
|
||||
distribution = next(
|
||||
|
||||
@@ -110,7 +110,7 @@ class PlotRKC(PamhyrPlot):
|
||||
ts = results.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0:gi_1 + 1]
|
||||
zfd = table[ts, gi_0:gi_1 + 1]
|
||||
|
||||
self.line_bottom, = self.canvas.axes.plot(
|
||||
rk, zfd,
|
||||
@@ -378,7 +378,8 @@ class PlotRKC(PamhyrPlot):
|
||||
table = results.get("table")["zfd"]
|
||||
ts = results.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
zfd = table[ts, reach.global_index]
|
||||
gi_0, gi_1 = reach.global_index
|
||||
zfd = table[ts, gi_0:gi_1 + 1]
|
||||
|
||||
self.line_bottom.remove()
|
||||
|
||||
|
||||
@@ -1526,7 +1526,6 @@ class ResultsEnsembleWindow(ResultsWindow):
|
||||
def setup_connections(self):
|
||||
# Action
|
||||
actions = {
|
||||
"action_add": self._add_custom_plot,
|
||||
"action_export": self._export,
|
||||
# "action_export": self.export_current,
|
||||
"action_import_data": self.import_data
|
||||
|
||||
@@ -86,10 +86,10 @@ class ScenarioMenu(AbstractMenu):
|
||||
self._trad["menu_dup_scenario"]
|
||||
)
|
||||
|
||||
if item.scenario.is_ensemble():
|
||||
edit_ens = self._menu.addAction(
|
||||
self._trad["menu_edit_ens_scenario"]
|
||||
)
|
||||
if item.scenario.is_ensemble():
|
||||
edit_ens = self._menu.addAction(
|
||||
self._trad["menu_edit_ens_scenario"]
|
||||
)
|
||||
|
||||
action = self._exec()
|
||||
if action is None:
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<widget class="QGroupBox" name="groupBox_target_data">
|
||||
<property name="title">
|
||||
<string>Target data</string>
|
||||
</property>
|
||||
|
||||
@@ -196,22 +196,9 @@
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="action_add"/>
|
||||
<addaction name="action_export"/>
|
||||
<addaction name="action_import_data"/>
|
||||
</widget>
|
||||
<action name="action_add">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>ressources/add.png</normaloff>ressources/add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add customized visualization</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_export">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
|
||||
Reference in new issue
Block a user