Changeset 274f9ef in flex_extract.git for source/python/install.py


Ignore:
Timestamp:
Oct 22, 2018, 11:44:47 AM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
db27c09
Parents:
708c667
Message:

Converted docstrings to numpy style and build first structure for sphinxdocumentation (incl API)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/install.py

    rc5074d2 r274f9ef  
    6666# ------------------------------------------------------------------------------
    6767def main():
    68     '''
    69     @Description:
    70         Controls the installation process. Calls the installation function
    71         if target is specified.
    72 
    73     @Intput:
    74         <nothing>
    75 
    76     @Return:
    77         <nothing>
     68    '''Controls the installation process. Calls the installation function
     69    if target is specified.
     70
     71    Parameters
     72    ----------
     73
     74    Return
     75    ------
    7876    '''
    7977
     
    8886
    8987def get_install_cmdline_arguments():
    90     '''
    91     @Description:
    92         Decomposes the command line arguments and assigns them to variables.
    93         Apply default values for non mentioned arguments.
    94 
    95     @Input:
    96         <nothing>
    97 
    98     @Return:
    99         args: instance of ArgumentParser
    100             Contains the commandline arguments from script/program call.
     88    '''Decomposes the command line arguments and assigns them to variables.
     89    Apply default values for non mentioned arguments.
     90
     91    Parameters
     92    ----------
     93
     94    Return
     95    ------
     96    args : :obj:`Namespace`
     97        Contains the commandline arguments from script/program call.
    10198    '''
    10299    parser = ArgumentParser(description='Install flex_extract software locally or \
     
    139136
    140137def install_via_gateway(c):
    141     '''
    142     @Description:
    143         Perform the actual installation on local machine or prepare data
    144         transfer to remote gate and submit a job script which will
    145         install everything on the remote gate.
    146 
    147     @Input:
    148         c: instance of class ControlFile
    149             Contains all the parameters of CONTROL file and
    150             command line.
    151             For more information about format and content of the parameter
    152             see documentation.
    153 
    154     @Return:
    155         <nothing>
     138    '''Perform the actual installation on local machine or prepare data
     139    transfer to remote gate and submit a job script which will
     140    install everything on the remote gate.
     141
     142    Parameters
     143    ----------
     144    c : :obj:`ControlFile`
     145        Contains all the parameters of CONTROL file and
     146        command line.
     147
     148    Return
     149    ------
     150
    156151    '''
    157152    import tarfile
     
    224219
    225220def mk_tarball(tarball_path, target):
    226     '''
    227     @Description:
    228         Creates a tarball with all necessary files which need to be sent to the
    229         installation directory.
    230         It does not matter if this is local or remote.
    231         Collects all python files, the Fortran source and makefiles,
    232         the ECMWF_ENV file, the CONTROL files as well as the
    233         template files.
    234 
    235     @Input:
    236         tarball_path: string
    237             The complete path to the tar file which will contain all
    238             relevant data for flex_extract.
    239 
    240         target: string
    241             The queue where the job is submitted to.
    242 
    243     @Return:
    244         <nothing>
     221    '''Creates a tarball with all necessary files which need to be sent to the
     222    installation directory.
     223    It does not matter if this is local or remote.
     224    Collects all python files, the Fortran source and makefiles,
     225    the ECMWF_ENV file, the CONTROL files as well as the
     226    template files.
     227
     228    Parameters
     229    ----------
     230    tarball_path : :obj:`string`
     231        The complete path to the tar file which will contain all
     232        relevant data for flex_extract.
     233
     234    target : :obj:`string`
     235        The queue where the job is submitted to.
     236
     237    Return
     238    ------
     239
    245240    '''
    246241    import tarfile
     
    294289
    295290def un_tarball(tarball_path):
    296     '''
    297     @Description:
    298         Extracts the given tarball into current directory.
    299 
    300     @Input:
    301         tarball_path: string
    302             The complete path to the tar file which will contain all
    303             relevant data for flex_extract.
    304 
    305     @Return:
    306         <nothing>
     291    '''Extracts the given tarball into current directory.
     292
     293    Parameters
     294    ----------
     295    tarball_path : :obj:`string`
     296        The complete path to the tar file which will contain all
     297        relevant data for flex_extract.
     298
     299    Return
     300    ------
     301
    307302    '''
    308303    import tarfile
     
    316311
    317312def mk_env_vars(ecuid, ecgid, gateway, destination):
    318     '''
    319     @Description:
    320         Creates a file named ECMWF_ENV which contains the
    321         necessary environmental variables at ECMWF servers.
    322         It is based on the template ECMWF_ENV.template.
    323 
    324     @Input:
    325         ecuid: string
    326             The user id on ECMWF server.
    327 
    328         ecgid: string
    329             The group id on ECMWF server.
    330 
    331         gateway: string
    332             The gateway server the user is using.
    333 
    334         destination: string
    335             The remote destination which is used to transfer files
    336             from ECMWF server to local gateway server.
    337 
    338     @Return:
    339         <nothing>
     313    '''Creates a file named ECMWF_ENV which contains the
     314    necessary environmental variables at ECMWF servers.
     315    It is based on the template ECMWF_ENV.template.
     316
     317    Parameters
     318    ----------
     319    ecuid : :obj:`string`
     320        The user id on ECMWF server.
     321
     322    ecgid : :obj:`string`
     323        The group id on ECMWF server.
     324
     325    gateway : :obj:`string`
     326        The gateway server the user is using.
     327
     328    destination : :obj:`string`
     329        The remote destination which is used to transfer files
     330        from ECMWF server to local gateway server.
     331
     332    Return
     333    ------
     334
    340335    '''
    341336    from genshi.template.text import NewTextTemplate
     
    358353
    359354def mk_compilejob(makefile, target, ecuid, ecgid, fp_root):
    360     '''
    361     @Description:
    362         Modifies the original job template file so that it is specified
    363         for the user and the environment were it will be applied. Result
    364         is stored in a new file "job.temp" in the python directory.
    365 
    366     @Input:
    367         makefile: string
    368             Name of the makefile which should be used to compile FORTRAN
    369             CONVERT2 program.
    370 
    371         target: string
    372             The target where the installation should be done, e.g. the queue.
    373 
    374         ecuid: string
    375             The user id on ECMWF server.
    376 
    377         ecgid: string
    378             The group id on ECMWF server.
    379 
    380         fp_root: string
    381            Path to the root directory of FLEXPART environment or flex_extract
    382            environment.
    383 
    384     @Return:
    385         <nothing>
     355    '''Modifies the original job template file so that it is specified
     356    for the user and the environment were it will be applied. Result
     357    is stored in a new file "job.temp" in the python directory.
     358
     359    Parameters
     360    ----------
     361    makefile : :obj:`string`
     362        Name of the makefile which should be used to compile FORTRAN
     363        CONVERT2 program.
     364
     365    target : :obj:`string`
     366        The target where the installation should be done, e.g. the queue.
     367
     368    ecuid : :obj:`string`
     369        The user id on ECMWF server.
     370
     371    ecgid : :obj:`string`
     372        The group id on ECMWF server.
     373
     374    fp_root : :obj:`string`
     375       Path to the root directory of FLEXPART environment or flex_extract
     376       environment.
     377
     378    Return
     379    ------
     380
    386381    '''
    387382    from genshi.template.text import NewTextTemplate
     
    413408
    414409def mk_job_template(ecuid, ecgid, gateway, destination, fp_root):
    415     '''
    416     @Description:
    417         Modifies the original job template file so that it is specified
    418         for the user and the environment were it will be applied. Result
    419         is stored in a new file.
    420 
    421     @Input:
    422         ecuid: string
    423             The user id on ECMWF server.
    424 
    425         ecgid: string
    426             The group id on ECMWF server.
    427 
    428         gateway: string
    429             The gateway server the user is using.
    430 
    431         destination: string
    432             The remote destination which is used to transfer files
    433             from ECMWF server to local gateway server.
    434 
    435         fp_root: string
    436            Path to the root directory of FLEXPART environment or flex_extract
    437            environment.
    438 
    439     @Return:
    440         <nothing>
     410    '''Modifies the original job template file so that it is specified
     411    for the user and the environment were it will be applied. Result
     412    is stored in a new file.
     413
     414    Parameters
     415    ----------
     416    ecuid : :obj:`string`
     417        The user id on ECMWF server.
     418
     419    ecgid : :obj:`string`
     420        The group id on ECMWF server.
     421
     422    gateway : :obj:`string`
     423        The gateway server the user is using.
     424
     425    destination : :obj:`string`
     426        The remote destination which is used to transfer files
     427        from ECMWF server to local gateway server.
     428
     429    fp_root : :obj:`string`
     430       Path to the root directory of FLEXPART environment or flex_extract
     431       environment.
     432
     433    Return
     434    ------
     435
    441436    '''
    442437    from genshi.template.text import NewTextTemplate
     
    467462
    468463def delete_convert_build(src_path):
    469     '''
    470     @Description:
    471         Clean up the Fortran source directory and remove all
    472         build files (e.g. *.o, *.mod and CONVERT2)
    473 
    474     @Input:
    475         src_path: string
    476             Path to the fortran source directory.
    477 
    478     @Return:
    479         <nothing>
     464    '''Clean up the Fortran source directory and remove all
     465    build files (e.g. \*.o, \*.mod and CONVERT2)
     466
     467    Parameters
     468    ----------
     469    src_path : :obj:`string`
     470        Path to the fortran source directory.
     471
     472    Return
     473    ------
     474
    480475    '''
    481476
     
    491486
    492487def make_convert_build(src_path, makefile):
    493     '''
    494     @Description:
    495         Compiles the Fortran code and generates the executable.
    496 
    497     @Input:
    498         src_path: string
    499             Path to the fortran source directory.
    500 
    501         makefile: string
    502             The name of the makefile which should be used.
    503 
    504     @Return:
    505         <nothing>
     488    '''Compiles the Fortran code and generates the executable.
     489
     490    Parameters
     491    ----------
     492    src_path : :obj:`string`
     493        Path to the fortran source directory.
     494
     495    makefile : :obj:`string`
     496        The name of the makefile which should be used.
     497
     498    Return
     499    ------
     500
    506501    '''
    507502
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG