@@ -162,31 +162,29 @@ void G3MultiFileWriter::Process(G3FramePtr frame, std::deque<G3FramePtr> &out)
162162}
163163
164164PYBINDINGS (" core" , scope) {
165- py::class_<G3MultiFileWriter, py::bases<G3Module>, std::shared_ptr<G3MultiFileWriter>,
166- boost::noncopyable>(" G3MultiFileWriter" ,
167- " Writes frames to disk into a sequence of files. Once a file exceeds "
168- " the number of bytes specified in size_limit, it will start a new file. "
169- " Files are named based on filename. If passed a string for filename "
170- " with a printf-style specifier, that specifier will be replaced by a "
171- " zero-indexed sequence number. For example, outfile-%03u.g3.gz would "
172- " produce a sequence of files named outfile-000.g3.gz, outfile-001.g3.gz, "
173- " etc. Alternatively, you can pass a callable that is passed the first "
174- " frame in the new file and the sequence number and returns a path to "
175- " the new file. Any frames besides Timepoint and Scan frames have the "
176- " most recent frame of each type prepended to all new files.\n\n "
177- " More complex behavior can be obtained with the optional divide_on "
178- " argument. This can be an iterable of frame types (e.g. "
179- " [core.G3FrameType.Observation]) or a callable. In the iterable case, "
180- " the presence of any frame with a type in the list will cause the "
181- " creation of a new file even if the file size threshold has not yet "
182- " been met. This is useful to create files based on, for example, "
183- " observation boundaries. For more flexibility, you can also pass a "
184- " python callable as divide_on. This callable will be passed each "
185- " frame in turn. If it returns True (or something with positive "
186- " truth-value), a new file will be started at that frame." ,
187- py::init<py::object, size_t , py::optional<py::object, size_t > >((py::arg (" filename" ),
188- py::arg (" size_limit" ), py::arg (" divide_on" )=py::object (), py::arg (" buffersize" )=1024 *1024 )))
189- .def_readonly (" current_file" , &G3MultiFileWriter::CurrentFile)
190- .def_readonly (" __g3module__" , true )
191- ;
165+ register_g3module<G3MultiFileWriter>(scope, " G3MultiFileWriter" ,
166+ " Writes frames to disk into a sequence of files. Once a file exceeds "
167+ " the number of bytes specified in size_limit, it will start a new file. "
168+ " Files are named based on filename. If passed a string for filename "
169+ " with a printf-style specifier, that specifier will be replaced by a "
170+ " zero-indexed sequence number. For example, outfile-%03u.g3.gz would "
171+ " produce a sequence of files named outfile-000.g3.gz, outfile-001.g3.gz, "
172+ " etc. Alternatively, you can pass a callable that is passed the first "
173+ " frame in the new file and the sequence number and returns a path to "
174+ " the new file. Any frames besides Timepoint and Scan frames have the "
175+ " most recent frame of each type prepended to all new files.\n\n "
176+ " More complex behavior can be obtained with the optional divide_on "
177+ " argument. This can be an iterable of frame types (e.g. "
178+ " [core.G3FrameType.Observation]) or a callable. In the iterable case, "
179+ " the presence of any frame with a type in the list will cause the "
180+ " creation of a new file even if the file size threshold has not yet "
181+ " been met. This is useful to create files based on, for example, "
182+ " observation boundaries. For more flexibility, you can also pass a "
183+ " python callable as divide_on. This callable will be passed each "
184+ " frame in turn. If it returns True (or something with positive "
185+ " truth-value), a new file will be started at that frame." )
186+ .def (py::init<py::object, size_t , py::object, size_t >((py::arg (" filename" ),
187+ py::arg (" size_limit" ), py::arg (" divide_on" )=py::object (),
188+ py::arg (" buffersize" )=1024 *1024 )))
189+ .def_readonly (" current_file" , &G3MultiFileWriter::CurrentFile);
192190}
0 commit comments