FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
PYexportGraph.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef PYEXPORTGRAPH_H_INCLUDED
9#define PYEXPORTGRAPH_H_INCLUDED
10
11#include "Rdefinitions.hpp"
12#include "FMTgraphstats.hpp"
13#include "FMTgraph.hpp"
14#include "boost/python.hpp"
15
16namespace Python
17{
19{
20 namespace bp = boost::python;
21 bp::object GraphModule(bp::handle<>(bp::borrowed(PyImport_AddModule("FMT.Graph"))));
22 bp::scope().attr("Graph") = GraphModule;
23 bp::scope GraphModule_scope = GraphModule;
24 bp::scope().attr("__doc__") = ".. module:: Graph\n"
25 "\n"
26 " :platform: Unix, Windows\n"
27 " :synopsis: Module used to generate graph.\n"
28 "\n";
29
30 bp::class_<Graph::FMTgraphstats>("FMTgraphstats", "@DocString(FMTgraphstats)")
31 .def("__str__", &Graph::FMTgraphstats::operator std::string,
32 "@DocString(FMTgraphstats::operator std::string)")
33 .def_readwrite("cols", &Graph::FMTgraphstats::cols,
34 "@DocString(FMTgraphstats::cols)")
35 .def_readwrite("rows", &Graph::FMTgraphstats::rows,
36 "@DocString(FMTgraphstats::rows)")
37 .def_readwrite("vertices", &Graph::FMTgraphstats::vertices,
38 "@DocString(FMTgraphstats::vertices)")
39 .def_readwrite("edges", &Graph::FMTgraphstats::edges,
40 "@DocString(FMTgraphstats::edges)")
41 .def_readwrite("transfer_rows", &Graph::FMTgraphstats::transfer_rows,
42 "@DocString(FMTgraphstats::transfer_rows)")
43 .def_readwrite("output_rows", &Graph::FMTgraphstats::output_rows,
44 "@DocString(FMTgraphstats::output_rows)")
45 .def_readwrite("output_cols", &Graph::FMTgraphstats::output_cols,
46 "@DocString(FMTgraphstats::output_cols)");
47
48 bp::class_<Graph::FMTpredictor>("FMTpredictor", "@DocString(FMTpredictor)")
49 .def("getpredictors", &Graph::FMTpredictor::getpredictors,
50 "@DocString(FMTpredictor::getpredictors)")
51 .def("getpredictornames", &Graph::FMTpredictor::getpredictornames,
52 "@DocString(FMTpredictor::getpredictornames)");
53
54 define_pylist<Graph::FMTpredictor>();
55 define_pydict<int, int>();
56 define_pylist<std::vector<Graph::FMTpredictor>>();
57 bp::enum_<Graph::FMTgraphbuild>("FMTsolverinterface")
58 .value("schedulebuild", Graph::FMTgraphbuild::schedulebuild)
59 .value("fullbuild", Graph::FMTgraphbuild::fullbuild)
60 .value("nobuild", Graph::FMTgraphbuild::nobuild);
61
62 //bp::class_<Graph::FMTgraph>("FMTgraph", "@DocString(FMTgraph)")
63 // .def_pickle(FMT_pickle_suite<Graph::FMTgraph>());
64
65 bp::class_<Graph::FMTlinegraph>("FMTlinegraph","@DocString(FMTgraph)")
66 .def("getperiodactionids",&Graph::FMTlinegraph::getperiodactionids,"@DocString(FMTgraphstats::getperiodactionids)");
67
68}
69
70}
71
72#endif // PYEXPORTGRAPH_H_INCLUDED
int output_cols
Number of output cols in the FMTlpsolver.
Definition: FMTgraphstats.hpp:66
int cols
Number of columns in the matrix of FMTlpsolver.
Definition: FMTgraphstats.hpp:48
int vertices
Number of verticies in the FMTgraph.
Definition: FMTgraphstats.hpp:54
int transfer_rows
Number of area transfer rows in the FMTlpsolver.
Definition: FMTgraphstats.hpp:60
int rows
Number of rows in the matrix of FMTlpsolver.
Definition: FMTgraphstats.hpp:51
int output_rows
Number of output rows in the FMTlpsolver.
Definition: FMTgraphstats.hpp:63
int edges
Number of edges in the FMTgraph.
Definition: FMTgraphstats.hpp:57
std::vector< int > getperiodactionids(const int &period) const
std::vector< std::string > getpredictornames(const std::vector< std::string > &yieldnames) const
std::vector< double > getpredictors() const
Definition: PYdefinitions.hpp:14
void exportGraph()
Definition: PYexportGraph.hpp:18