ctpbee-opt-api 0.1.0__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. ctpbee_api/__init__.py +17 -0
  2. ctpbee_api/ctp/__init__.py +3 -0
  3. ctpbee_api/ctp/ctp_constant.py +1253 -0
  4. ctpbee_api/ctp/generator/concat.py +93 -0
  5. ctpbee_api/ctp/generator/const.py +325 -0
  6. ctpbee_api/ctp/generator/ctp_constant.py +1274 -0
  7. ctpbee_api/ctp/generator/ctp_md_header_define.h +13 -0
  8. ctpbee_api/ctp/generator/ctp_md_header_function.h +6 -0
  9. ctpbee_api/ctp/generator/ctp_md_header_on.h +26 -0
  10. ctpbee_api/ctp/generator/ctp_md_header_process.h +26 -0
  11. ctpbee_api/ctp/generator/ctp_md_source_function.cpp +42 -0
  12. ctpbee_api/ctp/generator/ctp_md_source_module.cpp +18 -0
  13. ctpbee_api/ctp/generator/ctp_md_source_on.cpp +156 -0
  14. ctpbee_api/ctp/generator/ctp_md_source_process.cpp +282 -0
  15. ctpbee_api/ctp/generator/ctp_md_source_switch.cpp +78 -0
  16. ctpbee_api/ctp/generator/ctp_md_source_task.cpp +211 -0
  17. ctpbee_api/ctp/generator/ctp_struct.py +5640 -0
  18. ctpbee_api/ctp/generator/ctp_td_header_define.h +130 -0
  19. ctpbee_api/ctp/generator/ctp_td_header_function.h +174 -0
  20. ctpbee_api/ctp/generator/ctp_td_header_on.h +260 -0
  21. ctpbee_api/ctp/generator/ctp_td_header_process.h +260 -0
  22. ctpbee_api/ctp/generator/ctp_td_source_function.cpp +1456 -0
  23. ctpbee_api/ctp/generator/ctp_td_source_module.cpp +222 -0
  24. ctpbee_api/ctp/generator/ctp_td_source_on.cpp +1572 -0
  25. ctpbee_api/ctp/generator/ctp_td_source_process.cpp +5472 -0
  26. ctpbee_api/ctp/generator/ctp_td_source_switch.cpp +780 -0
  27. ctpbee_api/ctp/generator/ctp_td_source_task.cpp +2444 -0
  28. ctpbee_api/ctp/generator/ctp_typedef.py +800 -0
  29. ctpbee_api/ctp/generator/generate_api_functions.py +345 -0
  30. ctpbee_api/ctp/generator/generate_data_type.py +76 -0
  31. ctpbee_api/ctp/generator/generate_struct.py +84 -0
  32. ctpbee_api/ctp/include/mac/ctp/ThostFtdcMdApi.h +168 -0
  33. ctpbee_api/ctp/include/mac/ctp/ThostFtdcTraderApi.h +770 -0
  34. ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiDataType.h +6878 -0
  35. ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiStruct.h +10915 -0
  36. ctpbee_api/ctp/include/mac/pybind11/attr.h +690 -0
  37. ctpbee_api/ctp/include/mac/pybind11/buffer_info.h +208 -0
  38. ctpbee_api/ctp/include/mac/pybind11/cast.h +1704 -0
  39. ctpbee_api/ctp/include/mac/pybind11/chrono.h +225 -0
  40. ctpbee_api/ctp/include/mac/pybind11/common.h +2 -0
  41. ctpbee_api/ctp/include/mac/pybind11/complex.h +74 -0
  42. ctpbee_api/ctp/include/mac/pybind11/detail/class.h +743 -0
  43. ctpbee_api/ctp/include/mac/pybind11/detail/common.h +1255 -0
  44. ctpbee_api/ctp/include/mac/pybind11/detail/descr.h +171 -0
  45. ctpbee_api/ctp/include/mac/pybind11/detail/init.h +434 -0
  46. ctpbee_api/ctp/include/mac/pybind11/detail/internals.h +656 -0
  47. ctpbee_api/ctp/include/mac/pybind11/detail/type_caster_base.h +1177 -0
  48. ctpbee_api/ctp/include/mac/pybind11/detail/typeid.h +65 -0
  49. ctpbee_api/ctp/include/mac/pybind11/eigen/common.h +9 -0
  50. ctpbee_api/ctp/include/mac/pybind11/eigen/matrix.h +714 -0
  51. ctpbee_api/ctp/include/mac/pybind11/eigen/tensor.h +516 -0
  52. ctpbee_api/ctp/include/mac/pybind11/eigen.h +12 -0
  53. ctpbee_api/ctp/include/mac/pybind11/embed.h +316 -0
  54. ctpbee_api/ctp/include/mac/pybind11/eval.h +156 -0
  55. ctpbee_api/ctp/include/mac/pybind11/functional.h +137 -0
  56. ctpbee_api/ctp/include/mac/pybind11/gil.h +239 -0
  57. ctpbee_api/ctp/include/mac/pybind11/iostream.h +265 -0
  58. ctpbee_api/ctp/include/mac/pybind11/numpy.h +1998 -0
  59. ctpbee_api/ctp/include/mac/pybind11/operators.h +202 -0
  60. ctpbee_api/ctp/include/mac/pybind11/options.h +92 -0
  61. ctpbee_api/ctp/include/mac/pybind11/pybind11.h +2890 -0
  62. ctpbee_api/ctp/include/mac/pybind11/pytypes.h +2557 -0
  63. ctpbee_api/ctp/include/mac/pybind11/stl/filesystem.h +116 -0
  64. ctpbee_api/ctp/include/mac/pybind11/stl.h +447 -0
  65. ctpbee_api/ctp/include/mac/pybind11/stl_bind.h +851 -0
  66. ctpbee_api/ctp/include/mac/pybind11/type_caster_pyobject_ptr.h +61 -0
  67. ctpbee_api/ctp/include/new/ctp/ThostFtdcMdApi.h +168 -0
  68. ctpbee_api/ctp/include/new/ctp/ThostFtdcTraderApi.h +770 -0
  69. ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiDataType.h +6878 -0
  70. ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiStruct.h +10915 -0
  71. ctpbee_api/ctp/include/new/pybind11/attr.h +690 -0
  72. ctpbee_api/ctp/include/new/pybind11/buffer_info.h +208 -0
  73. ctpbee_api/ctp/include/new/pybind11/cast.h +1704 -0
  74. ctpbee_api/ctp/include/new/pybind11/chrono.h +225 -0
  75. ctpbee_api/ctp/include/new/pybind11/common.h +2 -0
  76. ctpbee_api/ctp/include/new/pybind11/complex.h +74 -0
  77. ctpbee_api/ctp/include/new/pybind11/detail/class.h +743 -0
  78. ctpbee_api/ctp/include/new/pybind11/detail/common.h +1255 -0
  79. ctpbee_api/ctp/include/new/pybind11/detail/descr.h +171 -0
  80. ctpbee_api/ctp/include/new/pybind11/detail/init.h +434 -0
  81. ctpbee_api/ctp/include/new/pybind11/detail/internals.h +656 -0
  82. ctpbee_api/ctp/include/new/pybind11/detail/type_caster_base.h +1177 -0
  83. ctpbee_api/ctp/include/new/pybind11/detail/typeid.h +65 -0
  84. ctpbee_api/ctp/include/new/pybind11/eigen/common.h +9 -0
  85. ctpbee_api/ctp/include/new/pybind11/eigen/matrix.h +714 -0
  86. ctpbee_api/ctp/include/new/pybind11/eigen/tensor.h +516 -0
  87. ctpbee_api/ctp/include/new/pybind11/eigen.h +12 -0
  88. ctpbee_api/ctp/include/new/pybind11/embed.h +316 -0
  89. ctpbee_api/ctp/include/new/pybind11/eval.h +156 -0
  90. ctpbee_api/ctp/include/new/pybind11/functional.h +137 -0
  91. ctpbee_api/ctp/include/new/pybind11/gil.h +239 -0
  92. ctpbee_api/ctp/include/new/pybind11/iostream.h +265 -0
  93. ctpbee_api/ctp/include/new/pybind11/numpy.h +1998 -0
  94. ctpbee_api/ctp/include/new/pybind11/operators.h +202 -0
  95. ctpbee_api/ctp/include/new/pybind11/options.h +92 -0
  96. ctpbee_api/ctp/include/new/pybind11/pybind11.h +2890 -0
  97. ctpbee_api/ctp/include/new/pybind11/pytypes.h +2557 -0
  98. ctpbee_api/ctp/include/new/pybind11/stl/filesystem.h +116 -0
  99. ctpbee_api/ctp/include/new/pybind11/stl.h +447 -0
  100. ctpbee_api/ctp/include/new/pybind11/stl_bind.h +851 -0
  101. ctpbee_api/ctp/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  102. ctpbee_api/ctp/include/previous/ctp/ThostFtdcMdApi.h +168 -0
  103. ctpbee_api/ctp/include/previous/ctp/ThostFtdcTraderApi.h +770 -0
  104. ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiDataType.h +6878 -0
  105. ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiStruct.h +10915 -0
  106. ctpbee_api/ctp/include/previous/pybind11/attr.h +489 -0
  107. ctpbee_api/ctp/include/previous/pybind11/buffer_info.h +108 -0
  108. ctpbee_api/ctp/include/previous/pybind11/cast.h +2067 -0
  109. ctpbee_api/ctp/include/previous/pybind11/chrono.h +162 -0
  110. ctpbee_api/ctp/include/previous/pybind11/common.h +2 -0
  111. ctpbee_api/ctp/include/previous/pybind11/complex.h +61 -0
  112. ctpbee_api/ctp/include/previous/pybind11/detail/class.h +626 -0
  113. ctpbee_api/ctp/include/previous/pybind11/detail/common.h +803 -0
  114. ctpbee_api/ctp/include/previous/pybind11/detail/descr.h +185 -0
  115. ctpbee_api/ctp/include/previous/pybind11/detail/init.h +335 -0
  116. ctpbee_api/ctp/include/previous/pybind11/detail/internals.h +285 -0
  117. ctpbee_api/ctp/include/previous/pybind11/detail/typeid.h +53 -0
  118. ctpbee_api/ctp/include/previous/pybind11/eigen.h +604 -0
  119. ctpbee_api/ctp/include/previous/pybind11/embed.h +194 -0
  120. ctpbee_api/ctp/include/previous/pybind11/eval.h +117 -0
  121. ctpbee_api/ctp/include/previous/pybind11/functional.h +85 -0
  122. ctpbee_api/ctp/include/previous/pybind11/iostream.h +200 -0
  123. ctpbee_api/ctp/include/previous/pybind11/numpy.h +1601 -0
  124. ctpbee_api/ctp/include/previous/pybind11/operators.h +168 -0
  125. ctpbee_api/ctp/include/previous/pybind11/options.h +65 -0
  126. ctpbee_api/ctp/include/previous/pybind11/pybind11.h +1965 -0
  127. ctpbee_api/ctp/include/previous/pybind11/pytypes.h +1332 -0
  128. ctpbee_api/ctp/include/previous/pybind11/stl.h +376 -0
  129. ctpbee_api/ctp/include/previous/pybind11/stl_bind.h +599 -0
  130. ctpbee_api/ctp/libs/libcomunicationkey.a +0 -0
  131. ctpbee_api/ctp/libs/libcrypto.a +0 -0
  132. ctpbee_api/ctp/libs/libssl.a +0 -0
  133. ctpbee_api/ctp/libs/thostmduserapi_se.lib +0 -0
  134. ctpbee_api/ctp/libs/thosttraderapi_se.lib +0 -0
  135. ctpbee_api/ctp/libthostmduserapi_se.so +0 -0
  136. ctpbee_api/ctp/libthosttraderapi_se.so +0 -0
  137. ctpbee_api/ctp/thostmduserapi_se.dll +0 -0
  138. ctpbee_api/ctp/thosttraderapi_se.dll +0 -0
  139. ctpbee_api/ctp/vnctp/vnctp.h +189 -0
  140. ctpbee_api/ctp/vnctp/vnctp.sln +41 -0
  141. ctpbee_api/ctp/vnctp/vnctpmd/dllmain.cpp +19 -0
  142. ctpbee_api/ctp/vnctp/vnctpmd/stdafx.cpp +1 -0
  143. ctpbee_api/ctp/vnctp/vnctpmd/stdafx.h +17 -0
  144. ctpbee_api/ctp/vnctp/vnctpmd/targetver.h +8 -0
  145. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.cpp +953 -0
  146. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.h +209 -0
  147. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj +200 -0
  148. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.filters +54 -0
  149. ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.user +4 -0
  150. ctpbee_api/ctp/vnctp/vnctptd/dllmain.cpp +19 -0
  151. ctpbee_api/ctp/vnctp/vnctptd/stdafx.cpp +1 -0
  152. ctpbee_api/ctp/vnctp/vnctptd/stdafx.h +16 -0
  153. ctpbee_api/ctp/vnctp/vnctptd/targetver.h +8 -0
  154. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.cpp +12148 -0
  155. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.h +1329 -0
  156. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj +198 -0
  157. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.filters +54 -0
  158. ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.user +4 -0
  159. ctpbee_api/ctp/vnctpmd.cp312-win_amd64.pyd +0 -0
  160. ctpbee_api/ctp/vnctptd.cp312-win_amd64.pyd +0 -0
  161. ctpbee_api/ctp_mini/__init__.py +3 -0
  162. ctpbee_api/ctp_mini/generator/generate_api_functions.py +343 -0
  163. ctpbee_api/ctp_mini/generator/generate_data_type.py +76 -0
  164. ctpbee_api/ctp_mini/generator/generate_struct.py +85 -0
  165. ctpbee_api/ctp_mini/generator/mini_constant.py +1186 -0
  166. ctpbee_api/ctp_mini/generator/mini_md_header_define.h +13 -0
  167. ctpbee_api/ctp_mini/generator/mini_md_header_function.h +4 -0
  168. ctpbee_api/ctp_mini/generator/mini_md_header_on.h +26 -0
  169. ctpbee_api/ctp_mini/generator/mini_md_header_process.h +26 -0
  170. ctpbee_api/ctp_mini/generator/mini_md_source_function.cpp +29 -0
  171. ctpbee_api/ctp_mini/generator/mini_md_source_module.cpp +17 -0
  172. ctpbee_api/ctp_mini/generator/mini_md_source_on.cpp +156 -0
  173. ctpbee_api/ctp_mini/generator/mini_md_source_process.cpp +264 -0
  174. ctpbee_api/ctp_mini/generator/mini_md_source_switch.cpp +78 -0
  175. ctpbee_api/ctp_mini/generator/mini_md_source_task.cpp +203 -0
  176. ctpbee_api/ctp_mini/generator/mini_struct.py +4599 -0
  177. ctpbee_api/ctp_mini/generator/mini_td_header_define.h +63 -0
  178. ctpbee_api/ctp_mini/generator/mini_td_header_function.h +84 -0
  179. ctpbee_api/ctp_mini/generator/mini_td_header_on.h +126 -0
  180. ctpbee_api/ctp_mini/generator/mini_td_header_process.h +126 -0
  181. ctpbee_api/ctp_mini/generator/mini_td_source_function.cpp +663 -0
  182. ctpbee_api/ctp_mini/generator/mini_td_source_module.cpp +107 -0
  183. ctpbee_api/ctp_mini/generator/mini_td_source_on.cpp +756 -0
  184. ctpbee_api/ctp_mini/generator/mini_td_source_process.cpp +2492 -0
  185. ctpbee_api/ctp_mini/generator/mini_td_source_switch.cpp +378 -0
  186. ctpbee_api/ctp_mini/generator/mini_td_source_task.cpp +1193 -0
  187. ctpbee_api/ctp_mini/generator/mini_typedef.py +755 -0
  188. ctpbee_api/ctp_mini/generator/package/vnminimd.cpp +886 -0
  189. ctpbee_api/ctp_mini/generator/package/vnminimd.h +205 -0
  190. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcMdApi.h +148 -0
  191. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcTraderApi.h +419 -0
  192. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiDataType.h +6458 -0
  193. ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiStruct.h +8890 -0
  194. ctpbee_api/ctp_mini/include/new/pybind11/attr.h +690 -0
  195. ctpbee_api/ctp_mini/include/new/pybind11/buffer_info.h +208 -0
  196. ctpbee_api/ctp_mini/include/new/pybind11/cast.h +1704 -0
  197. ctpbee_api/ctp_mini/include/new/pybind11/chrono.h +225 -0
  198. ctpbee_api/ctp_mini/include/new/pybind11/common.h +2 -0
  199. ctpbee_api/ctp_mini/include/new/pybind11/complex.h +74 -0
  200. ctpbee_api/ctp_mini/include/new/pybind11/detail/class.h +743 -0
  201. ctpbee_api/ctp_mini/include/new/pybind11/detail/common.h +1255 -0
  202. ctpbee_api/ctp_mini/include/new/pybind11/detail/descr.h +171 -0
  203. ctpbee_api/ctp_mini/include/new/pybind11/detail/init.h +434 -0
  204. ctpbee_api/ctp_mini/include/new/pybind11/detail/internals.h +656 -0
  205. ctpbee_api/ctp_mini/include/new/pybind11/detail/type_caster_base.h +1177 -0
  206. ctpbee_api/ctp_mini/include/new/pybind11/detail/typeid.h +65 -0
  207. ctpbee_api/ctp_mini/include/new/pybind11/eigen/common.h +9 -0
  208. ctpbee_api/ctp_mini/include/new/pybind11/eigen/matrix.h +714 -0
  209. ctpbee_api/ctp_mini/include/new/pybind11/eigen/tensor.h +516 -0
  210. ctpbee_api/ctp_mini/include/new/pybind11/eigen.h +12 -0
  211. ctpbee_api/ctp_mini/include/new/pybind11/embed.h +316 -0
  212. ctpbee_api/ctp_mini/include/new/pybind11/eval.h +156 -0
  213. ctpbee_api/ctp_mini/include/new/pybind11/functional.h +137 -0
  214. ctpbee_api/ctp_mini/include/new/pybind11/gil.h +239 -0
  215. ctpbee_api/ctp_mini/include/new/pybind11/iostream.h +265 -0
  216. ctpbee_api/ctp_mini/include/new/pybind11/numpy.h +1998 -0
  217. ctpbee_api/ctp_mini/include/new/pybind11/operators.h +202 -0
  218. ctpbee_api/ctp_mini/include/new/pybind11/options.h +92 -0
  219. ctpbee_api/ctp_mini/include/new/pybind11/pybind11.h +2890 -0
  220. ctpbee_api/ctp_mini/include/new/pybind11/pytypes.h +2557 -0
  221. ctpbee_api/ctp_mini/include/new/pybind11/stl/filesystem.h +116 -0
  222. ctpbee_api/ctp_mini/include/new/pybind11/stl.h +447 -0
  223. ctpbee_api/ctp_mini/include/new/pybind11/stl_bind.h +851 -0
  224. ctpbee_api/ctp_mini/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  225. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcMdApi.h +148 -0
  226. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcTraderApi.h +419 -0
  227. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiDataType.h +6458 -0
  228. ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiStruct.h +8890 -0
  229. ctpbee_api/ctp_mini/include/previous/pybind11/attr.h +489 -0
  230. ctpbee_api/ctp_mini/include/previous/pybind11/buffer_info.h +108 -0
  231. ctpbee_api/ctp_mini/include/previous/pybind11/cast.h +2067 -0
  232. ctpbee_api/ctp_mini/include/previous/pybind11/chrono.h +162 -0
  233. ctpbee_api/ctp_mini/include/previous/pybind11/common.h +2 -0
  234. ctpbee_api/ctp_mini/include/previous/pybind11/complex.h +61 -0
  235. ctpbee_api/ctp_mini/include/previous/pybind11/detail/class.h +626 -0
  236. ctpbee_api/ctp_mini/include/previous/pybind11/detail/common.h +803 -0
  237. ctpbee_api/ctp_mini/include/previous/pybind11/detail/descr.h +185 -0
  238. ctpbee_api/ctp_mini/include/previous/pybind11/detail/init.h +335 -0
  239. ctpbee_api/ctp_mini/include/previous/pybind11/detail/internals.h +285 -0
  240. ctpbee_api/ctp_mini/include/previous/pybind11/detail/typeid.h +53 -0
  241. ctpbee_api/ctp_mini/include/previous/pybind11/eigen.h +604 -0
  242. ctpbee_api/ctp_mini/include/previous/pybind11/embed.h +194 -0
  243. ctpbee_api/ctp_mini/include/previous/pybind11/eval.h +117 -0
  244. ctpbee_api/ctp_mini/include/previous/pybind11/functional.h +85 -0
  245. ctpbee_api/ctp_mini/include/previous/pybind11/iostream.h +200 -0
  246. ctpbee_api/ctp_mini/include/previous/pybind11/numpy.h +1601 -0
  247. ctpbee_api/ctp_mini/include/previous/pybind11/operators.h +168 -0
  248. ctpbee_api/ctp_mini/include/previous/pybind11/options.h +65 -0
  249. ctpbee_api/ctp_mini/include/previous/pybind11/pybind11.h +1965 -0
  250. ctpbee_api/ctp_mini/include/previous/pybind11/pytypes.h +1332 -0
  251. ctpbee_api/ctp_mini/include/previous/pybind11/stl.h +376 -0
  252. ctpbee_api/ctp_mini/include/previous/pybind11/stl_bind.h +599 -0
  253. ctpbee_api/ctp_mini/libs/thostmduserapi.lib +0 -0
  254. ctpbee_api/ctp_mini/libs/thosttraderapi.lib +0 -0
  255. ctpbee_api/ctp_mini/libthostmduserapi.so +0 -0
  256. ctpbee_api/ctp_mini/libthosttraderapi.so +0 -0
  257. ctpbee_api/ctp_mini/mini_constant.py +1186 -0
  258. ctpbee_api/ctp_mini/thostmduserapi.dll +0 -0
  259. ctpbee_api/ctp_mini/thosttraderapi.dll +0 -0
  260. ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.h +146 -0
  261. ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.sln +41 -0
  262. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/dllmain.cpp +0 -0
  263. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.cpp +0 -0
  264. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.h +0 -0
  265. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/targetver.h +0 -0
  266. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.cpp +886 -0
  267. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.h +203 -0
  268. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj +183 -0
  269. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.filters +54 -0
  270. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.user +4 -0
  271. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/dllmain.cpp +0 -0
  272. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.cpp +0 -0
  273. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.h +0 -0
  274. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/targetver.h +0 -0
  275. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.cpp +5716 -0
  276. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.h +680 -0
  277. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj +180 -0
  278. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.filters +54 -0
  279. ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.user +4 -0
  280. ctpbee_api/ctp_mini/vnctp_minimd.cp312-win_amd64.pyd +0 -0
  281. ctpbee_api/ctp_mini/vnctp_minitd.cp312-win_amd64.pyd +0 -0
  282. ctpbee_api/ctp_mini/vnctp_minitd.lib +0 -0
  283. ctpbee_api/rohon/RohonBaseV64.dll +0 -0
  284. ctpbee_api/rohon/WinDataCollect.dll +0 -0
  285. ctpbee_api/rohon/__init__.py +3 -0
  286. ctpbee_api/rohon/generator/generate_api_functions.py +348 -0
  287. ctpbee_api/rohon/generator/generate_data_type.py +76 -0
  288. ctpbee_api/rohon/generator/generate_struct.py +84 -0
  289. ctpbee_api/rohon/generator/rohon_constant.py +1242 -0
  290. ctpbee_api/rohon/generator/rohon_md_header_define.h +13 -0
  291. ctpbee_api/rohon/generator/rohon_md_header_function.h +6 -0
  292. ctpbee_api/rohon/generator/rohon_md_header_on.h +26 -0
  293. ctpbee_api/rohon/generator/rohon_md_header_process.h +26 -0
  294. ctpbee_api/rohon/generator/rohon_md_source_function.cpp +40 -0
  295. ctpbee_api/rohon/generator/rohon_md_source_module.cpp +18 -0
  296. ctpbee_api/rohon/generator/rohon_md_source_on.cpp +156 -0
  297. ctpbee_api/rohon/generator/rohon_md_source_process.cpp +271 -0
  298. ctpbee_api/rohon/generator/rohon_md_source_switch.cpp +78 -0
  299. ctpbee_api/rohon/generator/rohon_md_source_task.cpp +211 -0
  300. ctpbee_api/rohon/generator/rohon_struct.py +4958 -0
  301. ctpbee_api/rohon/generator/rohon_td_header_define.h +125 -0
  302. ctpbee_api/rohon/generator/rohon_td_header_function.h +164 -0
  303. ctpbee_api/rohon/generator/rohon_td_header_on.h +250 -0
  304. ctpbee_api/rohon/generator/rohon_td_header_process.h +250 -0
  305. ctpbee_api/rohon/generator/rohon_td_source_function.cpp +1338 -0
  306. ctpbee_api/rohon/generator/rohon_td_source_module.cpp +209 -0
  307. ctpbee_api/rohon/generator/rohon_td_source_on.cpp +1500 -0
  308. ctpbee_api/rohon/generator/rohon_td_source_process.cpp +5125 -0
  309. ctpbee_api/rohon/generator/rohon_td_source_switch.cpp +750 -0
  310. ctpbee_api/rohon/generator/rohon_td_source_task.cpp +2339 -0
  311. ctpbee_api/rohon/generator/rohon_typedef.py +781 -0
  312. ctpbee_api/rohon/include/new/pybind11/attr.h +690 -0
  313. ctpbee_api/rohon/include/new/pybind11/buffer_info.h +208 -0
  314. ctpbee_api/rohon/include/new/pybind11/cast.h +1704 -0
  315. ctpbee_api/rohon/include/new/pybind11/chrono.h +225 -0
  316. ctpbee_api/rohon/include/new/pybind11/common.h +2 -0
  317. ctpbee_api/rohon/include/new/pybind11/complex.h +74 -0
  318. ctpbee_api/rohon/include/new/pybind11/detail/class.h +743 -0
  319. ctpbee_api/rohon/include/new/pybind11/detail/common.h +1255 -0
  320. ctpbee_api/rohon/include/new/pybind11/detail/descr.h +171 -0
  321. ctpbee_api/rohon/include/new/pybind11/detail/init.h +434 -0
  322. ctpbee_api/rohon/include/new/pybind11/detail/internals.h +656 -0
  323. ctpbee_api/rohon/include/new/pybind11/detail/type_caster_base.h +1177 -0
  324. ctpbee_api/rohon/include/new/pybind11/detail/typeid.h +65 -0
  325. ctpbee_api/rohon/include/new/pybind11/eigen/common.h +9 -0
  326. ctpbee_api/rohon/include/new/pybind11/eigen/matrix.h +714 -0
  327. ctpbee_api/rohon/include/new/pybind11/eigen/tensor.h +516 -0
  328. ctpbee_api/rohon/include/new/pybind11/eigen.h +12 -0
  329. ctpbee_api/rohon/include/new/pybind11/embed.h +316 -0
  330. ctpbee_api/rohon/include/new/pybind11/eval.h +156 -0
  331. ctpbee_api/rohon/include/new/pybind11/functional.h +137 -0
  332. ctpbee_api/rohon/include/new/pybind11/gil.h +239 -0
  333. ctpbee_api/rohon/include/new/pybind11/iostream.h +265 -0
  334. ctpbee_api/rohon/include/new/pybind11/numpy.h +1998 -0
  335. ctpbee_api/rohon/include/new/pybind11/operators.h +202 -0
  336. ctpbee_api/rohon/include/new/pybind11/options.h +92 -0
  337. ctpbee_api/rohon/include/new/pybind11/pybind11.h +2890 -0
  338. ctpbee_api/rohon/include/new/pybind11/pytypes.h +2557 -0
  339. ctpbee_api/rohon/include/new/pybind11/stl/filesystem.h +116 -0
  340. ctpbee_api/rohon/include/new/pybind11/stl.h +447 -0
  341. ctpbee_api/rohon/include/new/pybind11/stl_bind.h +851 -0
  342. ctpbee_api/rohon/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
  343. ctpbee_api/rohon/include/new/rohon/ThostFtdcMdApi.h +168 -0
  344. ctpbee_api/rohon/include/new/rohon/ThostFtdcTraderApi.h +739 -0
  345. ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiDataType.h +6708 -0
  346. ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiStruct.h +9580 -0
  347. ctpbee_api/rohon/include/previous/pybind11/attr.h +489 -0
  348. ctpbee_api/rohon/include/previous/pybind11/buffer_info.h +108 -0
  349. ctpbee_api/rohon/include/previous/pybind11/cast.h +2067 -0
  350. ctpbee_api/rohon/include/previous/pybind11/chrono.h +162 -0
  351. ctpbee_api/rohon/include/previous/pybind11/common.h +2 -0
  352. ctpbee_api/rohon/include/previous/pybind11/complex.h +61 -0
  353. ctpbee_api/rohon/include/previous/pybind11/detail/class.h +626 -0
  354. ctpbee_api/rohon/include/previous/pybind11/detail/common.h +803 -0
  355. ctpbee_api/rohon/include/previous/pybind11/detail/descr.h +185 -0
  356. ctpbee_api/rohon/include/previous/pybind11/detail/init.h +335 -0
  357. ctpbee_api/rohon/include/previous/pybind11/detail/internals.h +285 -0
  358. ctpbee_api/rohon/include/previous/pybind11/detail/typeid.h +53 -0
  359. ctpbee_api/rohon/include/previous/pybind11/eigen.h +604 -0
  360. ctpbee_api/rohon/include/previous/pybind11/embed.h +194 -0
  361. ctpbee_api/rohon/include/previous/pybind11/eval.h +117 -0
  362. ctpbee_api/rohon/include/previous/pybind11/functional.h +85 -0
  363. ctpbee_api/rohon/include/previous/pybind11/iostream.h +200 -0
  364. ctpbee_api/rohon/include/previous/pybind11/numpy.h +1601 -0
  365. ctpbee_api/rohon/include/previous/pybind11/operators.h +168 -0
  366. ctpbee_api/rohon/include/previous/pybind11/options.h +65 -0
  367. ctpbee_api/rohon/include/previous/pybind11/pybind11.h +1965 -0
  368. ctpbee_api/rohon/include/previous/pybind11/pytypes.h +1332 -0
  369. ctpbee_api/rohon/include/previous/pybind11/stl.h +376 -0
  370. ctpbee_api/rohon/include/previous/pybind11/stl_bind.h +599 -0
  371. ctpbee_api/rohon/include/previous/rohon/ThostFtdcMdApi.h +168 -0
  372. ctpbee_api/rohon/include/previous/rohon/ThostFtdcTraderApi.h +739 -0
  373. ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiDataType.h +6708 -0
  374. ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiStruct.h +9580 -0
  375. ctpbee_api/rohon/libLinuxDataCollect.so +0 -0
  376. ctpbee_api/rohon/librohonbase.so +0 -0
  377. ctpbee_api/rohon/librohonbase.so.1.1 +0 -0
  378. ctpbee_api/rohon/librohonbase.so.1.1.0.1 +0 -0
  379. ctpbee_api/rohon/libs/thostmduserapi_se.lib +0 -0
  380. ctpbee_api/rohon/libs/thosttraderapi_se.lib +0 -0
  381. ctpbee_api/rohon/libthostmduserapi_se.so +0 -0
  382. ctpbee_api/rohon/libthosttraderapi_se.so +0 -0
  383. ctpbee_api/rohon/rohon_constant.py +1242 -0
  384. ctpbee_api/rohon/thostmduserapi_se.dll +0 -0
  385. ctpbee_api/rohon/thosttraderapi_se.dll +0 -0
  386. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/.suo +0 -0
  387. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Browse.VC.db +0 -0
  388. ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Solution.VC.db +0 -0
  389. ctpbee_api/rohon/vnrohon/vnrohon.h +147 -0
  390. ctpbee_api/rohon/vnrohon/vnrohon.sln +41 -0
  391. ctpbee_api/rohon/vnrohon/vnrohonmd/dllmain.cpp +19 -0
  392. ctpbee_api/rohon/vnrohon/vnrohonmd/framework.h +5 -0
  393. ctpbee_api/rohon/vnrohon/vnrohonmd/pch.cpp +5 -0
  394. ctpbee_api/rohon/vnrohon/vnrohonmd/pch.h +13 -0
  395. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.cpp +931 -0
  396. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.h +207 -0
  397. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj +188 -0
  398. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.filters +54 -0
  399. ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.user +4 -0
  400. ctpbee_api/rohon/vnrohon/vnrohontd/dllmain.cpp +19 -0
  401. ctpbee_api/rohon/vnrohon/vnrohontd/framework.h +5 -0
  402. ctpbee_api/rohon/vnrohon/vnrohontd/pch.cpp +5 -0
  403. ctpbee_api/rohon/vnrohon/vnrohontd/pch.h +13 -0
  404. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.cpp +11395 -0
  405. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.h +1259 -0
  406. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj +188 -0
  407. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.filters +54 -0
  408. ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.user +4 -0
  409. ctpbee_api/rohon/vnrohonmd.cp312-win_amd64.pyd +0 -0
  410. ctpbee_api/rohon/vnrohontd.cp312-win_amd64.pyd +0 -0
  411. ctpbee_opt_api-0.1.0.dist-info/METADATA +46 -0
  412. ctpbee_opt_api-0.1.0.dist-info/RECORD +414 -0
  413. ctpbee_opt_api-0.1.0.dist-info/WHEEL +5 -0
  414. ctpbee_opt_api-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,714 @@
1
+ /*
2
+ pybind11/eigen/matrix.h: Transparent conversion for dense and sparse Eigen matrices
3
+
4
+ Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
5
+
6
+ All rights reserved. Use of this source code is governed by a
7
+ BSD-style license that can be found in the LICENSE file.
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include "../numpy.h"
13
+ #include "common.h"
14
+
15
+ /* HINT: To suppress warnings originating from the Eigen headers, use -isystem.
16
+ See also:
17
+ https://stackoverflow.com/questions/2579576/i-dir-vs-isystem-dir
18
+ https://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler
19
+ */
20
+ PYBIND11_WARNING_PUSH
21
+ PYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
22
+ // C5054: operator '&': deprecated between enumerations of different types
23
+ #if defined(__MINGW32__)
24
+ PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")
25
+ #endif
26
+
27
+ #include <Eigen/Core>
28
+ #include <Eigen/SparseCore>
29
+
30
+ PYBIND11_WARNING_POP
31
+
32
+ // Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some classes get implicit
33
+ // move constructors that break things. We could detect this an explicitly copy, but an extra copy
34
+ // of matrices seems highly undesirable.
35
+ static_assert(EIGEN_VERSION_AT_LEAST(3, 2, 7),
36
+ "Eigen matrix support in pybind11 requires Eigen >= 3.2.7");
37
+
38
+ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
39
+
40
+ PYBIND11_WARNING_DISABLE_MSVC(4127)
41
+
42
+ // Provide a convenience alias for easier pass-by-ref usage with fully dynamic strides:
43
+ using EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>;
44
+ template <typename MatrixType>
45
+ using EigenDRef = Eigen::Ref<MatrixType, 0, EigenDStride>;
46
+ template <typename MatrixType>
47
+ using EigenDMap = Eigen::Map<MatrixType, 0, EigenDStride>;
48
+
49
+ PYBIND11_NAMESPACE_BEGIN(detail)
50
+
51
+ #if EIGEN_VERSION_AT_LEAST(3, 3, 0)
52
+ using EigenIndex = Eigen::Index;
53
+ template <typename Scalar, int Flags, typename StorageIndex>
54
+ using EigenMapSparseMatrix = Eigen::Map<Eigen::SparseMatrix<Scalar, Flags, StorageIndex>>;
55
+ #else
56
+ using EigenIndex = EIGEN_DEFAULT_DENSE_INDEX_TYPE;
57
+ template <typename Scalar, int Flags, typename StorageIndex>
58
+ using EigenMapSparseMatrix = Eigen::MappedSparseMatrix<Scalar, Flags, StorageIndex>;
59
+ #endif
60
+
61
+ // Matches Eigen::Map, Eigen::Ref, blocks, etc:
62
+ template <typename T>
63
+ using is_eigen_dense_map = all_of<is_template_base_of<Eigen::DenseBase, T>,
64
+ std::is_base_of<Eigen::MapBase<T, Eigen::ReadOnlyAccessors>, T>>;
65
+ template <typename T>
66
+ using is_eigen_mutable_map = std::is_base_of<Eigen::MapBase<T, Eigen::WriteAccessors>, T>;
67
+ template <typename T>
68
+ using is_eigen_dense_plain
69
+ = all_of<negation<is_eigen_dense_map<T>>, is_template_base_of<Eigen::PlainObjectBase, T>>;
70
+ template <typename T>
71
+ using is_eigen_sparse = is_template_base_of<Eigen::SparseMatrixBase, T>;
72
+ // Test for objects inheriting from EigenBase<Derived> that aren't captured by the above. This
73
+ // basically covers anything that can be assigned to a dense matrix but that don't have a typical
74
+ // matrix data layout that can be copied from their .data(). For example, DiagonalMatrix and
75
+ // SelfAdjointView fall into this category.
76
+ template <typename T>
77
+ using is_eigen_other
78
+ = all_of<is_template_base_of<Eigen::EigenBase, T>,
79
+ negation<any_of<is_eigen_dense_map<T>, is_eigen_dense_plain<T>, is_eigen_sparse<T>>>>;
80
+
81
+ // Captures numpy/eigen conformability status (returned by EigenProps::conformable()):
82
+ template <bool EigenRowMajor>
83
+ struct EigenConformable {
84
+ bool conformable = false;
85
+ EigenIndex rows = 0, cols = 0;
86
+ EigenDStride stride{0, 0}; // Only valid if negativestrides is false!
87
+ bool negativestrides = false; // If true, do not use stride!
88
+
89
+ // NOLINTNEXTLINE(google-explicit-constructor)
90
+ EigenConformable(bool fits = false) : conformable{fits} {}
91
+ // Matrix type:
92
+ EigenConformable(EigenIndex r, EigenIndex c, EigenIndex rstride, EigenIndex cstride)
93
+ : conformable{true}, rows{r}, cols{c},
94
+ // TODO: when Eigen bug #747 is fixed, remove the tests for non-negativity.
95
+ // http://eigen.tuxfamily.org/bz/show_bug.cgi?id=747
96
+ stride{EigenRowMajor ? (rstride > 0 ? rstride : 0)
97
+ : (cstride > 0 ? cstride : 0) /* outer stride */,
98
+ EigenRowMajor ? (cstride > 0 ? cstride : 0)
99
+ : (rstride > 0 ? rstride : 0) /* inner stride */},
100
+ negativestrides{rstride < 0 || cstride < 0} {}
101
+ // Vector type:
102
+ EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride)
103
+ : EigenConformable(r, c, r == 1 ? c * stride : stride, c == 1 ? r : r * stride) {}
104
+
105
+ template <typename props>
106
+ bool stride_compatible() const {
107
+ // To have compatible strides, we need (on both dimensions) one of fully dynamic strides,
108
+ // matching strides, or a dimension size of 1 (in which case the stride value is
109
+ // irrelevant). Alternatively, if any dimension size is 0, the strides are not relevant
110
+ // (and numpy ≥ 1.23 sets the strides to 0 in that case, so we need to check explicitly).
111
+ if (negativestrides) {
112
+ return false;
113
+ }
114
+ if (rows == 0 || cols == 0) {
115
+ return true;
116
+ }
117
+ return (props::inner_stride == Eigen::Dynamic || props::inner_stride == stride.inner()
118
+ || (EigenRowMajor ? cols : rows) == 1)
119
+ && (props::outer_stride == Eigen::Dynamic || props::outer_stride == stride.outer()
120
+ || (EigenRowMajor ? rows : cols) == 1);
121
+ }
122
+ // NOLINTNEXTLINE(google-explicit-constructor)
123
+ operator bool() const { return conformable; }
124
+ };
125
+
126
+ template <typename Type>
127
+ struct eigen_extract_stride {
128
+ using type = Type;
129
+ };
130
+ template <typename PlainObjectType, int MapOptions, typename StrideType>
131
+ struct eigen_extract_stride<Eigen::Map<PlainObjectType, MapOptions, StrideType>> {
132
+ using type = StrideType;
133
+ };
134
+ template <typename PlainObjectType, int Options, typename StrideType>
135
+ struct eigen_extract_stride<Eigen::Ref<PlainObjectType, Options, StrideType>> {
136
+ using type = StrideType;
137
+ };
138
+
139
+ // Helper struct for extracting information from an Eigen type
140
+ template <typename Type_>
141
+ struct EigenProps {
142
+ using Type = Type_;
143
+ using Scalar = typename Type::Scalar;
144
+ using StrideType = typename eigen_extract_stride<Type>::type;
145
+ static constexpr EigenIndex rows = Type::RowsAtCompileTime, cols = Type::ColsAtCompileTime,
146
+ size = Type::SizeAtCompileTime;
147
+ static constexpr bool row_major = Type::IsRowMajor,
148
+ vector
149
+ = Type::IsVectorAtCompileTime, // At least one dimension has fixed size 1
150
+ fixed_rows = rows != Eigen::Dynamic, fixed_cols = cols != Eigen::Dynamic,
151
+ fixed = size != Eigen::Dynamic, // Fully-fixed size
152
+ dynamic = !fixed_rows && !fixed_cols; // Fully-dynamic size
153
+
154
+ template <EigenIndex i, EigenIndex ifzero>
155
+ using if_zero = std::integral_constant<EigenIndex, i == 0 ? ifzero : i>;
156
+ static constexpr EigenIndex inner_stride
157
+ = if_zero<StrideType::InnerStrideAtCompileTime, 1>::value,
158
+ outer_stride = if_zero < StrideType::OuterStrideAtCompileTime,
159
+ vector ? size
160
+ : row_major ? cols
161
+ : rows > ::value;
162
+ static constexpr bool dynamic_stride
163
+ = inner_stride == Eigen::Dynamic && outer_stride == Eigen::Dynamic;
164
+ static constexpr bool requires_row_major
165
+ = !dynamic_stride && !vector && (row_major ? inner_stride : outer_stride) == 1;
166
+ static constexpr bool requires_col_major
167
+ = !dynamic_stride && !vector && (row_major ? outer_stride : inner_stride) == 1;
168
+
169
+ // Takes an input array and determines whether we can make it fit into the Eigen type. If
170
+ // the array is a vector, we attempt to fit it into either an Eigen 1xN or Nx1 vector
171
+ // (preferring the latter if it will fit in either, i.e. for a fully dynamic matrix type).
172
+ static EigenConformable<row_major> conformable(const array &a) {
173
+ const auto dims = a.ndim();
174
+ if (dims < 1 || dims > 2) {
175
+ return false;
176
+ }
177
+
178
+ if (dims == 2) { // Matrix type: require exact match (or dynamic)
179
+
180
+ EigenIndex np_rows = a.shape(0), np_cols = a.shape(1),
181
+ np_rstride = a.strides(0) / static_cast<ssize_t>(sizeof(Scalar)),
182
+ np_cstride = a.strides(1) / static_cast<ssize_t>(sizeof(Scalar));
183
+ if ((fixed_rows && np_rows != rows) || (fixed_cols && np_cols != cols)) {
184
+ return false;
185
+ }
186
+
187
+ return {np_rows, np_cols, np_rstride, np_cstride};
188
+ }
189
+
190
+ // Otherwise we're storing an n-vector. Only one of the strides will be used, but
191
+ // whichever is used, we want the (single) numpy stride value.
192
+ const EigenIndex n = a.shape(0),
193
+ stride = a.strides(0) / static_cast<ssize_t>(sizeof(Scalar));
194
+
195
+ if (vector) { // Eigen type is a compile-time vector
196
+ if (fixed && size != n) {
197
+ return false; // Vector size mismatch
198
+ }
199
+ return {rows == 1 ? 1 : n, cols == 1 ? 1 : n, stride};
200
+ }
201
+ if (fixed) {
202
+ // The type has a fixed size, but is not a vector: abort
203
+ return false;
204
+ }
205
+ if (fixed_cols) {
206
+ // Since this isn't a vector, cols must be != 1. We allow this only if it exactly
207
+ // equals the number of elements (rows is Dynamic, and so 1 row is allowed).
208
+ if (cols != n) {
209
+ return false;
210
+ }
211
+ return {1, n, stride};
212
+ } // Otherwise it's either fully dynamic, or column dynamic; both become a column vector
213
+ if (fixed_rows && rows != n) {
214
+ return false;
215
+ }
216
+ return {n, 1, stride};
217
+ }
218
+
219
+ static constexpr bool show_writeable
220
+ = is_eigen_dense_map<Type>::value && is_eigen_mutable_map<Type>::value;
221
+ static constexpr bool show_order = is_eigen_dense_map<Type>::value;
222
+ static constexpr bool show_c_contiguous = show_order && requires_row_major;
223
+ static constexpr bool show_f_contiguous
224
+ = !show_c_contiguous && show_order && requires_col_major;
225
+
226
+ static constexpr auto descriptor
227
+ = const_name("numpy.ndarray[") + npy_format_descriptor<Scalar>::name + const_name("[")
228
+ + const_name<fixed_rows>(const_name<(size_t) rows>(), const_name("m")) + const_name(", ")
229
+ + const_name<fixed_cols>(const_name<(size_t) cols>(), const_name("n")) + const_name("]")
230
+ +
231
+ // For a reference type (e.g. Ref<MatrixXd>) we have other constraints that might need to
232
+ // be satisfied: writeable=True (for a mutable reference), and, depending on the map's
233
+ // stride options, possibly f_contiguous or c_contiguous. We include them in the
234
+ // descriptor output to provide some hint as to why a TypeError is occurring (otherwise
235
+ // it can be confusing to see that a function accepts a 'numpy.ndarray[float64[3,2]]' and
236
+ // an error message that you *gave* a numpy.ndarray of the right type and dimensions.
237
+ const_name<show_writeable>(", flags.writeable", "")
238
+ + const_name<show_c_contiguous>(", flags.c_contiguous", "")
239
+ + const_name<show_f_contiguous>(", flags.f_contiguous", "") + const_name("]");
240
+ };
241
+
242
+ // Casts an Eigen type to numpy array. If given a base, the numpy array references the src data,
243
+ // otherwise it'll make a copy. writeable lets you turn off the writeable flag for the array.
244
+ template <typename props>
245
+ handle
246
+ eigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true) {
247
+ constexpr ssize_t elem_size = sizeof(typename props::Scalar);
248
+ array a;
249
+ if (props::vector) {
250
+ a = array({src.size()}, {elem_size * src.innerStride()}, src.data(), base);
251
+ } else {
252
+ a = array({src.rows(), src.cols()},
253
+ {elem_size * src.rowStride(), elem_size * src.colStride()},
254
+ src.data(),
255
+ base);
256
+ }
257
+
258
+ if (!writeable) {
259
+ array_proxy(a.ptr())->flags &= ~detail::npy_api::NPY_ARRAY_WRITEABLE_;
260
+ }
261
+
262
+ return a.release();
263
+ }
264
+
265
+ // Takes an lvalue ref to some Eigen type and a (python) base object, creating a numpy array that
266
+ // reference the Eigen object's data with `base` as the python-registered base class (if omitted,
267
+ // the base will be set to None, and lifetime management is up to the caller). The numpy array is
268
+ // non-writeable if the given type is const.
269
+ template <typename props, typename Type>
270
+ handle eigen_ref_array(Type &src, handle parent = none()) {
271
+ // none here is to get past array's should-we-copy detection, which currently always
272
+ // copies when there is no base. Setting the base to None should be harmless.
273
+ return eigen_array_cast<props>(src, parent, !std::is_const<Type>::value);
274
+ }
275
+
276
+ // Takes a pointer to some dense, plain Eigen type, builds a capsule around it, then returns a
277
+ // numpy array that references the encapsulated data with a python-side reference to the capsule to
278
+ // tie its destruction to that of any dependent python objects. Const-ness is determined by
279
+ // whether or not the Type of the pointer given is const.
280
+ template <typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
281
+ handle eigen_encapsulate(Type *src) {
282
+ capsule base(src, [](void *o) { delete static_cast<Type *>(o); });
283
+ return eigen_ref_array<props>(*src, base);
284
+ }
285
+
286
+ // Type caster for regular, dense matrix types (e.g. MatrixXd), but not maps/refs/etc. of dense
287
+ // types.
288
+ template <typename Type>
289
+ struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {
290
+ using Scalar = typename Type::Scalar;
291
+ static_assert(!std::is_pointer<Scalar>::value,
292
+ PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED);
293
+ using props = EigenProps<Type>;
294
+
295
+ bool load(handle src, bool convert) {
296
+ // If we're in no-convert mode, only load if given an array of the correct type
297
+ if (!convert && !isinstance<array_t<Scalar>>(src)) {
298
+ return false;
299
+ }
300
+
301
+ // Coerce into an array, but don't do type conversion yet; the copy below handles it.
302
+ auto buf = array::ensure(src);
303
+
304
+ if (!buf) {
305
+ return false;
306
+ }
307
+
308
+ auto dims = buf.ndim();
309
+ if (dims < 1 || dims > 2) {
310
+ return false;
311
+ }
312
+
313
+ auto fits = props::conformable(buf);
314
+ if (!fits) {
315
+ return false;
316
+ }
317
+
318
+ // Allocate the new type, then build a numpy reference into it
319
+ value = Type(fits.rows, fits.cols);
320
+ auto ref = reinterpret_steal<array>(eigen_ref_array<props>(value));
321
+ if (dims == 1) {
322
+ ref = ref.squeeze();
323
+ } else if (ref.ndim() == 1) {
324
+ buf = buf.squeeze();
325
+ }
326
+
327
+ int result = detail::npy_api::get().PyArray_CopyInto_(ref.ptr(), buf.ptr());
328
+
329
+ if (result < 0) { // Copy failed!
330
+ PyErr_Clear();
331
+ return false;
332
+ }
333
+
334
+ return true;
335
+ }
336
+
337
+ private:
338
+ // Cast implementation
339
+ template <typename CType>
340
+ static handle cast_impl(CType *src, return_value_policy policy, handle parent) {
341
+ switch (policy) {
342
+ case return_value_policy::take_ownership:
343
+ case return_value_policy::automatic:
344
+ return eigen_encapsulate<props>(src);
345
+ case return_value_policy::move:
346
+ return eigen_encapsulate<props>(new CType(std::move(*src)));
347
+ case return_value_policy::copy:
348
+ return eigen_array_cast<props>(*src);
349
+ case return_value_policy::reference:
350
+ case return_value_policy::automatic_reference:
351
+ return eigen_ref_array<props>(*src);
352
+ case return_value_policy::reference_internal:
353
+ return eigen_ref_array<props>(*src, parent);
354
+ default:
355
+ throw cast_error("unhandled return_value_policy: should not happen!");
356
+ };
357
+ }
358
+
359
+ public:
360
+ // Normal returned non-reference, non-const value:
361
+ static handle cast(Type &&src, return_value_policy /* policy */, handle parent) {
362
+ return cast_impl(&src, return_value_policy::move, parent);
363
+ }
364
+ // If you return a non-reference const, we mark the numpy array readonly:
365
+ static handle cast(const Type &&src, return_value_policy /* policy */, handle parent) {
366
+ return cast_impl(&src, return_value_policy::move, parent);
367
+ }
368
+ // lvalue reference return; default (automatic) becomes copy
369
+ static handle cast(Type &src, return_value_policy policy, handle parent) {
370
+ if (policy == return_value_policy::automatic
371
+ || policy == return_value_policy::automatic_reference) {
372
+ policy = return_value_policy::copy;
373
+ }
374
+ return cast_impl(&src, policy, parent);
375
+ }
376
+ // const lvalue reference return; default (automatic) becomes copy
377
+ static handle cast(const Type &src, return_value_policy policy, handle parent) {
378
+ if (policy == return_value_policy::automatic
379
+ || policy == return_value_policy::automatic_reference) {
380
+ policy = return_value_policy::copy;
381
+ }
382
+ return cast(&src, policy, parent);
383
+ }
384
+ // non-const pointer return
385
+ static handle cast(Type *src, return_value_policy policy, handle parent) {
386
+ return cast_impl(src, policy, parent);
387
+ }
388
+ // const pointer return
389
+ static handle cast(const Type *src, return_value_policy policy, handle parent) {
390
+ return cast_impl(src, policy, parent);
391
+ }
392
+
393
+ static constexpr auto name = props::descriptor;
394
+
395
+ // NOLINTNEXTLINE(google-explicit-constructor)
396
+ operator Type *() { return &value; }
397
+ // NOLINTNEXTLINE(google-explicit-constructor)
398
+ operator Type &() { return value; }
399
+ // NOLINTNEXTLINE(google-explicit-constructor)
400
+ operator Type &&() && { return std::move(value); }
401
+ template <typename T>
402
+ using cast_op_type = movable_cast_op_type<T>;
403
+
404
+ private:
405
+ Type value;
406
+ };
407
+
408
+ // Base class for casting reference/map/block/etc. objects back to python.
409
+ template <typename MapType>
410
+ struct eigen_map_caster {
411
+ static_assert(!std::is_pointer<typename MapType::Scalar>::value,
412
+ PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED);
413
+
414
+ private:
415
+ using props = EigenProps<MapType>;
416
+
417
+ public:
418
+ // Directly referencing a ref/map's data is a bit dangerous (whatever the map/ref points to has
419
+ // to stay around), but we'll allow it under the assumption that you know what you're doing
420
+ // (and have an appropriate keep_alive in place). We return a numpy array pointing directly at
421
+ // the ref's data (The numpy array ends up read-only if the ref was to a const matrix type.)
422
+ // Note that this means you need to ensure you don't destroy the object in some other way (e.g.
423
+ // with an appropriate keep_alive, or with a reference to a statically allocated matrix).
424
+ static handle cast(const MapType &src, return_value_policy policy, handle parent) {
425
+ switch (policy) {
426
+ case return_value_policy::copy:
427
+ return eigen_array_cast<props>(src);
428
+ case return_value_policy::reference_internal:
429
+ return eigen_array_cast<props>(src, parent, is_eigen_mutable_map<MapType>::value);
430
+ case return_value_policy::reference:
431
+ case return_value_policy::automatic:
432
+ case return_value_policy::automatic_reference:
433
+ return eigen_array_cast<props>(src, none(), is_eigen_mutable_map<MapType>::value);
434
+ default:
435
+ // move, take_ownership don't make any sense for a ref/map:
436
+ pybind11_fail("Invalid return_value_policy for Eigen Map/Ref/Block type");
437
+ }
438
+ }
439
+
440
+ static constexpr auto name = props::descriptor;
441
+
442
+ // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return
443
+ // types but not bound arguments). We still provide them (with an explicitly delete) so that
444
+ // you end up here if you try anyway.
445
+ bool load(handle, bool) = delete;
446
+ operator MapType() = delete;
447
+ template <typename>
448
+ using cast_op_type = MapType;
449
+ };
450
+
451
+ // We can return any map-like object (but can only load Refs, specialized next):
452
+ template <typename Type>
453
+ struct type_caster<Type, enable_if_t<is_eigen_dense_map<Type>::value>> : eigen_map_caster<Type> {};
454
+
455
+ // Loader for Ref<...> arguments. See the documentation for info on how to make this work without
456
+ // copying (it requires some extra effort in many cases).
457
+ template <typename PlainObjectType, typename StrideType>
458
+ struct type_caster<
459
+ Eigen::Ref<PlainObjectType, 0, StrideType>,
460
+ enable_if_t<is_eigen_dense_map<Eigen::Ref<PlainObjectType, 0, StrideType>>::value>>
461
+ : public eigen_map_caster<Eigen::Ref<PlainObjectType, 0, StrideType>> {
462
+ private:
463
+ using Type = Eigen::Ref<PlainObjectType, 0, StrideType>;
464
+ using props = EigenProps<Type>;
465
+ using Scalar = typename props::Scalar;
466
+ static_assert(!std::is_pointer<Scalar>::value,
467
+ PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED);
468
+ using MapType = Eigen::Map<PlainObjectType, 0, StrideType>;
469
+ using Array
470
+ = array_t<Scalar,
471
+ array::forcecast
472
+ | ((props::row_major ? props::inner_stride : props::outer_stride) == 1
473
+ ? array::c_style
474
+ : (props::row_major ? props::outer_stride : props::inner_stride) == 1
475
+ ? array::f_style
476
+ : 0)>;
477
+ static constexpr bool need_writeable = is_eigen_mutable_map<Type>::value;
478
+ // Delay construction (these have no default constructor)
479
+ std::unique_ptr<MapType> map;
480
+ std::unique_ptr<Type> ref;
481
+ // Our array. When possible, this is just a numpy array pointing to the source data, but
482
+ // sometimes we can't avoid copying (e.g. input is not a numpy array at all, has an
483
+ // incompatible layout, or is an array of a type that needs to be converted). Using a numpy
484
+ // temporary (rather than an Eigen temporary) saves an extra copy when we need both type
485
+ // conversion and storage order conversion. (Note that we refuse to use this temporary copy
486
+ // when loading an argument for a Ref<M> with M non-const, i.e. a read-write reference).
487
+ Array copy_or_ref;
488
+
489
+ public:
490
+ bool load(handle src, bool convert) {
491
+ // First check whether what we have is already an array of the right type. If not, we
492
+ // can't avoid a copy (because the copy is also going to do type conversion).
493
+ bool need_copy = !isinstance<Array>(src);
494
+
495
+ EigenConformable<props::row_major> fits;
496
+ if (!need_copy) {
497
+ // We don't need a converting copy, but we also need to check whether the strides are
498
+ // compatible with the Ref's stride requirements
499
+ auto aref = reinterpret_borrow<Array>(src);
500
+
501
+ if (aref && (!need_writeable || aref.writeable())) {
502
+ fits = props::conformable(aref);
503
+ if (!fits) {
504
+ return false; // Incompatible dimensions
505
+ }
506
+ if (!fits.template stride_compatible<props>()) {
507
+ need_copy = true;
508
+ } else {
509
+ copy_or_ref = std::move(aref);
510
+ }
511
+ } else {
512
+ need_copy = true;
513
+ }
514
+ }
515
+
516
+ if (need_copy) {
517
+ // We need to copy: If we need a mutable reference, or we're not supposed to convert
518
+ // (either because we're in the no-convert overload pass, or because we're explicitly
519
+ // instructed not to copy (via `py::arg().noconvert()`) we have to fail loading.
520
+ if (!convert || need_writeable) {
521
+ return false;
522
+ }
523
+
524
+ Array copy = Array::ensure(src);
525
+ if (!copy) {
526
+ return false;
527
+ }
528
+ fits = props::conformable(copy);
529
+ if (!fits || !fits.template stride_compatible<props>()) {
530
+ return false;
531
+ }
532
+ copy_or_ref = std::move(copy);
533
+ loader_life_support::add_patient(copy_or_ref);
534
+ }
535
+
536
+ ref.reset();
537
+ map.reset(new MapType(data(copy_or_ref),
538
+ fits.rows,
539
+ fits.cols,
540
+ make_stride(fits.stride.outer(), fits.stride.inner())));
541
+ ref.reset(new Type(*map));
542
+
543
+ return true;
544
+ }
545
+
546
+ // NOLINTNEXTLINE(google-explicit-constructor)
547
+ operator Type *() { return ref.get(); }
548
+ // NOLINTNEXTLINE(google-explicit-constructor)
549
+ operator Type &() { return *ref; }
550
+ template <typename _T>
551
+ using cast_op_type = pybind11::detail::cast_op_type<_T>;
552
+
553
+ private:
554
+ template <typename T = Type, enable_if_t<is_eigen_mutable_map<T>::value, int> = 0>
555
+ Scalar *data(Array &a) {
556
+ return a.mutable_data();
557
+ }
558
+
559
+ template <typename T = Type, enable_if_t<!is_eigen_mutable_map<T>::value, int> = 0>
560
+ const Scalar *data(Array &a) {
561
+ return a.data();
562
+ }
563
+
564
+ // Attempt to figure out a constructor of `Stride` that will work.
565
+ // If both strides are fixed, use a default constructor:
566
+ template <typename S>
567
+ using stride_ctor_default = bool_constant<S::InnerStrideAtCompileTime != Eigen::Dynamic
568
+ && S::OuterStrideAtCompileTime != Eigen::Dynamic
569
+ && std::is_default_constructible<S>::value>;
570
+ // Otherwise, if there is a two-index constructor, assume it is (outer,inner) like
571
+ // Eigen::Stride, and use it:
572
+ template <typename S>
573
+ using stride_ctor_dual
574
+ = bool_constant<!stride_ctor_default<S>::value
575
+ && std::is_constructible<S, EigenIndex, EigenIndex>::value>;
576
+ // Otherwise, if there is a one-index constructor, and just one of the strides is dynamic, use
577
+ // it (passing whichever stride is dynamic).
578
+ template <typename S>
579
+ using stride_ctor_outer
580
+ = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value
581
+ && S::OuterStrideAtCompileTime == Eigen::Dynamic
582
+ && S::InnerStrideAtCompileTime != Eigen::Dynamic
583
+ && std::is_constructible<S, EigenIndex>::value>;
584
+ template <typename S>
585
+ using stride_ctor_inner
586
+ = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value
587
+ && S::InnerStrideAtCompileTime == Eigen::Dynamic
588
+ && S::OuterStrideAtCompileTime != Eigen::Dynamic
589
+ && std::is_constructible<S, EigenIndex>::value>;
590
+
591
+ template <typename S = StrideType, enable_if_t<stride_ctor_default<S>::value, int> = 0>
592
+ static S make_stride(EigenIndex, EigenIndex) {
593
+ return S();
594
+ }
595
+ template <typename S = StrideType, enable_if_t<stride_ctor_dual<S>::value, int> = 0>
596
+ static S make_stride(EigenIndex outer, EigenIndex inner) {
597
+ return S(outer, inner);
598
+ }
599
+ template <typename S = StrideType, enable_if_t<stride_ctor_outer<S>::value, int> = 0>
600
+ static S make_stride(EigenIndex outer, EigenIndex) {
601
+ return S(outer);
602
+ }
603
+ template <typename S = StrideType, enable_if_t<stride_ctor_inner<S>::value, int> = 0>
604
+ static S make_stride(EigenIndex, EigenIndex inner) {
605
+ return S(inner);
606
+ }
607
+ };
608
+
609
+ // type_caster for special matrix types (e.g. DiagonalMatrix), which are EigenBase, but not
610
+ // EigenDense (i.e. they don't have a data(), at least not with the usual matrix layout).
611
+ // load() is not supported, but we can cast them into the python domain by first copying to a
612
+ // regular Eigen::Matrix, then casting that.
613
+ template <typename Type>
614
+ struct type_caster<Type, enable_if_t<is_eigen_other<Type>::value>> {
615
+ static_assert(!std::is_pointer<typename Type::Scalar>::value,
616
+ PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED);
617
+
618
+ protected:
619
+ using Matrix
620
+ = Eigen::Matrix<typename Type::Scalar, Type::RowsAtCompileTime, Type::ColsAtCompileTime>;
621
+ using props = EigenProps<Matrix>;
622
+
623
+ public:
624
+ static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {
625
+ handle h = eigen_encapsulate<props>(new Matrix(src));
626
+ return h;
627
+ }
628
+ static handle cast(const Type *src, return_value_policy policy, handle parent) {
629
+ return cast(*src, policy, parent);
630
+ }
631
+
632
+ static constexpr auto name = props::descriptor;
633
+
634
+ // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return
635
+ // types but not bound arguments). We still provide them (with an explicitly delete) so that
636
+ // you end up here if you try anyway.
637
+ bool load(handle, bool) = delete;
638
+ operator Type() = delete;
639
+ template <typename>
640
+ using cast_op_type = Type;
641
+ };
642
+
643
+ template <typename Type>
644
+ struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> {
645
+ using Scalar = typename Type::Scalar;
646
+ static_assert(!std::is_pointer<Scalar>::value,
647
+ PYBIND11_EIGEN_MESSAGE_POINTER_TYPES_ARE_NOT_SUPPORTED);
648
+ using StorageIndex = remove_reference_t<decltype(*std::declval<Type>().outerIndexPtr())>;
649
+ using Index = typename Type::Index;
650
+ static constexpr bool rowMajor = Type::IsRowMajor;
651
+
652
+ bool load(handle src, bool) {
653
+ if (!src) {
654
+ return false;
655
+ }
656
+
657
+ auto obj = reinterpret_borrow<object>(src);
658
+ object sparse_module = module_::import("scipy.sparse");
659
+ object matrix_type = sparse_module.attr(rowMajor ? "csr_matrix" : "csc_matrix");
660
+
661
+ if (!type::handle_of(obj).is(matrix_type)) {
662
+ try {
663
+ obj = matrix_type(obj);
664
+ } catch (const error_already_set &) {
665
+ return false;
666
+ }
667
+ }
668
+
669
+ auto values = array_t<Scalar>((object) obj.attr("data"));
670
+ auto innerIndices = array_t<StorageIndex>((object) obj.attr("indices"));
671
+ auto outerIndices = array_t<StorageIndex>((object) obj.attr("indptr"));
672
+ auto shape = pybind11::tuple((pybind11::object) obj.attr("shape"));
673
+ auto nnz = obj.attr("nnz").cast<Index>();
674
+
675
+ if (!values || !innerIndices || !outerIndices) {
676
+ return false;
677
+ }
678
+
679
+ value = EigenMapSparseMatrix<Scalar,
680
+ Type::Flags &(Eigen::RowMajor | Eigen::ColMajor),
681
+ StorageIndex>(shape[0].cast<Index>(),
682
+ shape[1].cast<Index>(),
683
+ std::move(nnz),
684
+ outerIndices.mutable_data(),
685
+ innerIndices.mutable_data(),
686
+ values.mutable_data());
687
+
688
+ return true;
689
+ }
690
+
691
+ static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {
692
+ const_cast<Type &>(src).makeCompressed();
693
+
694
+ object matrix_type
695
+ = module_::import("scipy.sparse").attr(rowMajor ? "csr_matrix" : "csc_matrix");
696
+
697
+ array data(src.nonZeros(), src.valuePtr());
698
+ array outerIndices((rowMajor ? src.rows() : src.cols()) + 1, src.outerIndexPtr());
699
+ array innerIndices(src.nonZeros(), src.innerIndexPtr());
700
+
701
+ return matrix_type(pybind11::make_tuple(
702
+ std::move(data), std::move(innerIndices), std::move(outerIndices)),
703
+ pybind11::make_tuple(src.rows(), src.cols()))
704
+ .release();
705
+ }
706
+
707
+ PYBIND11_TYPE_CASTER(Type,
708
+ const_name<(Type::IsRowMajor) != 0>("scipy.sparse.csr_matrix[",
709
+ "scipy.sparse.csc_matrix[")
710
+ + npy_format_descriptor<Scalar>::name + const_name("]"));
711
+ };
712
+
713
+ PYBIND11_NAMESPACE_END(detail)
714
+ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)