Changeset dda0e9d in flex_extract.git


Ignore:
Timestamp:
Aug 31, 2018, 2:07:57 PM (14 months ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
dev
Children:
2f4cc73
Parents:
7c82d52
Message:

set path to grib1 table as global variable; test path

Location:
python
Files:
2 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • python/EcFlexpart.py

    r54a8a01 rdda0e9d  
    852852        '''
    853853
    854         table128 = init128(c.ecmwfdatadir +
    855                            '/grib_templates/ecmwf_grib1_table_128')
     854        table128 = init128(_config.PATH_GRIBTABLE)
    856855        wrfpars = to_param_id('sp/mslp/skt/2t/10u/10v/2d/z/lsm/sst/ci/sd/\
    857856                            stl1/stl2/stl3/stl4/swvl1/swvl2/swvl3/swvl4',
     
    11001099        '''
    11011100
    1102         table128 = init128(c.ecmwfdatadir +
    1103                            '/grib_templates/ecmwf_grib1_table_128')
     1101        table128 = init128(_config.PATH_GRIBTABLE)
    11041102        pars = to_param_id(self.params['OG_acc_SL'][0], table128)
    11051103        index_keys = ["date", "time", "step"]
  • python/_config.py

    r54a8a01 rdda0e9d  
    2626import inspect
    2727
    28 
    2928_VERSION_STR = '7.1'
    30 
    3129
    3230# add path to pythonpath
     
    3533if LOCAL_PYTHON_PATH not in sys.path:
    3634    sys.path.append(LOCAL_PYTHON_PATH)
     35
     36# path to gribtable
     37PATH_GRIBTABLE = LOCAL_PYTHON_PATH + '/templates/ecmwf_grib1_table_128'
     38
  • python/pythontest/TestPathes.py

    r067a0c3 rdda0e9d  
    22# -*- coding: utf-8 -*-
    33
     4import os
     5import sys
    46import pytest
    57
     8sys.path.append("../")
     9import _config
    610
    7 def test_vtable():
    8     print "vtable test"
    911
     12def test_path_vtable():
     13    assert os.path.exists(_config.PATH_GRIBTABLE) == 1
     14
     15def test_file_vtable():
     16    assert os.path.isfile(_config.PATH_GRIBTABLE) == 1
     17
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG