Fix script check_cas.py to check steering files + times consistence
Reference issue
Description
Python script check_cas.py in pretel was created in 2020 to check steering files, in particular consistence with times. A few keywords have been deleted since the creation of this script (e.g. COMPUTATION CONTINUED for TELEMAC-2D or TELEMAC-3D e.g., 2D CONTINUATION for TELEMAC-3D) and the default value has changed for RECORD NUMBER FOR RESTART (old = 0, now = -1). Moreover, checks for times are only valid if checking TELEMAC-2D or TELEMAC-3D steering files. Check is done for atmospheric data file if not free format (keyword FREE FORMAT FOR ATMOSPHERIC DATA FILE). This script does not seem to be checked in the validation process (or even checked by hand for modules different from TELEMAC-2D or TELEMAC-3D). Finally, checks with previous computation file has been deleted as it seems to be useless (and wrong).
Checklist
All Merge Requests:
-
Update NEWS.txt
to describe your changes. -
Run compile_telemac.py --check
to check FORTRAN coding conventions. -
Run pylint
to check Python coding conventions. -
If you added new files, run compile_telemac.py --clean --rescan
and commit the updatedcmdf
file(s) accordingly. -
Run compile_telemac.py --clean
for both normal and debug configurations. -
Run validate_telemac.py
for both normal and debug configurations. -
Run validate_telemac.py --notebook
for both normal and debug configurations. -
Run doc_telemac.py
if there are any modifications in the documentation. -
Run damocles.py --eficas
if there are any modifications in the dictionaries.
In addition, for a new feature:
-
Check that your feature works in both serial and parallel modes. -
Add at least one test case to check the functionality (with documentation, graphics and VnV script) -
Update the documentation for the module in which your feature will be available.
Merge request reports
Activity
added lang:python type:bug labels
requested review from @boris.basic
assigned to @boris.basic
In
check_time
, rather that addingif module in ['telemac2d', 'telemac3d']:
before retrieving each parameter, I would have added a single check:if module not in ["telemac2d", "telemac3d"]: return
And a similar check for the last parameter which is only available for TELEMAC-3D:
if module != "telemac3d": return
This reduces nested blocks and thus improves code readability.
added 14 commits
-
cf6bd6b0...0b5394ac - 10 commits from branch
main
- 00eb9caf - [fix] Update after deletion of keyword, new default value, modifications
- 50bd26fc - Update NEWS.txt file
- a180c856 - [scripts] Change after running last pylint
- 1f00d381 - Apply suggestions from reviewer Boris Basic
Toggle commit list-
cf6bd6b0...0b5394ac - 10 commits from branch
assigned to @chi-tuan.pham and unassigned @boris.basic
mentioned in commit 989a029e