mbdevpl / transpyle

HPC-oriented transpiler for C, C++, Cython, Fortran, OpenCL and Python.
Apache License 2.0
139 stars 23 forks source link

module 'transpyle' has no attribute 'CodeReader' #14

Closed animaone closed 3 years ago

animaone commented 3 years ago

I am getting the error: module 'transpyle' has no attribute 'CodeReader' when I try to run the following code:

import pathlib
import transpyle

path = pathlib.Path('my_script.py')
code_reader = transpyle.CodeReader()
code = code_reader.read_file(path)

from_language = transpyle.Language.find('Python 3.6')
to_language = transpyle.Language.find('Fortran 95')
translator = transpyle.AutoTranslator(from_language, to_language)
fortran_code = translator.translate(code, path)
print(fortran_code)
jnoortheen commented 3 years ago

the correct import path is from transpyle.general.code_reader import CodeReader