porting of code related to pythonTestDirChem