CXX2PY

Copyright (c) 2024 MPI-M, Clara Bayley

—– CLEO —– File: cxx2py.py Project: pySD Created Date: Friday 13th October 2023 Author: Clara Bayley (CB) Additional Contributors: —– Last Modified: Tuesday 7th May 2024 Modified By: CB —– License: BSD 3-Clause “New” or “Revised” License https://opensource.org/licenses/BSD-3-Clause —– File Description:

pySD.cxx2py.derive_more_floats(consts)[source]

return mconsts dictionary containing some derived key,values from values in consts dictionary

pySD.cxx2py.line_with_assignment(line)[source]

find all the lines in a file which have form […] = […] ; ie. lines which assign variables. return list of these lines truncatd at ;

pySD.cxx2py.print_dict_statement(filename, dictname, dict)[source]

print key, value pairs for dictionary created by reading filename

pySD.cxx2py.read_cxxconsts_into_floats(filename)[source]

returns dictionary of value: float from (const) doubles and (const) ints assigned in a c++ file. Also returns dictionary of notfloats for values that couldn’t be converted

pySD.cxx2py.remove_excess_line(line)[source]

removes white spaces and and comments from a line

pySD.cxx2py.where_typename_ends(line)[source]

finds index where c++ name for variable type ends for a const double, double, int or const int.