Skip to content

Commit

Permalink
Update python generation scripts for latest gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Aug 15, 2023
1 parent 78a12f4 commit f7c21db
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion python/generate-python-stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ stubgen -p mrpt -p mrpt.pymrpt -o stubs-out

# applying manual patches to stubs:
echo "Applying manual patches to stubs..."
find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL"
find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL --ignore-whitespace"
4 changes: 2 additions & 2 deletions python/generate-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Based on https://github.com/RosettaCommons/binder
#
# binder config: llvm-14
#
#


PYBIND11_VERSION=$(dpkg -s pybind11-dev | grep '^Version:' | cut -d " " -f2)
Expand Down Expand Up @@ -94,5 +94,5 @@ find $WRAP_OUT_DIR -name "*.cpp" | xargs -I FIL \

# applying manual patches:
echo "Applying manual patches to pybind11 code..."
find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL"
find . -name "patch-0*.diff" | xargs -I FIL bash -c "echo \"Applying patch: FIL\" && git apply FIL --ignore-whitespace"

6 changes: 3 additions & 3 deletions python/patch-001.diff
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index cabe86ec7..302018560 100644
+
void bind_std_stl_deque(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_deque_1.cpp b/python/src/std/stl_deque_1.cpp
index d974577d3..a80326114 100644
--- a/python/src/std/stl_deque_1.cpp
Expand All @@ -38,7 +38,7 @@ index d974577d3..a80326114 100644
+
void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_deque_2.cpp b/python/src/std/stl_deque_2.cpp
index ca96e381d..54e7eaaf4 100644
--- a/python/src/std/stl_deque_2.cpp
Expand All @@ -51,7 +51,7 @@ index ca96e381d..54e7eaaf4 100644
+
void bind_std_stl_deque_2(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
diff --git a/python/src/std/stl_map.cpp b/python/src/std/stl_map.cpp
index db3f49fde..793bf72f3 100644
--- a/python/src/std/stl_map.cpp
Expand Down
4 changes: 2 additions & 2 deletions python/patch-007.diff
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index 1638b4d29..4c5984034 100644
+ }, pybind11::keep_alive<0, 1>());
+
}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose2D_mrpt_bayes_particle_storage_mode_VALUE_t", "");
@@ -90,5 +95,10 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam
cl.def("pop_back", (void (std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::*)()) &std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::pop_back, "C++: std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>::pop_back() --> void");
Expand All @@ -39,7 +39,7 @@ index b16449336..69668158e 100644
+ }, pybind11::keep_alive<0, 1>());
+
}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_maps_CRBPFParticleData_mrpt_bayes_particle_storage_mode_POINTER_t", "");
@@ -91,5 +96,10 @@ void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &n
cl.def("pop_back", (void (std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::*)()) &std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::pop_back, "C++: std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>::pop_back() --> void");
Expand Down
6 changes: 3 additions & 3 deletions python/src/mrpt/config/CLoadableOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26
// mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24
struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableOptions {
using mrpt::config::CLoadableOptions::CLoadableOptions;

Expand Down Expand Up @@ -58,8 +58,8 @@ struct PyCallBack_mrpt_config_CLoadableOptions : public mrpt::config::CLoadableO

void bind_mrpt_config_CLoadableOptions(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:26
pybind11::class_<mrpt::config::CLoadableOptions, std::shared_ptr<mrpt::config::CLoadableOptions>, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n");
{ // mrpt::config::CLoadableOptions file:mrpt/config/CLoadableOptions.h line:24
pybind11::class_<mrpt::config::CLoadableOptions, std::shared_ptr<mrpt::config::CLoadableOptions>, PyCallBack_mrpt_config_CLoadableOptions> cl(M("mrpt::config"), "CLoadableOptions", "This is a virtual base class for sets of options than can be loaded from\n and/or saved to configuration plain-text files.\n \n\n\n ");
cl.def(pybind11::init<PyCallBack_mrpt_config_CLoadableOptions const &>());
cl.def( pybind11::init( [](){ return new PyCallBack_mrpt_config_CLoadableOptions(); } ) );
cl.def("loadFromConfigFile", (void (mrpt::config::CLoadableOptions::*)(const class mrpt::config::CConfigFileBase &, const std::string &)) &mrpt::config::CLoadableOptions::loadFromConfigFile, "This method load the options from a \".ini\"-like file or memory-stored\n string list.\n Only those parameters found in the given \"section\" and having\n the same name that the variable are loaded. Those not found in\n the file will stay with their previous values (usually the default\n values loaded at initialization). An example of an \".ini\" file:\n \n\n\n\n\n\n \n loadFromConfigFileName, saveToConfigFile\n\nC++: mrpt::config::CLoadableOptions::loadFromConfigFile(const class mrpt::config::CConfigFileBase &, const std::string &) --> void", pybind11::arg("source"), pybind11::arg("section"));
Expand Down
2 changes: 1 addition & 1 deletion python/src/mrpt/hwdrivers/CNTRIPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void bind_mrpt_hwdrivers_CNTRIPClient(std::function< pybind11::module &(std::str

}
{ // mrpt::hwdrivers::CNTRIPEmitter file:mrpt/hwdrivers/CNTRIPEmitter.h line:62
pybind11::class_<mrpt::hwdrivers::CNTRIPEmitter, std::shared_ptr<mrpt::hwdrivers::CNTRIPEmitter>, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to build\n a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient");
pybind11::class_<mrpt::hwdrivers::CNTRIPEmitter, std::shared_ptr<mrpt::hwdrivers::CNTRIPEmitter>, PyCallBack_mrpt_hwdrivers_CNTRIPEmitter, mrpt::hwdrivers::CGenericSensor> cl(M("mrpt::hwdrivers"), "CNTRIPEmitter", "This \"virtual driver\" encapsulates a NTRIP client (see CNTRIPClient) but\n adds the functionality of dumping the received datastream to a given serial\n port.\n Used within rawlog-grabber, along CGPSInterface, this class allows one to\n build a powerful & simple RTK-capable GPS receiver system.\n\n Therefore, this sensor will never \"collect\" any observation via the\n CGenericSensor interface.\n\n See also the example configuration file for rawlog-grabber in\n \"share/mrpt/config_files/rawlog-grabber\".\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n The next picture summarizes existing MRPT classes related to GPS / GNSS\n devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):\n\n \n\n \n\n \n CGPSInterface, CGPS_NTRIP, CNTRIPClient");
cl.def( pybind11::init( [](){ return new mrpt::hwdrivers::CNTRIPEmitter(); }, [](){ return new PyCallBack_mrpt_hwdrivers_CNTRIPEmitter(); } ) );
cl.def("GetRuntimeClass", (const struct mrpt::hwdrivers::TSensorClassId * (mrpt::hwdrivers::CNTRIPEmitter::*)() const) &mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass, "C++: mrpt::hwdrivers::CNTRIPEmitter::GetRuntimeClass() const --> const struct mrpt::hwdrivers::TSensorClassId *", pybind11::return_value_policy::automatic);
cl.def_static("CreateObject", (class mrpt::hwdrivers::CGenericSensor * (*)()) &mrpt::hwdrivers::CNTRIPEmitter::CreateObject, "C++: mrpt::hwdrivers::CNTRIPEmitter::CreateObject() --> class mrpt::hwdrivers::CGenericSensor *", pybind11::return_value_policy::automatic);
Expand Down
4 changes: 2 additions & 2 deletions python/src/std/stl_deque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PYBIND11_MAKE_OPAQUE(std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TP

void bind_std_stl_deque(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose3D_mrpt_bayes_particle_storage_mode_VALUE_t", "");
cl.def( pybind11::init( [](){ return new std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE>>(); } ) );
cl.def( pybind11::init<const class std::allocator<struct mrpt::bayes::CProbabilityParticle<struct mrpt::math::TPose3D, mrpt::bayes::particle_storage_mode::VALUE> > &>(), pybind11::arg("__a") );
Expand Down Expand Up @@ -62,7 +62,7 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam
}, pybind11::keep_alive<0, 1>());

}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_math_TPose2D_mrpt_bayes_particle_storage_mode_VALUE_t", "");
cl.def( pybind11::init( [](){ return new std::deque<mrpt::bayes::CProbabilityParticle<mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE>>(); } ) );
cl.def( pybind11::init<const class std::allocator<struct mrpt::bayes::CProbabilityParticle<struct mrpt::math::TPose2D, mrpt::bayes::particle_storage_mode::VALUE> > &>(), pybind11::arg("__a") );
Expand Down
4 changes: 2 additions & 2 deletions python/src/std/stl_deque_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PYBIND11_MAKE_OPAQUE(std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CR

void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::math::TPose3D>, std::shared_ptr<std::deque<mrpt::math::TPose3D>>> cl(M("std"), "deque_mrpt_math_TPose3D_t", "");
cl.def( pybind11::init( [](){ return new std::deque<mrpt::math::TPose3D>(); } ) );
cl.def( pybind11::init<const class std::allocator<struct mrpt::math::TPose3D> &>(), pybind11::arg("__a") );
Expand Down Expand Up @@ -70,7 +70,7 @@ void bind_std_stl_deque_1(std::function< pybind11::module &(std::string const &n
}, pybind11::keep_alive<0, 1>());

}
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>, std::shared_ptr<std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>>> cl(M("std"), "deque_mrpt_bayes_CProbabilityParticle_mrpt_maps_CRBPFParticleData_mrpt_bayes_particle_storage_mode_POINTER_t", "");
cl.def( pybind11::init( [](){ return new std::deque<mrpt::bayes::CProbabilityParticle<mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER>>(); } ) );
cl.def( pybind11::init<const class std::allocator<struct mrpt::bayes::CProbabilityParticle<class mrpt::maps::CRBPFParticleData, mrpt::bayes::particle_storage_mode::POINTER> > &>(), pybind11::arg("__a") );
Expand Down
2 changes: 1 addition & 1 deletion python/src/std/stl_deque_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PYBIND11_MAKE_OPAQUE(std::deque<mrpt::system::CDirectoryExplorer::TFileInfo>)

void bind_std_stl_deque_2(std::function< pybind11::module &(std::string const &namespace_) > &M)
{
{ // std::deque file:bits/stl_deque.h line:766
{ // std::deque file:bits/stl_deque.h line:767
pybind11::class_<std::deque<mrpt::system::CDirectoryExplorer::TFileInfo>, std::shared_ptr<std::deque<mrpt::system::CDirectoryExplorer::TFileInfo>>> cl(M("std"), "deque_mrpt_system_CDirectoryExplorer_TFileInfo_t", "");
cl.def( pybind11::init( [](){ return new std::deque<mrpt::system::CDirectoryExplorer::TFileInfo>(); } ) );
cl.def( pybind11::init<const class std::allocator<struct mrpt::system::CDirectoryExplorer::TFileInfo> &>(), pybind11::arg("__a") );
Expand Down

0 comments on commit f7c21db

Please sign in to comment.