Welcome, Guest
Username: Password: Remember me

TOPIC: PyTelTools: Python scripts and GUI to automate Telemac post-processing

PyTelTools: Python scripts and GUI to automate Telemac post-processing 7 years 2 months ago #27759

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
Hi all,

We developed some Python scripts at CNR and share them github at github.com/CNR-Engineering/PyTelTools, which are intended to be accessible, extensible and customized.

They are done with Python3 and PyQt5 (and requires somes packages, see requirements.txt). Developed scripts include some files parsers (Serafin, BlueKenue ...) and a collection of mathematical or spatial calculations based on 2D or 3D Telemac results. Moreover an easy-to-use GUI, which includes a workflow, was implemented to facilitate post-processing tasks on 2D or 3D computation results.

We should present them at the next Telemac User Conference in Graz.
In the meanwhile, a user documentation is provided online on a wiki based format: github.com/CNR-Engineering/PyTelTools/wiki, for those who are interested.

Any feedback is welcomed.

Best Regards,
Luc
The administrator has disabled public write access.
The following user(s) said Thank You: pilou1253, cyamin, josekdiaz, Norsazz, dkush

PyTelTools: Python scripts and GUI to automate Telemac post-processing 7 years 2 months ago #27765

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Hello,

Thank you for your efforts - would you prefer these to leave separately on your git server or would you like to integrate those into the standard python script. Also, would you mind adapting your Qt GUI to be used from within QGIS, in collaboration with the existing QGIS plugin developed by ARTELIA ?

Either way is fine. I will have a look anyway.

Sébastien.
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 7 years 1 month ago #28019

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
Dear Sébastien,

Considering the version control repository and hosting service, we chose github for its widespread use for open-source projets, its simplicity and because it already includes essential tools for a developpement project.
We are open to integrate the tools into the standard python script (do you mean a subdirectory of the svn trunk?), if it is more relevant and if we do not loose the required features.

Indeed, a migration would raise some questions:
* which Python version, coding conventions, dependencies... => in case of merging the scripts
* docstrings for automatic documentation generator (doxygen, sphinx?)
* collaborative documentation => where to documentate the scripts. It is currently not possible in dokuwiki (see my post from last year left unanswered: www.opentelemac.org/index.php/kunena/10-...cumentation-and-wiki) or in another way (www.opentelemac.org/index.php/community-...python-scripts#23883)
* bug tracker

There is indeed efforts to be done to join forces in Python scripts projects: python27 (python scripts in official telemac trunk), pputils, PostTelemac (based on python27), PyTelTools and many others (which are sometimes also not shared).

About the second point, I completely agree that most PyTelTools tools (in Classic interface) should be integrated in PostTelemac plugin.
But for many reasons (mainly because we found QGIS/PostTelemac sometimes unstable and we had no solid experience on QGIS), we did not integrate them. The coming of QGIS3 (based on Python3 and Qt5) would raise the question again and facilitate its integration (as the code has to be revised/adapted).
Considering the workflow interface (to automate tasks), it should be kept outside a GIS environment as it is not dedicated to GIS visualization.

Finally, in my opinion, a set of Python scripts (at least most base classes/functions) for openTelemac should have their place in the official package library pypi, in as much as it is documented and maintained. It should facilitate its usage and distribution.

Best Regards,
Luc
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 8 months ago #29360

  • meh
  • meh's Avatar
Hello,
I wanted to use your scripts but when trying I read in your website the following thing :
If you want to use a virtual environment do the following:

$ virtualenv venv --python=python3
$ source venv/bin/activate

I don't know how to do it (I already downloaded the WinPython portable installation for Python 3.6 with all the dependencies required by PyTelTools)
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 8 months ago #29364

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
Hello,

If you are on Windows and already have WinPython with the modules requirements (it should be the case if you download the version with the link on the PyTelTools wiki), you just need to get PyTelTools source code.
You can download a zip at this link https://github.com/CNR-Engineering/PyTelTools/archive/master.zip.
Simply unzip it a folder such as
C:\softs\TELEMAC\scripts
.

Assuming you have WinPython-64bit-3.6.1.0Qt5 folder at the root of C:\ drive, then you can launch the interface with from the Windows command line :
C:\WinPython-64bit-3.6.1.0Qt5\python-3.6.1.amd64\python.exe C:\softs\TELEMAC\scripts\PyTelTools\pyteltools\main_interface.py

You could also write a bat file with the following content to avoid typing it each time :
set PYTHONPATH=C:\softs\TELEMAC\scripts\PyTelTools
Rem Uncomment this if you want to configure something: set PYTELTOOLS_SETTINGS=C:\softs\TELEMAC\scripts\my_pyteltools_settings.json
C:\WinPython-64bit-3.6.1.0Qt5\python-3.6.1.amd64\python.exe "%PYTHONPATH%\pyteltools\main_interface.py"
pause

Hope it helps,
Luc
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 8 months ago #29367

  • meh
  • meh's Avatar
thank you for replying
I did what you said and got an error :
Traceback (most recent call last):
File "C:\PyTelTools\PyTelTools-master\pyteltools\main_interface.py", line 4, in <module>
from pyteltools.gui.classic_gui import ClassicMainWindow as GUIWindow
ModuleNotFoundError: No module named 'pyteltools'
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 8 months ago #29368

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
meh wrote:
thank you for replying
I did what you said and got an error :
Traceback (most recent call last):
File "C:\PyTelTools\PyTelTools-master\pyteltools\main_interface.py", line 4, in <module>
from pyteltools.gui.classic_gui import ClassicMainWindow as GUIWindow
ModuleNotFoundError: No module named 'pyteltools'

You have to launch PyTelTools from the folder where it was unzipped.
You have to move to the directory
C:\PyTelTools\PyTelTools-master
and then run :
C:\WinPython-64bit-3.6.1.0Qt5\python-3.6.1.amd64\python.exe pyteltools/main_interface.py

Otherwise, you have to define PYTHONPATH environment variable with the value
C:\PyTelTools\PyTelTools-master
(you can find details here). It can be done in a bat file as described in my previous post (with set PYTHONPATH=...). Then you can run the bat file from everywhere.

Regards,
Luc
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 6 months ago #30215

  • Beya
  • Beya's Avatar
Hi Luc,

I followed the same steps and I am also getting the same error as Meh. Even when launching from the PyTelTools-master folder using the command prompt in windows 10.

The exact line I was using was:

C:\PyTelTools\PyTelTools-master>C:\WinPython\python-3.6.5.amd64\python.exe pyteltools\main_interface.py

And the error message:

Traceback (most recent call last):
File "main_interface.py", line 4, in <module>
from pyteltools.gui.classic_gui import ClassicMainWindow as GUIWindow
ModuleNotFoundError: No module named 'pyteltools'


If you know what else could be happening I would appreciate if you could let me know.

Cheers

Jose
The administrator has disabled public write access.

PyTelTools: Python scripts and GUI to automate Telemac post-processing 6 years 5 months ago #30373

  • Lux
  • Lux's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 39
Dear Jose,

It seems that your PYTHONPATH is not set properly for PyTelTools.
You can try to set the environement variable through the Windows settings or just by executing this command line (for Windows only) before launching PyTelTools within the same command-line interpreter:
set PYTHONPATH=C:\PyTelTools\PyTelTools-master

Hope it helps.
Regards,
Luc
The administrator has disabled public write access.
The following user(s) said Thank You: Beya
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.