Commit d20cdfc4 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

doc: dev: Complete Architecture section.

Showing with 79 additions and 8 deletions
+79 -8
...@@ -73,7 +73,7 @@ https://doc.qt.io/qt-5/model-view-programming.html (last access ...@@ -73,7 +73,7 @@ https://doc.qt.io/qt-5/model-view-programming.html (last access
[fn:org] The org-mode website: https://orgmode.org/ (last access [fn:org] The org-mode website: https://orgmode.org/ (last access
2023-09-15) 2023-09-15)
* TODO Architecture * Architecture
Pamhyr2's architecture is based on Qt Model/View, see Figure Pamhyr2's architecture is based on Qt Model/View, see Figure
[[graph-architecture]]. It is made up of several different components: the [[graph-architecture]]. It is made up of several different components: the
...@@ -672,7 +672,30 @@ data has changed. ...@@ -672,7 +672,30 @@ data has changed.
# Update function code... # Update function code...
#+end_src #+end_src
** TODO Solver ** Solver
The Pamhyr2 architecture allow to define multiple solver. A solver is
define by a:
- type
- name
- description,
- path
- command line pattern
- (optional) input formater path
- (optional) input formater command line
- (optional) output formater path
- (optional) output formater command line
Let see Figure [[graph-multi-solver]], the application can implement
different solver type, this solver type implement the code for export
study to solver input format, and read the solver output to study
results. There exists a generic solver with a generic input and output
format, the type could be use to use a solver not implemented in
Pamhyr2, but this solver must can read/write input and output generic
format or use external script. There is possible to define different
solver with the same type, for example two differents version of the
same solver. Finaly, with input and output formater is possible to
execute a code on distant computer, for example, over ssh.
#+name: graph-multi-solver #+name: graph-multi-solver
#+header: :results drawer #+header: :results drawer
...@@ -782,6 +805,16 @@ data has changed. ...@@ -782,6 +805,16 @@ data has changed.
} }
#+end_src #+end_src
Let see Figure [[graph-pipeline]] the temporal order of action to run a
solver and get results:
- (1) Write solver input file(s) using the study data
- (2) Run the solver
- (2.1) The solver read the input file(s)
- (2.2) The solver compute results and write it to solver output
file(s)
- (3) Pamhyr2 create a Reuslts
- (3.1) The Pamhyr2 solver class read solver output file(s) and
complete Results with readed data
#+name: graph-pipeline #+name: graph-pipeline
#+header: :results drawer #+header: :results drawer
...@@ -811,8 +844,8 @@ data has changed. ...@@ -811,8 +844,8 @@ data has changed.
subgraph cluster1{ subgraph cluster1{
label="File System"; label="File System";
style=dashed; style=dashed;
in[label="Solver input files",shape=note]; in[label="Solver input file(s)",shape=note,fillcolor=white];
out[label="Solver output files",shape=note]; out[label="Solver output file(s)",shape=note,fillcolor=white];
bin[label="Solver binary",shape=note]; bin[label="Solver binary",shape=note];
} }
...@@ -827,6 +860,10 @@ data has changed. ...@@ -827,6 +860,10 @@ data has changed.
} }
#+end_src #+end_src
In case of generic solver (or a solver with input and output formater)
the temporal order of action is prensented in Figure
[[graph-pipeline-generic]].
#+name: graph-pipeline-generic #+name: graph-pipeline-generic
#+header: :results drawer #+header: :results drawer
#+header: :exports results #+header: :exports results
...@@ -858,8 +895,8 @@ data has changed. ...@@ -858,8 +895,8 @@ data has changed.
gin[label="Generic input file", shape=note,fillcolor=white]; gin[label="Generic input file", shape=note,fillcolor=white];
ibin[label="Input formater", shape=note]; ibin[label="Input formater", shape=note];
in[label="Solver input files",shape=note,fillcolor=white]; in[label="Solver input file(s)",shape=note,fillcolor=white];
out[label="Solver output files",shape=note,fillcolor=white]; out[label="Solver output file(s)",shape=note,fillcolor=white];
gout[label="Generic results file",shape=note,fillcolor=white]; gout[label="Generic results file",shape=note,fillcolor=white];
obin[label="Output formater", shape=note]; obin[label="Output formater", shape=note];
bin[label="Solver binary",shape=note]; bin[label="Solver binary",shape=note];
...@@ -894,8 +931,40 @@ data has changed. ...@@ -894,8 +931,40 @@ data has changed.
} }
#+end_src #+end_src
** TODO Unit tests To implement a Solver in Pamhyr2, there exists a abstract class
** TODO The debug mode =Solver.AbstractSolver=. A class who herits this class, must implement
different methods:
- =export=: Export the study to solver input file(s)
- =input_param=: Return the solver input parameter(s) as string
- =log_file=: Return the solver log file name as string
- =results=: Read the solver output file(s) and return a
=Model.Results= object.
** Unit tests
The unit tests is actually not implemented in Pamhyr2, it is a *work
in progress*.
** The debug mode
To activate an deactivate the Pamhyr2 debug mode you can open the
configuration window and type "Ctrl+G" or run Pamhyr2 with command
line:
#+begin_src shell
./Pamhyr2 debug
#+end_src
This mode add some log and add two action in main window menu:
"About/Debug" open a window with Python Repl in current Python
environement, and "About/Debug SQLite" who open the application
SQLiteBrowser (if installed) on current Study to explore the study
data base file.
#+NAME: debug-repl
#+ATTR_LATEX: :width 16cm
#+CAPTION: Pamhyr2 debug Python REPL
[[./images/python-debug-repl.png]]
* TODO Build the project * TODO Build the project
The project uses gitlab-ci runners to build packages, but it is possible The project uses gitlab-ci runners to build packages, but it is possible
...@@ -942,6 +1011,8 @@ winetricks installed. ...@@ -942,6 +1011,8 @@ winetricks installed.
[fn:nsis] The NSIS web site: https://sourceforge.net/projects/nsis/ [fn:nsis] The NSIS web site: https://sourceforge.net/projects/nsis/
** TODO Setup the CI environment ** TODO Setup the CI environment
*** Linux
*** Windows (Wine)
* Documentation files * Documentation files
This document and the user documentation are org files. This text file This document and the user documentation are org files. This text file
......
doc/dev/images/python-debug-repl.png

60.4 KB

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment