From 40e4c1cc78b4fdea125a8592ab228f6a8c06cdf2 Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 15 Jun 2023 11:11:57 +0100 Subject: [PATCH] Fix formatting --- bindings/python/bergamot.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/python/bergamot.cpp b/bindings/python/bergamot.cpp index d7b9f1d21..6f2f01bc9 100644 --- a/bindings/python/bergamot.cpp +++ b/bindings/python/bergamot.cpp @@ -12,8 +12,8 @@ #include #include -#include #include +#include namespace py = pybind11; @@ -118,19 +118,19 @@ class ServicePyAdapter { return responses; } - void setTerminology(py::dict terminology, bool forceTerminology=false) { + void setTerminology(py::dict terminology, bool forceTerminology = false) { // It seems copying is not too bad for performance. Also this should happen rarely and with small objects // https://github.com/pybind/pybind11/issues/3033 std::unordered_map cppTerminology; for (std::pair item : terminology) { - auto key = item.first.cast(); - auto value = item.second.cast(); - cppTerminology[key] = value; + auto key = item.first.cast(); + auto value = item.second.cast(); + cppTerminology[key] = value; } service_.setTerminology(cppTerminology, forceTerminology); } - private /*functions*/: + private /*functions*/: static Service make_service(const Service::Config &config) { py::scoped_ostream_redirect outstream(std::cout, // std::ostream& py::module_::import("sys").attr("stdout") // Python output @@ -144,7 +144,7 @@ class ServicePyAdapter { return Service(config); } - private /*data*/: + private /*data*/: Service service_; }; @@ -213,8 +213,8 @@ PYBIND11_MODULE(_bergamot, m) { .def("setTerminology", &ServicePyAdapter::setTerminology); py::class_(m, "ServiceConfig") - .def(py::init<>([](size_t numWorkers, size_t cacheSize, std::string logging, - std::string pathToTerminologyFile, bool terminologyForce, std::string terminologyForm ) { + .def(py::init<>([](size_t numWorkers, size_t cacheSize, std::string logging, std::string pathToTerminologyFile, + bool terminologyForce, std::string terminologyForm) { Service::Config config; config.numWorkers = numWorkers; config.cacheSize = cacheSize;