Changeset 79729d5 in flex_extract.git for source/python/mods


Ignore:
Timestamp:
Mar 8, 2019, 4:07:28 PM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
d727af2
Parents:
82c2959
Message:

switched from python2 to python3

Location:
source/python/mods
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/__init__.py

    r25b14be r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
  • source/python/mods/checks.py

    rf20af73 r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
     
    3131except ImportError:
    3232    import builtins as exceptions
    33 from .tools import my_error, silent_remove
    3433from datetime import datetime
    3534import numpy as np
     35from .tools import my_error, silent_remove
    3636# ------------------------------------------------------------------------------
    3737# FUNCTIONS
  • source/python/mods/disaggregation.py

    r6f951ca r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
  • source/python/mods/get_mars_data.py

    rf20af73 r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
     
    176176    with open(marsfile, 'w') as f:
    177177        f.write('request_number' + ', ')
    178         f.write(', '.join(str(key) for key in sorted(attrs.iterkeys())))
     178        f.write(', '.join(str(key) for key in sorted(attrs.keys())))
    179179        f.write('\n')
    180180
  • source/python/mods/prepare_flexpart.py

    rf20af73 r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
  • source/python/mods/profiling.py

    r25b14be r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#************************************************************************
     
    6666        result = fn(*args, **kwargs)
    6767        t2 = time.time()
    68         print("@timefn:" + fn.func_name + " took " + str(t2 - t1) + " seconds")
     68        print("@timefn:" + fn.__name__ + " took " + str(t2 - t1) + " seconds")
    6969
    7070        return result
  • source/python/mods/tools.py

    rf20af73 r79729d5  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
     
    368368                                 stderr=subprocess.PIPE,
    369369                                 bufsize=1)
    370             pout = p.communicate(input=message + '\n\n')[0]
     370            pout = p.communicate(input=message.encode() + '\n\n')[0]
    371371        except ValueError as e:
    372372            print('... ERROR: ' + str(e))
     
    433433    '''
    434434    try:
    435         pools = map(tuple, args) * kwds.get('repeat', 1)
     435        pools = [tuple(arg) for arg in args] * kwds.get('repeat', 1)
    436436        result = [[]]
    437437        for pool in pools:
     
    533533    ipar = []
    534534    for par in cpar:
    535         for k, v in table.iteritems():
     535        for k, v in table.items():
    536536            if par == k or par == v:
    537537                ipar.append(int(k))
     
    574574    spar = []
    575575    for par in cpar:
    576         for k, v in table.iteritems():
     576        for k, v in table.items():
    577577            if par == k or par == v:
    578578                spar.append(k + '.128')
     
    726726        sys.exit('... ECACCESS-JOB-SUBMIT FAILED!')
    727727
    728     return job_id
     728    return job_id.decode()
    729729
    730730
     
    827827
    828828    if not purefc:
    829         it = ((end_date - start_date).days + 1) * 24/int(dtime)
     829        it = ((end_date - start_date).days + 1) * 24 // int(dtime)
    830830    else:
    831831        # #no of step * #no of times * #no of days
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG