Rules of coding for developers¶
The snowtools_git project follows the PEP8 norm as the vortex project.
http://vortex.meteo.fr/vortex/doku.php/suivi_des_devs:contribuer:norme_codage_style
All developers must use PyCharm or Eclipse to edit the code and configure it appropriately.
All developments must be compatible with python3.6
Contributions will not be accepted if they do not follow these requirements.
Module imports must be homogeneous in the project, in particular:
import numpy as np from matplotlib import pyplot as plt
Do not use :
from XXXX import *
Only import modules when they are used in the code.
os.system must not be used in the general case.
For files management, use appropriate methods of the os and shutil packages.
For system calls, prefer:
status = subprocess.call(commande, stdout=sys.stdout, stderr=sys.stderr)
SURFEX developements must follow the specific coding rules of this project: http://www.cnrm.meteo.fr/surfex-lab/spip.php?rubrique93
Contributions will not be accepted if they do not follow these requirements.
For both snowtools and SURFEX projects, all developments must be done in seperated git branches with frequent commit to ensure traceability of your modifications and the ability to include in your own branch the main bugfixes and developments of the main branches.
Test new implementations¶
Before providing any new contribution to the snowtools_git project, the developers must manage to run successfully all the unit tests of the project with both python2.7 and python3.
If you are doing this for the first time, in Eclipse, right click on the tests directory, click on Run as --> Run configurations. Select the Environment tab , click on New and set the environment variables SNOWTOOLS_CEN and EXESURFEX to appropriate values. Click on Apply and Close.
Then, in any case, run all tests by a right click on the tests directory, click on Run as --> Python unit-test
Solve the issues and repeat the tests until success.
All significant new implementations should come with new unit tests in the test directory.