mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-07-05 04:45:09 +02:00
added len support to python files
This commit is contained in:
@@ -280,6 +280,7 @@ void define_raw_file_io_bindings(py::module &m) {
|
||||
.def("tell", &RawFile::tell, R"(
|
||||
Return the current frame number.)")
|
||||
.def_property_readonly("total_frames", &RawFile::total_frames)
|
||||
.def("__len__", &RawFile::total_frames)
|
||||
.def("rows", static_cast<size_t (RawFile::*)() const>(&RawFile::rows))
|
||||
.def(
|
||||
"rows",
|
||||
|
||||
@@ -226,5 +226,7 @@ void define_ctb_raw_file_io_bindings(py::module &m) {
|
||||
.def_property_readonly("image_size_in_bytes",
|
||||
&CtbRawFile::image_size_in_bytes)
|
||||
|
||||
.def_property_readonly("frames_in_file", &CtbRawFile::frames_in_file);
|
||||
.def_property_readonly("frames_in_file", &CtbRawFile::frames_in_file)
|
||||
.def_property_readonly("total_frames", &CtbRawFile::total_frames)
|
||||
.def("__len__", &CtbRawFile::total_frames);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ void define_file_io_bindings(py::module &m) {
|
||||
.def("seek", &File::seek)
|
||||
.def("tell", &File::tell)
|
||||
.def_property_readonly("total_frames", &File::total_frames)
|
||||
.def("__len__", &File::total_frames)
|
||||
.def_property_readonly("rows", &File::rows)
|
||||
.def_property_readonly("cols", &File::cols)
|
||||
.def_property_readonly("bitdepth", &File::bitdepth)
|
||||
|
||||
@@ -72,6 +72,7 @@ void define_jungfrau_data_file_io_bindings(py::module &m) {
|
||||
.def_property_readonly("bitdepth", &JungfrauDataFile::bitdepth)
|
||||
.def_property_readonly("current_file", &JungfrauDataFile::current_file)
|
||||
.def_property_readonly("total_frames", &JungfrauDataFile::total_frames)
|
||||
.def("__len__", &JungfrauDataFile::total_frames)
|
||||
.def_property_readonly("n_files", &JungfrauDataFile::n_files)
|
||||
.def("read_frame", &read_dat_frame,
|
||||
R"(
|
||||
|
||||
Reference in New Issue
Block a user