fix ci and add formatting (#48)

* add dependency

* dont run blocking zmq example and add formatting

* format files
This commit is contained in:
Bechir Braham
2024-04-03 13:47:52 +02:00
committed by GitHub
parent 23c855acbc
commit 31a20d4f6c
34 changed files with 438 additions and 522 deletions

View File

@ -4,41 +4,28 @@
#include <pybind11/stl.h>
#include <string>
#include "aare/defs.hpp"
#include "aare/Frame.hpp"
#include "aare/FileHandler.hpp"
#include "aare/Frame.hpp"
#include "aare/defs.hpp"
namespace py = pybind11;
PYBIND11_MODULE(_aare, m) {
// helps to convert from std::string to std::filesystem::path
py::class_<std::filesystem::path>(m, "Path")
.def(py::init<std::string>());
py::implicitly_convertible<std::string, std::filesystem::path>();
py::class_<std::filesystem::path>(m, "Path").def(py::init<std::string>());
py::implicitly_convertible<std::string, std::filesystem::path>();
//TODO: find a solution to avoid code duplication and include other detectors
// TODO: find a solution to avoid code duplication and include other detectors
py::class_<FileHandler>(m, "_FileHandler")
.def(py::init<std::filesystem::path>())
.def("get_frame", &FileHandler::get_frame);
py::enum_<DetectorType>(m, "DetectorType");
py::class_<Frame>(m, "_Frame")
.def(py::init<std::byte*, ssize_t, ssize_t,ssize_t>())
.def(py::init<std::byte *, ssize_t, ssize_t, ssize_t>())
.def("get", &Frame::get)
.def_property_readonly("rows", &Frame::rows)
.def_property_readonly("cols", &Frame::cols)
.def_property_readonly("bitdepth", &Frame::bitdepth);
}