Convert analyzers from DTK-Tools

Although the use of analyzers in DTK-Tools and idmtools is very similar, being aware of some of the differences may be helpful with the conversion process. For example some of the class and method names are different, as seen in the following diagram:

../_images/b25e2dbb3f5b2ffca31027aa09770fd7840b9f21331791e05425309b6034d809.svg

As the previous diagram illustrates the DTK-Tools methods, select_simulation_data() and finalize(), have been renamed to map() and reduce() in idmtools; however, the parameters are the same:

select_simulation_data(self,data,simulation)
map(self,data,simulation)

finalize(self,all_data)
reduce(self,all_data)

For additional information about the IAnalyzer class and methods, see IAnalyzer.

In addition, you can also see an example of a .csv analyzer created in DTK-Tools and how it was converted to idmtools. Other than the class name and some method names changing the core code is almost the same. The primary differences can be seen in the class import statements and the execution of the analysis within the if __name__ == ‘__main__’: block of code.