Python Module TemplateGenerator

TemplateGenerator.main()[source]
TemplateGenerator.check_skip(dest_file, file_list)[source]

Check if the time stamp make it necessary to regenerate the module. Regenerate if returning False, skip generating module for True.

Arguments

dest_filestr

path to the module file. Function checks first if it exists and takes then the time stamp to compare it with the time stamps of the files in the list file_list.

file_listlist of strings

The module is generated out of these template files. If any of those time stamps is newer that the dest_file, the module is regenerated.

TemplateGenerator.build_module(modulename, mpi=True, dbg=True, imps=True, macacc=False, has_hdf5=True)[source]
TemplateGenerator.render_module(flnm, dst, dic)[source]
TemplateGenerator.render_types(flnm, basedic)[source]
TemplateGenerator.render_subroutines(flnm, basedic)[source]

Build the subroutines from a base dictionary and the specifications inside the file. Functions returns string with subroutines and string with interfaces.

TemplateGenerator.render_tests(flnm, basedic, modulename)[source]

Build fortran main and python tests for a module.

TemplateGenerator.update_dic(dics, line, basedic, lineii=- 1, flnm='')[source]

Update the list of dictionaries.

Arguments

dicslist

List of dictionary with all patterns.

linestr

The current line with the replacements.

basedicdic

The basis dictionary with file independent replacements.