Format all files
This commit is contained in:
@@ -39,10 +39,10 @@
|
||||
|
||||
#include "pythoncaller.h"
|
||||
#include <exception>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <string>
|
||||
|
||||
std::string PythonCaller::generatePlots(std::string_view pathToTrace)
|
||||
{
|
||||
@@ -52,12 +52,12 @@ std::string PythonCaller::generatePlots(std::string_view pathToTrace)
|
||||
auto result = metricsModule.attr("generatePlots")(pathToTrace).cast<std::string>();
|
||||
return result;
|
||||
}
|
||||
catch (std::exception const &err)
|
||||
catch (std::exception const& err)
|
||||
{
|
||||
std::cout << err.what() << std::endl;
|
||||
}
|
||||
|
||||
return {};
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::string> PythonCaller::availableMetrics(std::string_view pathToTrace)
|
||||
@@ -68,7 +68,7 @@ std::vector<std::string> PythonCaller::availableMetrics(std::string_view pathToT
|
||||
pybind11::list result = metricsModule.attr("getMetrics")(pathToTrace);
|
||||
return result.cast<std::vector<std::string>>();
|
||||
}
|
||||
catch (std::exception const &err)
|
||||
catch (std::exception const& err)
|
||||
{
|
||||
std::cout << err.what() << std::endl;
|
||||
}
|
||||
@@ -76,14 +76,16 @@ std::vector<std::string> PythonCaller::availableMetrics(std::string_view pathToT
|
||||
return {};
|
||||
}
|
||||
|
||||
TraceCalculatedMetrics PythonCaller::evaluateMetrics(std::string_view pathToTrace, std::vector<long> selectedMetrics)
|
||||
TraceCalculatedMetrics PythonCaller::evaluateMetrics(std::string_view pathToTrace,
|
||||
std::vector<long> selectedMetrics)
|
||||
{
|
||||
TraceCalculatedMetrics metrics(pathToTrace.data());
|
||||
|
||||
try
|
||||
{
|
||||
pybind11::module_ metricsModule = pybind11::module_::import("metrics");
|
||||
pybind11::list result = metricsModule.attr("calculateMetrics")(pathToTrace, selectedMetrics);
|
||||
pybind11::list result =
|
||||
metricsModule.attr("calculateMetrics")(pathToTrace, selectedMetrics);
|
||||
auto metricList = result.cast<std::vector<pybind11::tuple>>();
|
||||
|
||||
for (auto metricPair : metricList)
|
||||
@@ -93,7 +95,7 @@ TraceCalculatedMetrics PythonCaller::evaluateMetrics(std::string_view pathToTrac
|
||||
metrics.addCalculatedMetric({name, value});
|
||||
}
|
||||
}
|
||||
catch (std::exception const &err)
|
||||
catch (std::exception const& err)
|
||||
{
|
||||
std::cout << err.what() << std::endl;
|
||||
}
|
||||
@@ -109,7 +111,7 @@ std::string PythonCaller::dumpVcd(std::string_view pathToTrace)
|
||||
pybind11::str result = vcdModule.attr("dumpVcd")(pathToTrace);
|
||||
return result.cast<std::string>();
|
||||
}
|
||||
catch (std::exception const &err)
|
||||
catch (std::exception const& err)
|
||||
{
|
||||
std::cout << err.what() << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user