lsst.meas.modelfit  13.0-10-g4e34388+1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
multiModel.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2013 LSST Corporation.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 
24 #include "pybind11/pybind11.h"
25 #include "pybind11/stl.h"
26 
28 
29 namespace py = pybind11;
30 using namespace pybind11::literals;
31 
32 namespace lsst {
33 namespace meas {
34 namespace modelfit {
35 namespace {
36 
37 using PyMultiModel = py::class_<MultiModel, std::shared_ptr<MultiModel>, Model>;
38 
39 PYBIND11_PLUGIN(multiModel) {
40  py::module::import("lsst.meas.modelfit.model");
41 
42  py::module mod("multiModel");
43 
44  PyMultiModel cls(mod, "MultiModel");
45  cls.def(py::init<ModelVector, MultiModel::NameVector const &>(), "components"_a, "prefixes"_a);
46  cls.def("getComponents", &MultiModel::getComponents);
47 
48  // All other MultiModel methods are virtuals already inherited from
49  // wrappers for Model.
50 
51  return mod.ptr();
52 }
53 }
54 }
55 }
56 } // namespace lsst::meas::modelfit::anonymous