├── .clang-format ├── .flake8 ├── .gitignore ├── LICENSE ├── README.md ├── generator └── generator.py ├── include └── pyscience11 │ ├── matplotlib.h │ ├── matplotlib │ └── pyplot.h │ ├── numpy.h │ ├── numpy │ ├── dual.h │ ├── fft.h │ ├── linalg.h │ └── random.h │ ├── scipy.h │ └── scipy │ ├── fftpack.h │ ├── integrate.h │ ├── interpolate.h │ ├── io.h │ ├── io │ └── wavfile.h │ ├── linalg.h │ ├── ndimage.h │ ├── optimize.h │ ├── signal.h │ ├── spatial.h │ ├── special.h │ └── stats.h ├── makefile ├── pyscience11 ├── LICENSE ├── __init__.py └── original_license │ ├── MATPLOTLIB_LICENSE │ ├── NUMPY_LICENSE │ └── SCIPY_LICENSE └── setup.py /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: WebKit 2 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | pyscience11.egg-info 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Rue Yokaze 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | pyscience11 is a C++11 wrapper for NumPy, SciPy and Matplotlib, that provides lightspeed access to their functionality. 3 | 4 | ```cpp 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace py = pybind11; 13 | namespace m11 = matplotlib11; 14 | namespace n11 = numpy11; 15 | namespace s11 = scipy11; 16 | 17 | int main(void) 18 | { 19 | py::scoped_interpreter interpreter; 20 | 21 | auto numpy = n11::import_numpy(); 22 | auto scipy_special = s11::scipy::import_special(); 23 | auto x = numpy.linspace(-2, 2, 1001, py::arg("dtype") = numpy.attr("float32")); 24 | auto y = scipy_special.erf(x); 25 | 26 | auto matplotlib = m11::import_matplotlib(); 27 | matplotlib.use("TkAgg"); 28 | 29 | auto pl = m11::matplotlib::import_pyplot(); 30 | pl.plot(x, y); 31 | pl.show(); 32 | 33 | return 0; 34 | } 35 | ``` 36 | 37 | # Install 38 | This library is header-only, therefore nothing needs to be installed. 39 | 40 | Following command could be helpful to place headers into system directory. 41 | ```shell 42 | pip install pyscience11 43 | ``` 44 | 45 | # Requirements 46 | - [pybind11](https://github.com/pybind/pybind11) 47 | 48 | # Contact 49 | If you have any question about the library, feel free to contact me: https://github.com/yokaze 50 | -------------------------------------------------------------------------------- /generator/generator.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pathlib 3 | import textwrap 4 | import types 5 | 6 | import matplotlib 7 | import matplotlib.pyplot 8 | import numpy 9 | import scipy 10 | import scipy.fftpack 11 | import scipy.interpolate 12 | import scipy.io 13 | import scipy.io.wavfile 14 | import scipy.signal 15 | import scipy.special 16 | 17 | 18 | def align_pragma(text): 19 | ret = '' 20 | for line in text.splitlines(): 21 | if (line.strip().startswith('#')): 22 | line = line.strip() 23 | ret += line + '\n' 24 | return ret 25 | 26 | 27 | def generate_copyright(filename, package_name, package_version): 28 | template = '''\ 29 | // 30 | // $FileName$ 31 | // pyscience11 32 | // 33 | // Copyright (C) 2018 Rue Yokaze 34 | // Distributed under the MIT License. 35 | // 36 | // This header is compatible with $PackageName$ $PackageVersion$. 37 | // 38 | ''' 39 | ret = template.replace('$FileName$', filename) 40 | ret = ret.replace('$PackageName$', package_name) 41 | ret = ret.replace('$PackageVersion$', package_version) 42 | return ret 43 | 44 | 45 | def generate_pragma_once(): 46 | return '''\ 47 | #pragma once 48 | ''' 49 | 50 | 51 | def generate_include(include_path): 52 | if (type(include_path) == str): 53 | template = '''\ 54 | #include <$IncludePath$> 55 | ''' 56 | include_text = template.replace('$IncludePath$', include_path) 57 | return include_text 58 | elif (type(include_path) == list): 59 | ret = '' 60 | for s in include_path: 61 | ret += generate_include(s) 62 | 63 | return ret 64 | 65 | 66 | def generate_begin_namespace(namespace_name): 67 | template = '''\ 68 | namespace $Namespace$ { 69 | ''' 70 | ret = '' 71 | names = namespace_name.split('::') 72 | for i, name in zip(range(len(names)), names): 73 | line = template.replace('$Namespace$', name) 74 | line = textwrap.indent(line, ' ' * max(0, i - 1)) 75 | ret += line 76 | 77 | return ret 78 | 79 | 80 | def generate_end_namespace(namespace_name): 81 | ret = '' 82 | names = namespace_name.split('::') 83 | for i, name in reversed(list(zip(range(len(names)), names))): 84 | line = '''\ 85 | } 86 | ''' 87 | line = textwrap.indent(line, ' ' * max(0, i - 1)) 88 | ret += line 89 | return ret 90 | 91 | 92 | def generate_begin_class(class_name, indent=0): 93 | template = '''\ 94 | class $ClassName$_module : public pybind11::module { 95 | public: 96 | using pybind11::module::module; 97 | ''' 98 | ret = template.replace('$ClassName$', class_name) 99 | return textwrap.indent(ret, ' ' * indent) 100 | 101 | 102 | def generate_end_class(class_name, indent=0): 103 | ret = '''\ 104 | }; 105 | ''' 106 | return textwrap.indent(ret, ' ' * indent) 107 | 108 | 109 | def generate_class_function(function_name, indent=0): 110 | def is_cpp_macro_function(function_name): 111 | return (function_name in ['isfinite', 'isinf', 'isnan', 'signbit']) 112 | 113 | if (is_cpp_macro_function(function_name)): 114 | template = ''' 115 | #if !defined($FunctionName$) 116 | template 117 | pybind11::object $FunctionName$(TArgs&&... args) 118 | { 119 | return attr("$FunctionName$")(std::forward(args)...); 120 | } 121 | #endif 122 | 123 | template 124 | pybind11::object call_$FunctionName$(TArgs&&... args) 125 | { 126 | return attr("$FunctionName$")(std::forward(args)...); 127 | } 128 | ''' 129 | else: 130 | template = ''' 131 | template 132 | pybind11::object $FunctionName$(TArgs&&... args) 133 | { 134 | return attr("$FunctionName$")(std::forward(args)...); 135 | } 136 | ''' 137 | ret = template.replace('$FunctionName$', function_name) 138 | return align_pragma(textwrap.indent(ret, ' ' * indent)) 139 | 140 | 141 | def generate_import(full_module_name, indent=0): 142 | template = '''\ 143 | $ModuleName$_module import_$ModuleName$() 144 | { 145 | return pybind11::module::import("$FullModuleName$"); 146 | } 147 | ''' 148 | module_name = full_module_name.split('.')[-1] 149 | ret = template.replace('$ModuleName$', module_name) 150 | ret = ret.replace('$FullModuleName$', full_module_name) 151 | ret = textwrap.indent(ret, ' ' * indent) 152 | return ret 153 | 154 | 155 | def generate_blank_line(): 156 | return ''' 157 | ''' 158 | 159 | 160 | def build_header(target_module, package_name, package_version): 161 | cpp_keywords = ['delete', 'typename'] 162 | full_module_name = target_module.__name__ # 'numpy.random' 163 | module_name_list = full_module_name.split('.') # ['numpy', 'random'] 164 | module_name = module_name_list[-1] # 'random' 165 | root_namespace_name = module_name_list[0] + '11' # 'numpy11' 166 | full_namespace_name = '::'.join([root_namespace_name] + module_name_list[:-1]) # 'numpy11::numpy' 167 | class_indent = 4 * (len(module_name_list) - 1) 168 | member_indent = 4 * len(module_name_list) 169 | 170 | header = generate_copyright('%s.h' % module_name, package_name, package_version) + \ 171 | generate_pragma_once() + \ 172 | generate_include('pybind11/pybind11.h') + \ 173 | generate_blank_line() + \ 174 | generate_begin_namespace(full_namespace_name) + \ 175 | generate_blank_line() + \ 176 | generate_begin_class(module_name, indent=class_indent) 177 | 178 | sorted_keys = [x for x in target_module.__dict__.keys()] 179 | sorted_keys.sort() 180 | 181 | for key in sorted_keys: 182 | value = target_module.__dict__[key] 183 | 184 | if (key in cpp_keywords): 185 | key += '_' 186 | if (isinstance(value, types.BuiltinFunctionType) or 187 | isinstance(value, types.FunctionType) or 188 | isinstance(value, numpy.ufunc)): 189 | header += generate_class_function(key, indent=member_indent) 190 | 191 | header += generate_end_class(module_name, indent=class_indent) + \ 192 | generate_blank_line() + \ 193 | generate_import(full_module_name, indent=class_indent) + \ 194 | generate_end_namespace(full_namespace_name) 195 | 196 | include_path = pathlib.Path('include/pyscience11')/('/'.join(module_name_list) + '.h') 197 | os.makedirs(include_path.parent, exist_ok=True) 198 | fp = open(include_path, 'w') 199 | fp.write(header) 200 | 201 | 202 | build_header(numpy, numpy.__name__, numpy.__version__) 203 | build_header(numpy.dual, numpy.__name__, numpy.__version__) 204 | build_header(numpy.fft, numpy.__name__, numpy.__version__) 205 | build_header(numpy.linalg, numpy.__name__, numpy.__version__) 206 | build_header(numpy.random, numpy.__name__, numpy.__version__) 207 | build_header(scipy, scipy.__name__, scipy.__version__) 208 | build_header(scipy.fftpack, scipy.__name__, scipy.__version__) 209 | build_header(scipy.integrate, scipy.__name__, scipy.__version__) 210 | build_header(scipy.interpolate, scipy.__name__, scipy.__version__) 211 | build_header(scipy.io, scipy.__name__, scipy.__version__) 212 | build_header(scipy.io.wavfile, scipy.__name__, scipy.__version__) 213 | build_header(scipy.linalg, scipy.__name__, scipy.__version__) 214 | build_header(scipy.ndimage, scipy.__name__, scipy.__version__) 215 | build_header(scipy.optimize, scipy.__name__, scipy.__version__) 216 | build_header(scipy.signal, scipy.__name__, scipy.__version__) 217 | build_header(scipy.spatial, scipy.__name__, scipy.__version__) 218 | build_header(scipy.special, scipy.__name__, scipy.__version__) 219 | build_header(scipy.stats, scipy.__name__, scipy.__version__) 220 | build_header(matplotlib, matplotlib.__name__, matplotlib.__version__) 221 | build_header(matplotlib.pyplot, matplotlib.__name__, matplotlib.__version__) 222 | -------------------------------------------------------------------------------- /include/pyscience11/matplotlib.h: -------------------------------------------------------------------------------- 1 | // 2 | // matplotlib.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with matplotlib 2.2.3. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace matplotlib11 { 14 | 15 | class matplotlib_module : public pybind11::module { 16 | public: 17 | using pybind11::module::module; 18 | 19 | template 20 | pybind11::object _add_data_doc(TArgs&&... args) 21 | { 22 | return attr("_add_data_doc")(std::forward(args)...); 23 | } 24 | 25 | template 26 | pybind11::object _create_tmp_config_dir(TArgs&&... args) 27 | { 28 | return attr("_create_tmp_config_dir")(std::forward(args)...); 29 | } 30 | 31 | template 32 | pybind11::object _decode_filesystem_path(TArgs&&... args) 33 | { 34 | return attr("_decode_filesystem_path")(std::forward(args)...); 35 | } 36 | 37 | template 38 | pybind11::object _get_cachedir(TArgs&&... args) 39 | { 40 | return attr("_get_cachedir")(std::forward(args)...); 41 | } 42 | 43 | template 44 | pybind11::object _get_config_or_cache_dir(TArgs&&... args) 45 | { 46 | return attr("_get_config_or_cache_dir")(std::forward(args)...); 47 | } 48 | 49 | template 50 | pybind11::object _get_configdir(TArgs&&... args) 51 | { 52 | return attr("_get_configdir")(std::forward(args)...); 53 | } 54 | 55 | template 56 | pybind11::object _get_data_path(TArgs&&... args) 57 | { 58 | return attr("_get_data_path")(std::forward(args)...); 59 | } 60 | 61 | template 62 | pybind11::object _get_data_path_cached(TArgs&&... args) 63 | { 64 | return attr("_get_data_path_cached")(std::forward(args)...); 65 | } 66 | 67 | template 68 | pybind11::object _get_home(TArgs&&... args) 69 | { 70 | return attr("_get_home")(std::forward(args)...); 71 | } 72 | 73 | template 74 | pybind11::object _get_xdg_cache_dir(TArgs&&... args) 75 | { 76 | return attr("_get_xdg_cache_dir")(std::forward(args)...); 77 | } 78 | 79 | template 80 | pybind11::object _get_xdg_config_dir(TArgs&&... args) 81 | { 82 | return attr("_get_xdg_config_dir")(std::forward(args)...); 83 | } 84 | 85 | template 86 | pybind11::object _init_tests(TArgs&&... args) 87 | { 88 | return attr("_init_tests")(std::forward(args)...); 89 | } 90 | 91 | template 92 | pybind11::object _is_writable_dir(TArgs&&... args) 93 | { 94 | return attr("_is_writable_dir")(std::forward(args)...); 95 | } 96 | 97 | template 98 | pybind11::object _open_file_or_url(TArgs&&... args) 99 | { 100 | return attr("_open_file_or_url")(std::forward(args)...); 101 | } 102 | 103 | template 104 | pybind11::object _parse_commandline(TArgs&&... args) 105 | { 106 | return attr("_parse_commandline")(std::forward(args)...); 107 | } 108 | 109 | template 110 | pybind11::object _preprocess_data(TArgs&&... args) 111 | { 112 | return attr("_preprocess_data")(std::forward(args)...); 113 | } 114 | 115 | template 116 | pybind11::object _rc_params_in_file(TArgs&&... args) 117 | { 118 | return attr("_rc_params_in_file")(std::forward(args)...); 119 | } 120 | 121 | template 122 | pybind11::object _replacer(TArgs&&... args) 123 | { 124 | return attr("_replacer")(std::forward(args)...); 125 | } 126 | 127 | template 128 | pybind11::object _set_logger_verbose_level(TArgs&&... args) 129 | { 130 | return attr("_set_logger_verbose_level")(std::forward(args)...); 131 | } 132 | 133 | template 134 | pybind11::object _url_lines(TArgs&&... args) 135 | { 136 | return attr("_url_lines")(std::forward(args)...); 137 | } 138 | 139 | template 140 | pybind11::object _wrap(TArgs&&... args) 141 | { 142 | return attr("_wrap")(std::forward(args)...); 143 | } 144 | 145 | template 146 | pybind11::object checkdep_dvipng(TArgs&&... args) 147 | { 148 | return attr("checkdep_dvipng")(std::forward(args)...); 149 | } 150 | 151 | template 152 | pybind11::object checkdep_ghostscript(TArgs&&... args) 153 | { 154 | return attr("checkdep_ghostscript")(std::forward(args)...); 155 | } 156 | 157 | template 158 | pybind11::object checkdep_inkscape(TArgs&&... args) 159 | { 160 | return attr("checkdep_inkscape")(std::forward(args)...); 161 | } 162 | 163 | template 164 | pybind11::object checkdep_pdftops(TArgs&&... args) 165 | { 166 | return attr("checkdep_pdftops")(std::forward(args)...); 167 | } 168 | 169 | template 170 | pybind11::object checkdep_ps_distiller(TArgs&&... args) 171 | { 172 | return attr("checkdep_ps_distiller")(std::forward(args)...); 173 | } 174 | 175 | template 176 | pybind11::object checkdep_tex(TArgs&&... args) 177 | { 178 | return attr("checkdep_tex")(std::forward(args)...); 179 | } 180 | 181 | template 182 | pybind11::object checkdep_usetex(TArgs&&... args) 183 | { 184 | return attr("checkdep_usetex")(std::forward(args)...); 185 | } 186 | 187 | template 188 | pybind11::object checkdep_xmllint(TArgs&&... args) 189 | { 190 | return attr("checkdep_xmllint")(std::forward(args)...); 191 | } 192 | 193 | template 194 | pybind11::object compare_versions(TArgs&&... args) 195 | { 196 | return attr("compare_versions")(std::forward(args)...); 197 | } 198 | 199 | template 200 | pybind11::object cycler(TArgs&&... args) 201 | { 202 | return attr("cycler")(std::forward(args)...); 203 | } 204 | 205 | template 206 | pybind11::object dedent(TArgs&&... args) 207 | { 208 | return attr("dedent")(std::forward(args)...); 209 | } 210 | 211 | template 212 | pybind11::object get_backend(TArgs&&... args) 213 | { 214 | return attr("get_backend")(std::forward(args)...); 215 | } 216 | 217 | template 218 | pybind11::object get_cachedir(TArgs&&... args) 219 | { 220 | return attr("get_cachedir")(std::forward(args)...); 221 | } 222 | 223 | template 224 | pybind11::object get_configdir(TArgs&&... args) 225 | { 226 | return attr("get_configdir")(std::forward(args)...); 227 | } 228 | 229 | template 230 | pybind11::object get_data_path(TArgs&&... args) 231 | { 232 | return attr("get_data_path")(std::forward(args)...); 233 | } 234 | 235 | template 236 | pybind11::object get_home(TArgs&&... args) 237 | { 238 | return attr("get_home")(std::forward(args)...); 239 | } 240 | 241 | template 242 | pybind11::object get_label(TArgs&&... args) 243 | { 244 | return attr("get_label")(std::forward(args)...); 245 | } 246 | 247 | template 248 | pybind11::object get_py2exe_datafiles(TArgs&&... args) 249 | { 250 | return attr("get_py2exe_datafiles")(std::forward(args)...); 251 | } 252 | 253 | template 254 | pybind11::object interactive(TArgs&&... args) 255 | { 256 | return attr("interactive")(std::forward(args)...); 257 | } 258 | 259 | template 260 | pybind11::object is_interactive(TArgs&&... args) 261 | { 262 | return attr("is_interactive")(std::forward(args)...); 263 | } 264 | 265 | template 266 | pybind11::object is_url(TArgs&&... args) 267 | { 268 | return attr("is_url")(std::forward(args)...); 269 | } 270 | 271 | template 272 | pybind11::object matplotlib_fname(TArgs&&... args) 273 | { 274 | return attr("matplotlib_fname")(std::forward(args)...); 275 | } 276 | 277 | template 278 | pybind11::object rc(TArgs&&... args) 279 | { 280 | return attr("rc")(std::forward(args)...); 281 | } 282 | 283 | template 284 | pybind11::object rc_file(TArgs&&... args) 285 | { 286 | return attr("rc_file")(std::forward(args)...); 287 | } 288 | 289 | template 290 | pybind11::object rc_file_defaults(TArgs&&... args) 291 | { 292 | return attr("rc_file_defaults")(std::forward(args)...); 293 | } 294 | 295 | template 296 | pybind11::object rc_params(TArgs&&... args) 297 | { 298 | return attr("rc_params")(std::forward(args)...); 299 | } 300 | 301 | template 302 | pybind11::object rc_params_from_file(TArgs&&... args) 303 | { 304 | return attr("rc_params_from_file")(std::forward(args)...); 305 | } 306 | 307 | template 308 | pybind11::object rcdefaults(TArgs&&... args) 309 | { 310 | return attr("rcdefaults")(std::forward(args)...); 311 | } 312 | 313 | template 314 | pybind11::object reload(TArgs&&... args) 315 | { 316 | return attr("reload")(std::forward(args)...); 317 | } 318 | 319 | template 320 | pybind11::object sanitize_sequence(TArgs&&... args) 321 | { 322 | return attr("sanitize_sequence")(std::forward(args)...); 323 | } 324 | 325 | template 326 | pybind11::object test(TArgs&&... args) 327 | { 328 | return attr("test")(std::forward(args)...); 329 | } 330 | 331 | template 332 | pybind11::object tk_window_focus(TArgs&&... args) 333 | { 334 | return attr("tk_window_focus")(std::forward(args)...); 335 | } 336 | 337 | template 338 | pybind11::object urlopen(TArgs&&... args) 339 | { 340 | return attr("urlopen")(std::forward(args)...); 341 | } 342 | 343 | template 344 | pybind11::object use(TArgs&&... args) 345 | { 346 | return attr("use")(std::forward(args)...); 347 | } 348 | 349 | template 350 | pybind11::object validate_backend(TArgs&&... args) 351 | { 352 | return attr("validate_backend")(std::forward(args)...); 353 | } 354 | }; 355 | 356 | matplotlib_module import_matplotlib() 357 | { 358 | return pybind11::module::import("matplotlib"); 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /include/pyscience11/matplotlib/pyplot.h: -------------------------------------------------------------------------------- 1 | // 2 | // pyplot.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with matplotlib 2.2.3. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace matplotlib11 { 14 | namespace matplotlib { 15 | 16 | class pyplot_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object _auto_draw_if_interactive(TArgs&&... args) 22 | { 23 | return attr("_auto_draw_if_interactive")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object _autogen_docstring(TArgs&&... args) 28 | { 29 | return attr("_autogen_docstring")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object _backend_selection(TArgs&&... args) 34 | { 35 | return attr("_backend_selection")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object _imread(TArgs&&... args) 40 | { 41 | return attr("_imread")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object _imsave(TArgs&&... args) 46 | { 47 | return attr("_imsave")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object _setp(TArgs&&... args) 52 | { 53 | return attr("_setp")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object _setup_pyplot_info_docstrings(TArgs&&... args) 58 | { 59 | return attr("_setup_pyplot_info_docstrings")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object _string_to_bool(TArgs&&... args) 64 | { 65 | return attr("_string_to_bool")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object acorr(TArgs&&... args) 70 | { 71 | return attr("acorr")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object angle_spectrum(TArgs&&... args) 76 | { 77 | return attr("angle_spectrum")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object annotate(TArgs&&... args) 82 | { 83 | return attr("annotate")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object arrow(TArgs&&... args) 88 | { 89 | return attr("arrow")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object autoscale(TArgs&&... args) 94 | { 95 | return attr("autoscale")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object autumn(TArgs&&... args) 100 | { 101 | return attr("autumn")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object axes(TArgs&&... args) 106 | { 107 | return attr("axes")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object axhline(TArgs&&... args) 112 | { 113 | return attr("axhline")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object axhspan(TArgs&&... args) 118 | { 119 | return attr("axhspan")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object axis(TArgs&&... args) 124 | { 125 | return attr("axis")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object axvline(TArgs&&... args) 130 | { 131 | return attr("axvline")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object axvspan(TArgs&&... args) 136 | { 137 | return attr("axvspan")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object bar(TArgs&&... args) 142 | { 143 | return attr("bar")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object barbs(TArgs&&... args) 148 | { 149 | return attr("barbs")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object barh(TArgs&&... args) 154 | { 155 | return attr("barh")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object bone(TArgs&&... args) 160 | { 161 | return attr("bone")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object box(TArgs&&... args) 166 | { 167 | return attr("box")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object boxplot(TArgs&&... args) 172 | { 173 | return attr("boxplot")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object broken_barh(TArgs&&... args) 178 | { 179 | return attr("broken_barh")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object cla(TArgs&&... args) 184 | { 185 | return attr("cla")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object clabel(TArgs&&... args) 190 | { 191 | return attr("clabel")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object clf(TArgs&&... args) 196 | { 197 | return attr("clf")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object clim(TArgs&&... args) 202 | { 203 | return attr("clim")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object close(TArgs&&... args) 208 | { 209 | return attr("close")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object cohere(TArgs&&... args) 214 | { 215 | return attr("cohere")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object colorbar(TArgs&&... args) 220 | { 221 | return attr("colorbar")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object colormaps(TArgs&&... args) 226 | { 227 | return attr("colormaps")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object colors(TArgs&&... args) 232 | { 233 | return attr("colors")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object connect(TArgs&&... args) 238 | { 239 | return attr("connect")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object contour(TArgs&&... args) 244 | { 245 | return attr("contour")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object contourf(TArgs&&... args) 250 | { 251 | return attr("contourf")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object cool(TArgs&&... args) 256 | { 257 | return attr("cool")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object copper(TArgs&&... args) 262 | { 263 | return attr("copper")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object csd(TArgs&&... args) 268 | { 269 | return attr("csd")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object cycler(TArgs&&... args) 274 | { 275 | return attr("cycler")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object dedent(TArgs&&... args) 280 | { 281 | return attr("dedent")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object delaxes(TArgs&&... args) 286 | { 287 | return attr("delaxes")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object deprecated(TArgs&&... args) 292 | { 293 | return attr("deprecated")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object disconnect(TArgs&&... args) 298 | { 299 | return attr("disconnect")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object draw(TArgs&&... args) 304 | { 305 | return attr("draw")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object errorbar(TArgs&&... args) 310 | { 311 | return attr("errorbar")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object eventplot(TArgs&&... args) 316 | { 317 | return attr("eventplot")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object figaspect(TArgs&&... args) 322 | { 323 | return attr("figaspect")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object figimage(TArgs&&... args) 328 | { 329 | return attr("figimage")(std::forward(args)...); 330 | } 331 | 332 | template 333 | pybind11::object figlegend(TArgs&&... args) 334 | { 335 | return attr("figlegend")(std::forward(args)...); 336 | } 337 | 338 | template 339 | pybind11::object fignum_exists(TArgs&&... args) 340 | { 341 | return attr("fignum_exists")(std::forward(args)...); 342 | } 343 | 344 | template 345 | pybind11::object figtext(TArgs&&... args) 346 | { 347 | return attr("figtext")(std::forward(args)...); 348 | } 349 | 350 | template 351 | pybind11::object figure(TArgs&&... args) 352 | { 353 | return attr("figure")(std::forward(args)...); 354 | } 355 | 356 | template 357 | pybind11::object fill(TArgs&&... args) 358 | { 359 | return attr("fill")(std::forward(args)...); 360 | } 361 | 362 | template 363 | pybind11::object fill_between(TArgs&&... args) 364 | { 365 | return attr("fill_between")(std::forward(args)...); 366 | } 367 | 368 | template 369 | pybind11::object fill_betweenx(TArgs&&... args) 370 | { 371 | return attr("fill_betweenx")(std::forward(args)...); 372 | } 373 | 374 | template 375 | pybind11::object findobj(TArgs&&... args) 376 | { 377 | return attr("findobj")(std::forward(args)...); 378 | } 379 | 380 | template 381 | pybind11::object flag(TArgs&&... args) 382 | { 383 | return attr("flag")(std::forward(args)...); 384 | } 385 | 386 | template 387 | pybind11::object gca(TArgs&&... args) 388 | { 389 | return attr("gca")(std::forward(args)...); 390 | } 391 | 392 | template 393 | pybind11::object gcf(TArgs&&... args) 394 | { 395 | return attr("gcf")(std::forward(args)...); 396 | } 397 | 398 | template 399 | pybind11::object gci(TArgs&&... args) 400 | { 401 | return attr("gci")(std::forward(args)...); 402 | } 403 | 404 | template 405 | pybind11::object get(TArgs&&... args) 406 | { 407 | return attr("get")(std::forward(args)...); 408 | } 409 | 410 | template 411 | pybind11::object get_backend(TArgs&&... args) 412 | { 413 | return attr("get_backend")(std::forward(args)...); 414 | } 415 | 416 | template 417 | pybind11::object get_cmap(TArgs&&... args) 418 | { 419 | return attr("get_cmap")(std::forward(args)...); 420 | } 421 | 422 | template 423 | pybind11::object get_current_fig_manager(TArgs&&... args) 424 | { 425 | return attr("get_current_fig_manager")(std::forward(args)...); 426 | } 427 | 428 | template 429 | pybind11::object get_figlabels(TArgs&&... args) 430 | { 431 | return attr("get_figlabels")(std::forward(args)...); 432 | } 433 | 434 | template 435 | pybind11::object get_fignums(TArgs&&... args) 436 | { 437 | return attr("get_fignums")(std::forward(args)...); 438 | } 439 | 440 | template 441 | pybind11::object get_plot_commands(TArgs&&... args) 442 | { 443 | return attr("get_plot_commands")(std::forward(args)...); 444 | } 445 | 446 | template 447 | pybind11::object get_scale_docs(TArgs&&... args) 448 | { 449 | return attr("get_scale_docs")(std::forward(args)...); 450 | } 451 | 452 | template 453 | pybind11::object get_scale_names(TArgs&&... args) 454 | { 455 | return attr("get_scale_names")(std::forward(args)...); 456 | } 457 | 458 | template 459 | pybind11::object getp(TArgs&&... args) 460 | { 461 | return attr("getp")(std::forward(args)...); 462 | } 463 | 464 | template 465 | pybind11::object ginput(TArgs&&... args) 466 | { 467 | return attr("ginput")(std::forward(args)...); 468 | } 469 | 470 | template 471 | pybind11::object gray(TArgs&&... args) 472 | { 473 | return attr("gray")(std::forward(args)...); 474 | } 475 | 476 | template 477 | pybind11::object grid(TArgs&&... args) 478 | { 479 | return attr("grid")(std::forward(args)...); 480 | } 481 | 482 | template 483 | pybind11::object hexbin(TArgs&&... args) 484 | { 485 | return attr("hexbin")(std::forward(args)...); 486 | } 487 | 488 | template 489 | pybind11::object hist(TArgs&&... args) 490 | { 491 | return attr("hist")(std::forward(args)...); 492 | } 493 | 494 | template 495 | pybind11::object hist2d(TArgs&&... args) 496 | { 497 | return attr("hist2d")(std::forward(args)...); 498 | } 499 | 500 | template 501 | pybind11::object hlines(TArgs&&... args) 502 | { 503 | return attr("hlines")(std::forward(args)...); 504 | } 505 | 506 | template 507 | pybind11::object hold(TArgs&&... args) 508 | { 509 | return attr("hold")(std::forward(args)...); 510 | } 511 | 512 | template 513 | pybind11::object hot(TArgs&&... args) 514 | { 515 | return attr("hot")(std::forward(args)...); 516 | } 517 | 518 | template 519 | pybind11::object hsv(TArgs&&... args) 520 | { 521 | return attr("hsv")(std::forward(args)...); 522 | } 523 | 524 | template 525 | pybind11::object imread(TArgs&&... args) 526 | { 527 | return attr("imread")(std::forward(args)...); 528 | } 529 | 530 | template 531 | pybind11::object imsave(TArgs&&... args) 532 | { 533 | return attr("imsave")(std::forward(args)...); 534 | } 535 | 536 | template 537 | pybind11::object imshow(TArgs&&... args) 538 | { 539 | return attr("imshow")(std::forward(args)...); 540 | } 541 | 542 | template 543 | pybind11::object inferno(TArgs&&... args) 544 | { 545 | return attr("inferno")(std::forward(args)...); 546 | } 547 | 548 | template 549 | pybind11::object install_repl_displayhook(TArgs&&... args) 550 | { 551 | return attr("install_repl_displayhook")(std::forward(args)...); 552 | } 553 | 554 | template 555 | pybind11::object interactive(TArgs&&... args) 556 | { 557 | return attr("interactive")(std::forward(args)...); 558 | } 559 | 560 | template 561 | pybind11::object ioff(TArgs&&... args) 562 | { 563 | return attr("ioff")(std::forward(args)...); 564 | } 565 | 566 | template 567 | pybind11::object ion(TArgs&&... args) 568 | { 569 | return attr("ion")(std::forward(args)...); 570 | } 571 | 572 | template 573 | pybind11::object is_numlike(TArgs&&... args) 574 | { 575 | return attr("is_numlike")(std::forward(args)...); 576 | } 577 | 578 | template 579 | pybind11::object ishold(TArgs&&... args) 580 | { 581 | return attr("ishold")(std::forward(args)...); 582 | } 583 | 584 | template 585 | pybind11::object isinteractive(TArgs&&... args) 586 | { 587 | return attr("isinteractive")(std::forward(args)...); 588 | } 589 | 590 | template 591 | pybind11::object jet(TArgs&&... args) 592 | { 593 | return attr("jet")(std::forward(args)...); 594 | } 595 | 596 | template 597 | pybind11::object legend(TArgs&&... args) 598 | { 599 | return attr("legend")(std::forward(args)...); 600 | } 601 | 602 | template 603 | pybind11::object locator_params(TArgs&&... args) 604 | { 605 | return attr("locator_params")(std::forward(args)...); 606 | } 607 | 608 | template 609 | pybind11::object loglog(TArgs&&... args) 610 | { 611 | return attr("loglog")(std::forward(args)...); 612 | } 613 | 614 | template 615 | pybind11::object magma(TArgs&&... args) 616 | { 617 | return attr("magma")(std::forward(args)...); 618 | } 619 | 620 | template 621 | pybind11::object magnitude_spectrum(TArgs&&... args) 622 | { 623 | return attr("magnitude_spectrum")(std::forward(args)...); 624 | } 625 | 626 | template 627 | pybind11::object margins(TArgs&&... args) 628 | { 629 | return attr("margins")(std::forward(args)...); 630 | } 631 | 632 | template 633 | pybind11::object matshow(TArgs&&... args) 634 | { 635 | return attr("matshow")(std::forward(args)...); 636 | } 637 | 638 | template 639 | pybind11::object minorticks_off(TArgs&&... args) 640 | { 641 | return attr("minorticks_off")(std::forward(args)...); 642 | } 643 | 644 | template 645 | pybind11::object minorticks_on(TArgs&&... args) 646 | { 647 | return attr("minorticks_on")(std::forward(args)...); 648 | } 649 | 650 | template 651 | pybind11::object nipy_spectral(TArgs&&... args) 652 | { 653 | return attr("nipy_spectral")(std::forward(args)...); 654 | } 655 | 656 | template 657 | pybind11::object over(TArgs&&... args) 658 | { 659 | return attr("over")(std::forward(args)...); 660 | } 661 | 662 | template 663 | pybind11::object pause(TArgs&&... args) 664 | { 665 | return attr("pause")(std::forward(args)...); 666 | } 667 | 668 | template 669 | pybind11::object pcolor(TArgs&&... args) 670 | { 671 | return attr("pcolor")(std::forward(args)...); 672 | } 673 | 674 | template 675 | pybind11::object pcolormesh(TArgs&&... args) 676 | { 677 | return attr("pcolormesh")(std::forward(args)...); 678 | } 679 | 680 | template 681 | pybind11::object phase_spectrum(TArgs&&... args) 682 | { 683 | return attr("phase_spectrum")(std::forward(args)...); 684 | } 685 | 686 | template 687 | pybind11::object pie(TArgs&&... args) 688 | { 689 | return attr("pie")(std::forward(args)...); 690 | } 691 | 692 | template 693 | pybind11::object pink(TArgs&&... args) 694 | { 695 | return attr("pink")(std::forward(args)...); 696 | } 697 | 698 | template 699 | pybind11::object plasma(TArgs&&... args) 700 | { 701 | return attr("plasma")(std::forward(args)...); 702 | } 703 | 704 | template 705 | pybind11::object plot(TArgs&&... args) 706 | { 707 | return attr("plot")(std::forward(args)...); 708 | } 709 | 710 | template 711 | pybind11::object plot_date(TArgs&&... args) 712 | { 713 | return attr("plot_date")(std::forward(args)...); 714 | } 715 | 716 | template 717 | pybind11::object plotfile(TArgs&&... args) 718 | { 719 | return attr("plotfile")(std::forward(args)...); 720 | } 721 | 722 | template 723 | pybind11::object plotting(TArgs&&... args) 724 | { 725 | return attr("plotting")(std::forward(args)...); 726 | } 727 | 728 | template 729 | pybind11::object polar(TArgs&&... args) 730 | { 731 | return attr("polar")(std::forward(args)...); 732 | } 733 | 734 | template 735 | pybind11::object prism(TArgs&&... args) 736 | { 737 | return attr("prism")(std::forward(args)...); 738 | } 739 | 740 | template 741 | pybind11::object psd(TArgs&&... args) 742 | { 743 | return attr("psd")(std::forward(args)...); 744 | } 745 | 746 | template 747 | pybind11::object pylab_setup(TArgs&&... args) 748 | { 749 | return attr("pylab_setup")(std::forward(args)...); 750 | } 751 | 752 | template 753 | pybind11::object quiver(TArgs&&... args) 754 | { 755 | return attr("quiver")(std::forward(args)...); 756 | } 757 | 758 | template 759 | pybind11::object quiverkey(TArgs&&... args) 760 | { 761 | return attr("quiverkey")(std::forward(args)...); 762 | } 763 | 764 | template 765 | pybind11::object rc(TArgs&&... args) 766 | { 767 | return attr("rc")(std::forward(args)...); 768 | } 769 | 770 | template 771 | pybind11::object rc_context(TArgs&&... args) 772 | { 773 | return attr("rc_context")(std::forward(args)...); 774 | } 775 | 776 | template 777 | pybind11::object rcdefaults(TArgs&&... args) 778 | { 779 | return attr("rcdefaults")(std::forward(args)...); 780 | } 781 | 782 | template 783 | pybind11::object register_cmap(TArgs&&... args) 784 | { 785 | return attr("register_cmap")(std::forward(args)...); 786 | } 787 | 788 | template 789 | pybind11::object rgrids(TArgs&&... args) 790 | { 791 | return attr("rgrids")(std::forward(args)...); 792 | } 793 | 794 | template 795 | pybind11::object savefig(TArgs&&... args) 796 | { 797 | return attr("savefig")(std::forward(args)...); 798 | } 799 | 800 | template 801 | pybind11::object sca(TArgs&&... args) 802 | { 803 | return attr("sca")(std::forward(args)...); 804 | } 805 | 806 | template 807 | pybind11::object scatter(TArgs&&... args) 808 | { 809 | return attr("scatter")(std::forward(args)...); 810 | } 811 | 812 | template 813 | pybind11::object sci(TArgs&&... args) 814 | { 815 | return attr("sci")(std::forward(args)...); 816 | } 817 | 818 | template 819 | pybind11::object semilogx(TArgs&&... args) 820 | { 821 | return attr("semilogx")(std::forward(args)...); 822 | } 823 | 824 | template 825 | pybind11::object semilogy(TArgs&&... args) 826 | { 827 | return attr("semilogy")(std::forward(args)...); 828 | } 829 | 830 | template 831 | pybind11::object set_cmap(TArgs&&... args) 832 | { 833 | return attr("set_cmap")(std::forward(args)...); 834 | } 835 | 836 | template 837 | pybind11::object setp(TArgs&&... args) 838 | { 839 | return attr("setp")(std::forward(args)...); 840 | } 841 | 842 | template 843 | pybind11::object show(TArgs&&... args) 844 | { 845 | return attr("show")(std::forward(args)...); 846 | } 847 | 848 | template 849 | pybind11::object specgram(TArgs&&... args) 850 | { 851 | return attr("specgram")(std::forward(args)...); 852 | } 853 | 854 | template 855 | pybind11::object spectral(TArgs&&... args) 856 | { 857 | return attr("spectral")(std::forward(args)...); 858 | } 859 | 860 | template 861 | pybind11::object spring(TArgs&&... args) 862 | { 863 | return attr("spring")(std::forward(args)...); 864 | } 865 | 866 | template 867 | pybind11::object spy(TArgs&&... args) 868 | { 869 | return attr("spy")(std::forward(args)...); 870 | } 871 | 872 | template 873 | pybind11::object stackplot(TArgs&&... args) 874 | { 875 | return attr("stackplot")(std::forward(args)...); 876 | } 877 | 878 | template 879 | pybind11::object stem(TArgs&&... args) 880 | { 881 | return attr("stem")(std::forward(args)...); 882 | } 883 | 884 | template 885 | pybind11::object step(TArgs&&... args) 886 | { 887 | return attr("step")(std::forward(args)...); 888 | } 889 | 890 | template 891 | pybind11::object streamplot(TArgs&&... args) 892 | { 893 | return attr("streamplot")(std::forward(args)...); 894 | } 895 | 896 | template 897 | pybind11::object subplot(TArgs&&... args) 898 | { 899 | return attr("subplot")(std::forward(args)...); 900 | } 901 | 902 | template 903 | pybind11::object subplot2grid(TArgs&&... args) 904 | { 905 | return attr("subplot2grid")(std::forward(args)...); 906 | } 907 | 908 | template 909 | pybind11::object subplot_tool(TArgs&&... args) 910 | { 911 | return attr("subplot_tool")(std::forward(args)...); 912 | } 913 | 914 | template 915 | pybind11::object subplots(TArgs&&... args) 916 | { 917 | return attr("subplots")(std::forward(args)...); 918 | } 919 | 920 | template 921 | pybind11::object subplots_adjust(TArgs&&... args) 922 | { 923 | return attr("subplots_adjust")(std::forward(args)...); 924 | } 925 | 926 | template 927 | pybind11::object summer(TArgs&&... args) 928 | { 929 | return attr("summer")(std::forward(args)...); 930 | } 931 | 932 | template 933 | pybind11::object suptitle(TArgs&&... args) 934 | { 935 | return attr("suptitle")(std::forward(args)...); 936 | } 937 | 938 | template 939 | pybind11::object switch_backend(TArgs&&... args) 940 | { 941 | return attr("switch_backend")(std::forward(args)...); 942 | } 943 | 944 | template 945 | pybind11::object table(TArgs&&... args) 946 | { 947 | return attr("table")(std::forward(args)...); 948 | } 949 | 950 | template 951 | pybind11::object text(TArgs&&... args) 952 | { 953 | return attr("text")(std::forward(args)...); 954 | } 955 | 956 | template 957 | pybind11::object thetagrids(TArgs&&... args) 958 | { 959 | return attr("thetagrids")(std::forward(args)...); 960 | } 961 | 962 | template 963 | pybind11::object tick_params(TArgs&&... args) 964 | { 965 | return attr("tick_params")(std::forward(args)...); 966 | } 967 | 968 | template 969 | pybind11::object ticklabel_format(TArgs&&... args) 970 | { 971 | return attr("ticklabel_format")(std::forward(args)...); 972 | } 973 | 974 | template 975 | pybind11::object tight_layout(TArgs&&... args) 976 | { 977 | return attr("tight_layout")(std::forward(args)...); 978 | } 979 | 980 | template 981 | pybind11::object title(TArgs&&... args) 982 | { 983 | return attr("title")(std::forward(args)...); 984 | } 985 | 986 | template 987 | pybind11::object tricontour(TArgs&&... args) 988 | { 989 | return attr("tricontour")(std::forward(args)...); 990 | } 991 | 992 | template 993 | pybind11::object tricontourf(TArgs&&... args) 994 | { 995 | return attr("tricontourf")(std::forward(args)...); 996 | } 997 | 998 | template 999 | pybind11::object tripcolor(TArgs&&... args) 1000 | { 1001 | return attr("tripcolor")(std::forward(args)...); 1002 | } 1003 | 1004 | template 1005 | pybind11::object triplot(TArgs&&... args) 1006 | { 1007 | return attr("triplot")(std::forward(args)...); 1008 | } 1009 | 1010 | template 1011 | pybind11::object twinx(TArgs&&... args) 1012 | { 1013 | return attr("twinx")(std::forward(args)...); 1014 | } 1015 | 1016 | template 1017 | pybind11::object twiny(TArgs&&... args) 1018 | { 1019 | return attr("twiny")(std::forward(args)...); 1020 | } 1021 | 1022 | template 1023 | pybind11::object uninstall_repl_displayhook(TArgs&&... args) 1024 | { 1025 | return attr("uninstall_repl_displayhook")(std::forward(args)...); 1026 | } 1027 | 1028 | template 1029 | pybind11::object violinplot(TArgs&&... args) 1030 | { 1031 | return attr("violinplot")(std::forward(args)...); 1032 | } 1033 | 1034 | template 1035 | pybind11::object viridis(TArgs&&... args) 1036 | { 1037 | return attr("viridis")(std::forward(args)...); 1038 | } 1039 | 1040 | template 1041 | pybind11::object vlines(TArgs&&... args) 1042 | { 1043 | return attr("vlines")(std::forward(args)...); 1044 | } 1045 | 1046 | template 1047 | pybind11::object waitforbuttonpress(TArgs&&... args) 1048 | { 1049 | return attr("waitforbuttonpress")(std::forward(args)...); 1050 | } 1051 | 1052 | template 1053 | pybind11::object warn_deprecated(TArgs&&... args) 1054 | { 1055 | return attr("warn_deprecated")(std::forward(args)...); 1056 | } 1057 | 1058 | template 1059 | pybind11::object winter(TArgs&&... args) 1060 | { 1061 | return attr("winter")(std::forward(args)...); 1062 | } 1063 | 1064 | template 1065 | pybind11::object xcorr(TArgs&&... args) 1066 | { 1067 | return attr("xcorr")(std::forward(args)...); 1068 | } 1069 | 1070 | template 1071 | pybind11::object xkcd(TArgs&&... args) 1072 | { 1073 | return attr("xkcd")(std::forward(args)...); 1074 | } 1075 | 1076 | template 1077 | pybind11::object xlabel(TArgs&&... args) 1078 | { 1079 | return attr("xlabel")(std::forward(args)...); 1080 | } 1081 | 1082 | template 1083 | pybind11::object xlim(TArgs&&... args) 1084 | { 1085 | return attr("xlim")(std::forward(args)...); 1086 | } 1087 | 1088 | template 1089 | pybind11::object xscale(TArgs&&... args) 1090 | { 1091 | return attr("xscale")(std::forward(args)...); 1092 | } 1093 | 1094 | template 1095 | pybind11::object xticks(TArgs&&... args) 1096 | { 1097 | return attr("xticks")(std::forward(args)...); 1098 | } 1099 | 1100 | template 1101 | pybind11::object ylabel(TArgs&&... args) 1102 | { 1103 | return attr("ylabel")(std::forward(args)...); 1104 | } 1105 | 1106 | template 1107 | pybind11::object ylim(TArgs&&... args) 1108 | { 1109 | return attr("ylim")(std::forward(args)...); 1110 | } 1111 | 1112 | template 1113 | pybind11::object yscale(TArgs&&... args) 1114 | { 1115 | return attr("yscale")(std::forward(args)...); 1116 | } 1117 | 1118 | template 1119 | pybind11::object yticks(TArgs&&... args) 1120 | { 1121 | return attr("yticks")(std::forward(args)...); 1122 | } 1123 | }; 1124 | 1125 | pyplot_module import_pyplot() 1126 | { 1127 | return pybind11::module::import("matplotlib.pyplot"); 1128 | } 1129 | } 1130 | } 1131 | -------------------------------------------------------------------------------- /include/pyscience11/numpy/dual.h: -------------------------------------------------------------------------------- 1 | // 2 | // dual.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with numpy 1.15.1. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace numpy11 { 14 | namespace numpy { 15 | 16 | class dual_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object cholesky(TArgs&&... args) 22 | { 23 | return attr("cholesky")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object det(TArgs&&... args) 28 | { 29 | return attr("det")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object eig(TArgs&&... args) 34 | { 35 | return attr("eig")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object eigh(TArgs&&... args) 40 | { 41 | return attr("eigh")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object eigvals(TArgs&&... args) 46 | { 47 | return attr("eigvals")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object eigvalsh(TArgs&&... args) 52 | { 53 | return attr("eigvalsh")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object fft(TArgs&&... args) 58 | { 59 | return attr("fft")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object fft2(TArgs&&... args) 64 | { 65 | return attr("fft2")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object fftn(TArgs&&... args) 70 | { 71 | return attr("fftn")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object i0(TArgs&&... args) 76 | { 77 | return attr("i0")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object ifft(TArgs&&... args) 82 | { 83 | return attr("ifft")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object ifft2(TArgs&&... args) 88 | { 89 | return attr("ifft2")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object ifftn(TArgs&&... args) 94 | { 95 | return attr("ifftn")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object inv(TArgs&&... args) 100 | { 101 | return attr("inv")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object lstsq(TArgs&&... args) 106 | { 107 | return attr("lstsq")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object norm(TArgs&&... args) 112 | { 113 | return attr("norm")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object pinv(TArgs&&... args) 118 | { 119 | return attr("pinv")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object register_func(TArgs&&... args) 124 | { 125 | return attr("register_func")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object restore_all(TArgs&&... args) 130 | { 131 | return attr("restore_all")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object restore_func(TArgs&&... args) 136 | { 137 | return attr("restore_func")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object solve(TArgs&&... args) 142 | { 143 | return attr("solve")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object svd(TArgs&&... args) 148 | { 149 | return attr("svd")(std::forward(args)...); 150 | } 151 | }; 152 | 153 | dual_module import_dual() 154 | { 155 | return pybind11::module::import("numpy.dual"); 156 | } 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /include/pyscience11/numpy/fft.h: -------------------------------------------------------------------------------- 1 | // 2 | // fft.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with numpy 1.15.1. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace numpy11 { 14 | namespace numpy { 15 | 16 | class fft_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object fft(TArgs&&... args) 22 | { 23 | return attr("fft")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object fft2(TArgs&&... args) 28 | { 29 | return attr("fft2")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object fftfreq(TArgs&&... args) 34 | { 35 | return attr("fftfreq")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object fftn(TArgs&&... args) 40 | { 41 | return attr("fftn")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object fftshift(TArgs&&... args) 46 | { 47 | return attr("fftshift")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object hfft(TArgs&&... args) 52 | { 53 | return attr("hfft")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object ifft(TArgs&&... args) 58 | { 59 | return attr("ifft")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object ifft2(TArgs&&... args) 64 | { 65 | return attr("ifft2")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object ifftn(TArgs&&... args) 70 | { 71 | return attr("ifftn")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object ifftshift(TArgs&&... args) 76 | { 77 | return attr("ifftshift")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object ihfft(TArgs&&... args) 82 | { 83 | return attr("ihfft")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object irfft(TArgs&&... args) 88 | { 89 | return attr("irfft")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object irfft2(TArgs&&... args) 94 | { 95 | return attr("irfft2")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object irfftn(TArgs&&... args) 100 | { 101 | return attr("irfftn")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object rfft(TArgs&&... args) 106 | { 107 | return attr("rfft")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object rfft2(TArgs&&... args) 112 | { 113 | return attr("rfft2")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object rfftfreq(TArgs&&... args) 118 | { 119 | return attr("rfftfreq")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object rfftn(TArgs&&... args) 124 | { 125 | return attr("rfftn")(std::forward(args)...); 126 | } 127 | }; 128 | 129 | fft_module import_fft() 130 | { 131 | return pybind11::module::import("numpy.fft"); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /include/pyscience11/numpy/linalg.h: -------------------------------------------------------------------------------- 1 | // 2 | // linalg.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with numpy 1.15.1. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace numpy11 { 14 | namespace numpy { 15 | 16 | class linalg_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object cholesky(TArgs&&... args) 22 | { 23 | return attr("cholesky")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object cond(TArgs&&... args) 28 | { 29 | return attr("cond")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object det(TArgs&&... args) 34 | { 35 | return attr("det")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object eig(TArgs&&... args) 40 | { 41 | return attr("eig")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object eigh(TArgs&&... args) 46 | { 47 | return attr("eigh")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object eigvals(TArgs&&... args) 52 | { 53 | return attr("eigvals")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object eigvalsh(TArgs&&... args) 58 | { 59 | return attr("eigvalsh")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object inv(TArgs&&... args) 64 | { 65 | return attr("inv")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object lstsq(TArgs&&... args) 70 | { 71 | return attr("lstsq")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object matrix_power(TArgs&&... args) 76 | { 77 | return attr("matrix_power")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object matrix_rank(TArgs&&... args) 82 | { 83 | return attr("matrix_rank")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object multi_dot(TArgs&&... args) 88 | { 89 | return attr("multi_dot")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object norm(TArgs&&... args) 94 | { 95 | return attr("norm")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object pinv(TArgs&&... args) 100 | { 101 | return attr("pinv")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object qr(TArgs&&... args) 106 | { 107 | return attr("qr")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object slogdet(TArgs&&... args) 112 | { 113 | return attr("slogdet")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object solve(TArgs&&... args) 118 | { 119 | return attr("solve")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object svd(TArgs&&... args) 124 | { 125 | return attr("svd")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object tensorinv(TArgs&&... args) 130 | { 131 | return attr("tensorinv")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object tensorsolve(TArgs&&... args) 136 | { 137 | return attr("tensorsolve")(std::forward(args)...); 138 | } 139 | }; 140 | 141 | linalg_module import_linalg() 142 | { 143 | return pybind11::module::import("numpy.linalg"); 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /include/pyscience11/numpy/random.h: -------------------------------------------------------------------------------- 1 | // 2 | // random.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with numpy 1.15.1. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace numpy11 { 14 | namespace numpy { 15 | 16 | class random_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object Lock(TArgs&&... args) 22 | { 23 | return attr("Lock")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object __RandomState_ctor(TArgs&&... args) 28 | { 29 | return attr("__RandomState_ctor")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object beta(TArgs&&... args) 34 | { 35 | return attr("beta")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object binomial(TArgs&&... args) 40 | { 41 | return attr("binomial")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object bytes(TArgs&&... args) 46 | { 47 | return attr("bytes")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object chisquare(TArgs&&... args) 52 | { 53 | return attr("chisquare")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object choice(TArgs&&... args) 58 | { 59 | return attr("choice")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object dirichlet(TArgs&&... args) 64 | { 65 | return attr("dirichlet")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object exponential(TArgs&&... args) 70 | { 71 | return attr("exponential")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object f(TArgs&&... args) 76 | { 77 | return attr("f")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object gamma(TArgs&&... args) 82 | { 83 | return attr("gamma")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object geometric(TArgs&&... args) 88 | { 89 | return attr("geometric")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object get_state(TArgs&&... args) 94 | { 95 | return attr("get_state")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object gumbel(TArgs&&... args) 100 | { 101 | return attr("gumbel")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object hypergeometric(TArgs&&... args) 106 | { 107 | return attr("hypergeometric")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object laplace(TArgs&&... args) 112 | { 113 | return attr("laplace")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object logistic(TArgs&&... args) 118 | { 119 | return attr("logistic")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object lognormal(TArgs&&... args) 124 | { 125 | return attr("lognormal")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object logseries(TArgs&&... args) 130 | { 131 | return attr("logseries")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object multinomial(TArgs&&... args) 136 | { 137 | return attr("multinomial")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object multivariate_normal(TArgs&&... args) 142 | { 143 | return attr("multivariate_normal")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object negative_binomial(TArgs&&... args) 148 | { 149 | return attr("negative_binomial")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object noncentral_chisquare(TArgs&&... args) 154 | { 155 | return attr("noncentral_chisquare")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object noncentral_f(TArgs&&... args) 160 | { 161 | return attr("noncentral_f")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object normal(TArgs&&... args) 166 | { 167 | return attr("normal")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object pareto(TArgs&&... args) 172 | { 173 | return attr("pareto")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object permutation(TArgs&&... args) 178 | { 179 | return attr("permutation")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object poisson(TArgs&&... args) 184 | { 185 | return attr("poisson")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object power(TArgs&&... args) 190 | { 191 | return attr("power")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object rand(TArgs&&... args) 196 | { 197 | return attr("rand")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object randint(TArgs&&... args) 202 | { 203 | return attr("randint")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object randn(TArgs&&... args) 208 | { 209 | return attr("randn")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object random(TArgs&&... args) 214 | { 215 | return attr("random")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object random_integers(TArgs&&... args) 220 | { 221 | return attr("random_integers")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object random_sample(TArgs&&... args) 226 | { 227 | return attr("random_sample")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object ranf(TArgs&&... args) 232 | { 233 | return attr("ranf")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object rayleigh(TArgs&&... args) 238 | { 239 | return attr("rayleigh")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object sample(TArgs&&... args) 244 | { 245 | return attr("sample")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object seed(TArgs&&... args) 250 | { 251 | return attr("seed")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object set_state(TArgs&&... args) 256 | { 257 | return attr("set_state")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object shuffle(TArgs&&... args) 262 | { 263 | return attr("shuffle")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object standard_cauchy(TArgs&&... args) 268 | { 269 | return attr("standard_cauchy")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object standard_exponential(TArgs&&... args) 274 | { 275 | return attr("standard_exponential")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object standard_gamma(TArgs&&... args) 280 | { 281 | return attr("standard_gamma")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object standard_normal(TArgs&&... args) 286 | { 287 | return attr("standard_normal")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object standard_t(TArgs&&... args) 292 | { 293 | return attr("standard_t")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object triangular(TArgs&&... args) 298 | { 299 | return attr("triangular")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object uniform(TArgs&&... args) 304 | { 305 | return attr("uniform")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object vonmises(TArgs&&... args) 310 | { 311 | return attr("vonmises")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object wald(TArgs&&... args) 316 | { 317 | return attr("wald")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object weibull(TArgs&&... args) 322 | { 323 | return attr("weibull")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object zipf(TArgs&&... args) 328 | { 329 | return attr("zipf")(std::forward(args)...); 330 | } 331 | }; 332 | 333 | random_module import_random() 334 | { 335 | return pybind11::module::import("numpy.random"); 336 | } 337 | } 338 | } 339 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/fftpack.h: -------------------------------------------------------------------------------- 1 | // 2 | // fftpack.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class fftpack_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object cc_diff(TArgs&&... args) 22 | { 23 | return attr("cc_diff")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object cs_diff(TArgs&&... args) 28 | { 29 | return attr("cs_diff")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object dct(TArgs&&... args) 34 | { 35 | return attr("dct")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object dctn(TArgs&&... args) 40 | { 41 | return attr("dctn")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object diff(TArgs&&... args) 46 | { 47 | return attr("diff")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object dst(TArgs&&... args) 52 | { 53 | return attr("dst")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object dstn(TArgs&&... args) 58 | { 59 | return attr("dstn")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object fft(TArgs&&... args) 64 | { 65 | return attr("fft")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object fft2(TArgs&&... args) 70 | { 71 | return attr("fft2")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object fftfreq(TArgs&&... args) 76 | { 77 | return attr("fftfreq")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object fftn(TArgs&&... args) 82 | { 83 | return attr("fftn")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object fftshift(TArgs&&... args) 88 | { 89 | return attr("fftshift")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object hilbert(TArgs&&... args) 94 | { 95 | return attr("hilbert")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object idct(TArgs&&... args) 100 | { 101 | return attr("idct")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object idctn(TArgs&&... args) 106 | { 107 | return attr("idctn")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object idst(TArgs&&... args) 112 | { 113 | return attr("idst")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object idstn(TArgs&&... args) 118 | { 119 | return attr("idstn")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object ifft(TArgs&&... args) 124 | { 125 | return attr("ifft")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object ifft2(TArgs&&... args) 130 | { 131 | return attr("ifft2")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object ifftn(TArgs&&... args) 136 | { 137 | return attr("ifftn")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object ifftshift(TArgs&&... args) 142 | { 143 | return attr("ifftshift")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object ihilbert(TArgs&&... args) 148 | { 149 | return attr("ihilbert")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object irfft(TArgs&&... args) 154 | { 155 | return attr("irfft")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object itilbert(TArgs&&... args) 160 | { 161 | return attr("itilbert")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object next_fast_len(TArgs&&... args) 166 | { 167 | return attr("next_fast_len")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object rfft(TArgs&&... args) 172 | { 173 | return attr("rfft")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object rfftfreq(TArgs&&... args) 178 | { 179 | return attr("rfftfreq")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object sc_diff(TArgs&&... args) 184 | { 185 | return attr("sc_diff")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object shift(TArgs&&... args) 190 | { 191 | return attr("shift")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object ss_diff(TArgs&&... args) 196 | { 197 | return attr("ss_diff")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object tilbert(TArgs&&... args) 202 | { 203 | return attr("tilbert")(std::forward(args)...); 204 | } 205 | }; 206 | 207 | fftpack_module import_fftpack() 208 | { 209 | return pybind11::module::import("scipy.fftpack"); 210 | } 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/integrate.h: -------------------------------------------------------------------------------- 1 | // 2 | // integrate.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class integrate_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object cumtrapz(TArgs&&... args) 22 | { 23 | return attr("cumtrapz")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object dblquad(TArgs&&... args) 28 | { 29 | return attr("dblquad")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object fixed_quad(TArgs&&... args) 34 | { 35 | return attr("fixed_quad")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object newton_cotes(TArgs&&... args) 40 | { 41 | return attr("newton_cotes")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object nquad(TArgs&&... args) 46 | { 47 | return attr("nquad")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object odeint(TArgs&&... args) 52 | { 53 | return attr("odeint")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object quad(TArgs&&... args) 58 | { 59 | return attr("quad")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object quad_explain(TArgs&&... args) 64 | { 65 | return attr("quad_explain")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object quadrature(TArgs&&... args) 70 | { 71 | return attr("quadrature")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object romb(TArgs&&... args) 76 | { 77 | return attr("romb")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object romberg(TArgs&&... args) 82 | { 83 | return attr("romberg")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object simps(TArgs&&... args) 88 | { 89 | return attr("simps")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object solve_bvp(TArgs&&... args) 94 | { 95 | return attr("solve_bvp")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object solve_ivp(TArgs&&... args) 100 | { 101 | return attr("solve_ivp")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object tplquad(TArgs&&... args) 106 | { 107 | return attr("tplquad")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object trapz(TArgs&&... args) 112 | { 113 | return attr("trapz")(std::forward(args)...); 114 | } 115 | }; 116 | 117 | integrate_module import_integrate() 118 | { 119 | return pybind11::module::import("scipy.integrate"); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/interpolate.h: -------------------------------------------------------------------------------- 1 | // 2 | // interpolate.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class interpolate_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object approximate_taylor_polynomial(TArgs&&... args) 22 | { 23 | return attr("approximate_taylor_polynomial")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object barycentric_interpolate(TArgs&&... args) 28 | { 29 | return attr("barycentric_interpolate")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object bisplev(TArgs&&... args) 34 | { 35 | return attr("bisplev")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object bisplrep(TArgs&&... args) 40 | { 41 | return attr("bisplrep")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object griddata(TArgs&&... args) 46 | { 47 | return attr("griddata")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object insert(TArgs&&... args) 52 | { 53 | return attr("insert")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object interpn(TArgs&&... args) 58 | { 59 | return attr("interpn")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object krogh_interpolate(TArgs&&... args) 64 | { 65 | return attr("krogh_interpolate")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object lagrange(TArgs&&... args) 70 | { 71 | return attr("lagrange")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object make_interp_spline(TArgs&&... args) 76 | { 77 | return attr("make_interp_spline")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object make_lsq_spline(TArgs&&... args) 82 | { 83 | return attr("make_lsq_spline")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object pade(TArgs&&... args) 88 | { 89 | return attr("pade")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object pchip_interpolate(TArgs&&... args) 94 | { 95 | return attr("pchip_interpolate")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object spalde(TArgs&&... args) 100 | { 101 | return attr("spalde")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object splantider(TArgs&&... args) 106 | { 107 | return attr("splantider")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object splder(TArgs&&... args) 112 | { 113 | return attr("splder")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object splev(TArgs&&... args) 118 | { 119 | return attr("splev")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object spleval(TArgs&&... args) 124 | { 125 | return attr("spleval")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object spline(TArgs&&... args) 130 | { 131 | return attr("spline")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object splint(TArgs&&... args) 136 | { 137 | return attr("splint")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object splmake(TArgs&&... args) 142 | { 143 | return attr("splmake")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object splprep(TArgs&&... args) 148 | { 149 | return attr("splprep")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object splrep(TArgs&&... args) 154 | { 155 | return attr("splrep")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object spltopp(TArgs&&... args) 160 | { 161 | return attr("spltopp")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object sproot(TArgs&&... args) 166 | { 167 | return attr("sproot")(std::forward(args)...); 168 | } 169 | }; 170 | 171 | interpolate_module import_interpolate() 172 | { 173 | return pybind11::module::import("scipy.interpolate"); 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/io.h: -------------------------------------------------------------------------------- 1 | // 2 | // io.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class io_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object hb_read(TArgs&&... args) 22 | { 23 | return attr("hb_read")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object hb_write(TArgs&&... args) 28 | { 29 | return attr("hb_write")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object loadmat(TArgs&&... args) 34 | { 35 | return attr("loadmat")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object mminfo(TArgs&&... args) 40 | { 41 | return attr("mminfo")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object mmread(TArgs&&... args) 46 | { 47 | return attr("mmread")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object mmwrite(TArgs&&... args) 52 | { 53 | return attr("mmwrite")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object readsav(TArgs&&... args) 58 | { 59 | return attr("readsav")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object savemat(TArgs&&... args) 64 | { 65 | return attr("savemat")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object whosmat(TArgs&&... args) 70 | { 71 | return attr("whosmat")(std::forward(args)...); 72 | } 73 | }; 74 | 75 | io_module import_io() 76 | { 77 | return pybind11::module::import("scipy.io"); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/io/wavfile.h: -------------------------------------------------------------------------------- 1 | // 2 | // wavfile.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | namespace io { 16 | 17 | class wavfile_module : public pybind11::module { 18 | public: 19 | using pybind11::module::module; 20 | 21 | template 22 | pybind11::object _array_tofile(TArgs&&... args) 23 | { 24 | return attr("_array_tofile")(std::forward(args)...); 25 | } 26 | 27 | template 28 | pybind11::object _read_data_chunk(TArgs&&... args) 29 | { 30 | return attr("_read_data_chunk")(std::forward(args)...); 31 | } 32 | 33 | template 34 | pybind11::object _read_fmt_chunk(TArgs&&... args) 35 | { 36 | return attr("_read_fmt_chunk")(std::forward(args)...); 37 | } 38 | 39 | template 40 | pybind11::object _read_riff_chunk(TArgs&&... args) 41 | { 42 | return attr("_read_riff_chunk")(std::forward(args)...); 43 | } 44 | 45 | template 46 | pybind11::object _skip_unknown_chunk(TArgs&&... args) 47 | { 48 | return attr("_skip_unknown_chunk")(std::forward(args)...); 49 | } 50 | 51 | template 52 | pybind11::object read(TArgs&&... args) 53 | { 54 | return attr("read")(std::forward(args)...); 55 | } 56 | 57 | template 58 | pybind11::object write(TArgs&&... args) 59 | { 60 | return attr("write")(std::forward(args)...); 61 | } 62 | }; 63 | 64 | wavfile_module import_wavfile() 65 | { 66 | return pybind11::module::import("scipy.io.wavfile"); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/linalg.h: -------------------------------------------------------------------------------- 1 | // 2 | // linalg.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class linalg_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object block_diag(TArgs&&... args) 22 | { 23 | return attr("block_diag")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object cdf2rdf(TArgs&&... args) 28 | { 29 | return attr("cdf2rdf")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object cho_factor(TArgs&&... args) 34 | { 35 | return attr("cho_factor")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object cho_solve(TArgs&&... args) 40 | { 41 | return attr("cho_solve")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object cho_solve_banded(TArgs&&... args) 46 | { 47 | return attr("cho_solve_banded")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object cholesky(TArgs&&... args) 52 | { 53 | return attr("cholesky")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object cholesky_banded(TArgs&&... args) 58 | { 59 | return attr("cholesky_banded")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object circulant(TArgs&&... args) 64 | { 65 | return attr("circulant")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object clarkson_woodruff_transform(TArgs&&... args) 70 | { 71 | return attr("clarkson_woodruff_transform")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object companion(TArgs&&... args) 76 | { 77 | return attr("companion")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object coshm(TArgs&&... args) 82 | { 83 | return attr("coshm")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object cosm(TArgs&&... args) 88 | { 89 | return attr("cosm")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object det(TArgs&&... args) 94 | { 95 | return attr("det")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object dft(TArgs&&... args) 100 | { 101 | return attr("dft")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object diagsvd(TArgs&&... args) 106 | { 107 | return attr("diagsvd")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object eig(TArgs&&... args) 112 | { 113 | return attr("eig")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object eig_banded(TArgs&&... args) 118 | { 119 | return attr("eig_banded")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object eigh(TArgs&&... args) 124 | { 125 | return attr("eigh")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object eigh_tridiagonal(TArgs&&... args) 130 | { 131 | return attr("eigh_tridiagonal")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object eigvals(TArgs&&... args) 136 | { 137 | return attr("eigvals")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object eigvals_banded(TArgs&&... args) 142 | { 143 | return attr("eigvals_banded")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object eigvalsh(TArgs&&... args) 148 | { 149 | return attr("eigvalsh")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object eigvalsh_tridiagonal(TArgs&&... args) 154 | { 155 | return attr("eigvalsh_tridiagonal")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object expm(TArgs&&... args) 160 | { 161 | return attr("expm")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object expm_cond(TArgs&&... args) 166 | { 167 | return attr("expm_cond")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object expm_frechet(TArgs&&... args) 172 | { 173 | return attr("expm_frechet")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object find_best_blas_type(TArgs&&... args) 178 | { 179 | return attr("find_best_blas_type")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object fractional_matrix_power(TArgs&&... args) 184 | { 185 | return attr("fractional_matrix_power")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object funm(TArgs&&... args) 190 | { 191 | return attr("funm")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object get_blas_funcs(TArgs&&... args) 196 | { 197 | return attr("get_blas_funcs")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object get_lapack_funcs(TArgs&&... args) 202 | { 203 | return attr("get_lapack_funcs")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object hadamard(TArgs&&... args) 208 | { 209 | return attr("hadamard")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object hankel(TArgs&&... args) 214 | { 215 | return attr("hankel")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object helmert(TArgs&&... args) 220 | { 221 | return attr("helmert")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object hessenberg(TArgs&&... args) 226 | { 227 | return attr("hessenberg")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object hilbert(TArgs&&... args) 232 | { 233 | return attr("hilbert")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object inv(TArgs&&... args) 238 | { 239 | return attr("inv")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object invhilbert(TArgs&&... args) 244 | { 245 | return attr("invhilbert")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object invpascal(TArgs&&... args) 250 | { 251 | return attr("invpascal")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object kron(TArgs&&... args) 256 | { 257 | return attr("kron")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object ldl(TArgs&&... args) 262 | { 263 | return attr("ldl")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object leslie(TArgs&&... args) 268 | { 269 | return attr("leslie")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object logm(TArgs&&... args) 274 | { 275 | return attr("logm")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object lstsq(TArgs&&... args) 280 | { 281 | return attr("lstsq")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object lu(TArgs&&... args) 286 | { 287 | return attr("lu")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object lu_factor(TArgs&&... args) 292 | { 293 | return attr("lu_factor")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object lu_solve(TArgs&&... args) 298 | { 299 | return attr("lu_solve")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object matrix_balance(TArgs&&... args) 304 | { 305 | return attr("matrix_balance")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object norm(TArgs&&... args) 310 | { 311 | return attr("norm")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object null_space(TArgs&&... args) 316 | { 317 | return attr("null_space")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object ordqz(TArgs&&... args) 322 | { 323 | return attr("ordqz")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object orth(TArgs&&... args) 328 | { 329 | return attr("orth")(std::forward(args)...); 330 | } 331 | 332 | template 333 | pybind11::object orthogonal_procrustes(TArgs&&... args) 334 | { 335 | return attr("orthogonal_procrustes")(std::forward(args)...); 336 | } 337 | 338 | template 339 | pybind11::object pascal(TArgs&&... args) 340 | { 341 | return attr("pascal")(std::forward(args)...); 342 | } 343 | 344 | template 345 | pybind11::object pinv(TArgs&&... args) 346 | { 347 | return attr("pinv")(std::forward(args)...); 348 | } 349 | 350 | template 351 | pybind11::object pinv2(TArgs&&... args) 352 | { 353 | return attr("pinv2")(std::forward(args)...); 354 | } 355 | 356 | template 357 | pybind11::object pinvh(TArgs&&... args) 358 | { 359 | return attr("pinvh")(std::forward(args)...); 360 | } 361 | 362 | template 363 | pybind11::object polar(TArgs&&... args) 364 | { 365 | return attr("polar")(std::forward(args)...); 366 | } 367 | 368 | template 369 | pybind11::object qr(TArgs&&... args) 370 | { 371 | return attr("qr")(std::forward(args)...); 372 | } 373 | 374 | template 375 | pybind11::object qr_delete(TArgs&&... args) 376 | { 377 | return attr("qr_delete")(std::forward(args)...); 378 | } 379 | 380 | template 381 | pybind11::object qr_insert(TArgs&&... args) 382 | { 383 | return attr("qr_insert")(std::forward(args)...); 384 | } 385 | 386 | template 387 | pybind11::object qr_multiply(TArgs&&... args) 388 | { 389 | return attr("qr_multiply")(std::forward(args)...); 390 | } 391 | 392 | template 393 | pybind11::object qr_update(TArgs&&... args) 394 | { 395 | return attr("qr_update")(std::forward(args)...); 396 | } 397 | 398 | template 399 | pybind11::object qz(TArgs&&... args) 400 | { 401 | return attr("qz")(std::forward(args)...); 402 | } 403 | 404 | template 405 | pybind11::object rq(TArgs&&... args) 406 | { 407 | return attr("rq")(std::forward(args)...); 408 | } 409 | 410 | template 411 | pybind11::object rsf2csf(TArgs&&... args) 412 | { 413 | return attr("rsf2csf")(std::forward(args)...); 414 | } 415 | 416 | template 417 | pybind11::object schur(TArgs&&... args) 418 | { 419 | return attr("schur")(std::forward(args)...); 420 | } 421 | 422 | template 423 | pybind11::object signm(TArgs&&... args) 424 | { 425 | return attr("signm")(std::forward(args)...); 426 | } 427 | 428 | template 429 | pybind11::object sinhm(TArgs&&... args) 430 | { 431 | return attr("sinhm")(std::forward(args)...); 432 | } 433 | 434 | template 435 | pybind11::object sinm(TArgs&&... args) 436 | { 437 | return attr("sinm")(std::forward(args)...); 438 | } 439 | 440 | template 441 | pybind11::object solve(TArgs&&... args) 442 | { 443 | return attr("solve")(std::forward(args)...); 444 | } 445 | 446 | template 447 | pybind11::object solve_banded(TArgs&&... args) 448 | { 449 | return attr("solve_banded")(std::forward(args)...); 450 | } 451 | 452 | template 453 | pybind11::object solve_circulant(TArgs&&... args) 454 | { 455 | return attr("solve_circulant")(std::forward(args)...); 456 | } 457 | 458 | template 459 | pybind11::object solve_continuous_are(TArgs&&... args) 460 | { 461 | return attr("solve_continuous_are")(std::forward(args)...); 462 | } 463 | 464 | template 465 | pybind11::object solve_continuous_lyapunov(TArgs&&... args) 466 | { 467 | return attr("solve_continuous_lyapunov")(std::forward(args)...); 468 | } 469 | 470 | template 471 | pybind11::object solve_discrete_are(TArgs&&... args) 472 | { 473 | return attr("solve_discrete_are")(std::forward(args)...); 474 | } 475 | 476 | template 477 | pybind11::object solve_discrete_lyapunov(TArgs&&... args) 478 | { 479 | return attr("solve_discrete_lyapunov")(std::forward(args)...); 480 | } 481 | 482 | template 483 | pybind11::object solve_lyapunov(TArgs&&... args) 484 | { 485 | return attr("solve_lyapunov")(std::forward(args)...); 486 | } 487 | 488 | template 489 | pybind11::object solve_sylvester(TArgs&&... args) 490 | { 491 | return attr("solve_sylvester")(std::forward(args)...); 492 | } 493 | 494 | template 495 | pybind11::object solve_toeplitz(TArgs&&... args) 496 | { 497 | return attr("solve_toeplitz")(std::forward(args)...); 498 | } 499 | 500 | template 501 | pybind11::object solve_triangular(TArgs&&... args) 502 | { 503 | return attr("solve_triangular")(std::forward(args)...); 504 | } 505 | 506 | template 507 | pybind11::object solveh_banded(TArgs&&... args) 508 | { 509 | return attr("solveh_banded")(std::forward(args)...); 510 | } 511 | 512 | template 513 | pybind11::object sqrtm(TArgs&&... args) 514 | { 515 | return attr("sqrtm")(std::forward(args)...); 516 | } 517 | 518 | template 519 | pybind11::object subspace_angles(TArgs&&... args) 520 | { 521 | return attr("subspace_angles")(std::forward(args)...); 522 | } 523 | 524 | template 525 | pybind11::object svd(TArgs&&... args) 526 | { 527 | return attr("svd")(std::forward(args)...); 528 | } 529 | 530 | template 531 | pybind11::object svdvals(TArgs&&... args) 532 | { 533 | return attr("svdvals")(std::forward(args)...); 534 | } 535 | 536 | template 537 | pybind11::object tanhm(TArgs&&... args) 538 | { 539 | return attr("tanhm")(std::forward(args)...); 540 | } 541 | 542 | template 543 | pybind11::object tanm(TArgs&&... args) 544 | { 545 | return attr("tanm")(std::forward(args)...); 546 | } 547 | 548 | template 549 | pybind11::object toeplitz(TArgs&&... args) 550 | { 551 | return attr("toeplitz")(std::forward(args)...); 552 | } 553 | 554 | template 555 | pybind11::object tri(TArgs&&... args) 556 | { 557 | return attr("tri")(std::forward(args)...); 558 | } 559 | 560 | template 561 | pybind11::object tril(TArgs&&... args) 562 | { 563 | return attr("tril")(std::forward(args)...); 564 | } 565 | 566 | template 567 | pybind11::object triu(TArgs&&... args) 568 | { 569 | return attr("triu")(std::forward(args)...); 570 | } 571 | }; 572 | 573 | linalg_module import_linalg() 574 | { 575 | return pybind11::module::import("scipy.linalg"); 576 | } 577 | } 578 | } 579 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/ndimage.h: -------------------------------------------------------------------------------- 1 | // 2 | // ndimage.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class ndimage_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object affine_transform(TArgs&&... args) 22 | { 23 | return attr("affine_transform")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object binary_closing(TArgs&&... args) 28 | { 29 | return attr("binary_closing")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object binary_dilation(TArgs&&... args) 34 | { 35 | return attr("binary_dilation")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object binary_erosion(TArgs&&... args) 40 | { 41 | return attr("binary_erosion")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object binary_fill_holes(TArgs&&... args) 46 | { 47 | return attr("binary_fill_holes")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object binary_hit_or_miss(TArgs&&... args) 52 | { 53 | return attr("binary_hit_or_miss")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object binary_opening(TArgs&&... args) 58 | { 59 | return attr("binary_opening")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object binary_propagation(TArgs&&... args) 64 | { 65 | return attr("binary_propagation")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object black_tophat(TArgs&&... args) 70 | { 71 | return attr("black_tophat")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object center_of_mass(TArgs&&... args) 76 | { 77 | return attr("center_of_mass")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object convolve(TArgs&&... args) 82 | { 83 | return attr("convolve")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object convolve1d(TArgs&&... args) 88 | { 89 | return attr("convolve1d")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object correlate(TArgs&&... args) 94 | { 95 | return attr("correlate")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object correlate1d(TArgs&&... args) 100 | { 101 | return attr("correlate1d")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object distance_transform_bf(TArgs&&... args) 106 | { 107 | return attr("distance_transform_bf")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object distance_transform_cdt(TArgs&&... args) 112 | { 113 | return attr("distance_transform_cdt")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object distance_transform_edt(TArgs&&... args) 118 | { 119 | return attr("distance_transform_edt")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object extrema(TArgs&&... args) 124 | { 125 | return attr("extrema")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object find_objects(TArgs&&... args) 130 | { 131 | return attr("find_objects")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object fourier_ellipsoid(TArgs&&... args) 136 | { 137 | return attr("fourier_ellipsoid")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object fourier_gaussian(TArgs&&... args) 142 | { 143 | return attr("fourier_gaussian")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object fourier_shift(TArgs&&... args) 148 | { 149 | return attr("fourier_shift")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object fourier_uniform(TArgs&&... args) 154 | { 155 | return attr("fourier_uniform")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object gaussian_filter(TArgs&&... args) 160 | { 161 | return attr("gaussian_filter")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object gaussian_filter1d(TArgs&&... args) 166 | { 167 | return attr("gaussian_filter1d")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object gaussian_gradient_magnitude(TArgs&&... args) 172 | { 173 | return attr("gaussian_gradient_magnitude")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object gaussian_laplace(TArgs&&... args) 178 | { 179 | return attr("gaussian_laplace")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object generate_binary_structure(TArgs&&... args) 184 | { 185 | return attr("generate_binary_structure")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object generic_filter(TArgs&&... args) 190 | { 191 | return attr("generic_filter")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object generic_filter1d(TArgs&&... args) 196 | { 197 | return attr("generic_filter1d")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object generic_gradient_magnitude(TArgs&&... args) 202 | { 203 | return attr("generic_gradient_magnitude")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object generic_laplace(TArgs&&... args) 208 | { 209 | return attr("generic_laplace")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object geometric_transform(TArgs&&... args) 214 | { 215 | return attr("geometric_transform")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object grey_closing(TArgs&&... args) 220 | { 221 | return attr("grey_closing")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object grey_dilation(TArgs&&... args) 226 | { 227 | return attr("grey_dilation")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object grey_erosion(TArgs&&... args) 232 | { 233 | return attr("grey_erosion")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object grey_opening(TArgs&&... args) 238 | { 239 | return attr("grey_opening")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object histogram(TArgs&&... args) 244 | { 245 | return attr("histogram")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object imread(TArgs&&... args) 250 | { 251 | return attr("imread")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object iterate_structure(TArgs&&... args) 256 | { 257 | return attr("iterate_structure")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object label(TArgs&&... args) 262 | { 263 | return attr("label")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object labeled_comprehension(TArgs&&... args) 268 | { 269 | return attr("labeled_comprehension")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object laplace(TArgs&&... args) 274 | { 275 | return attr("laplace")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object map_coordinates(TArgs&&... args) 280 | { 281 | return attr("map_coordinates")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object maximum(TArgs&&... args) 286 | { 287 | return attr("maximum")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object maximum_filter(TArgs&&... args) 292 | { 293 | return attr("maximum_filter")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object maximum_filter1d(TArgs&&... args) 298 | { 299 | return attr("maximum_filter1d")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object maximum_position(TArgs&&... args) 304 | { 305 | return attr("maximum_position")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object mean(TArgs&&... args) 310 | { 311 | return attr("mean")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object median(TArgs&&... args) 316 | { 317 | return attr("median")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object median_filter(TArgs&&... args) 322 | { 323 | return attr("median_filter")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object minimum(TArgs&&... args) 328 | { 329 | return attr("minimum")(std::forward(args)...); 330 | } 331 | 332 | template 333 | pybind11::object minimum_filter(TArgs&&... args) 334 | { 335 | return attr("minimum_filter")(std::forward(args)...); 336 | } 337 | 338 | template 339 | pybind11::object minimum_filter1d(TArgs&&... args) 340 | { 341 | return attr("minimum_filter1d")(std::forward(args)...); 342 | } 343 | 344 | template 345 | pybind11::object minimum_position(TArgs&&... args) 346 | { 347 | return attr("minimum_position")(std::forward(args)...); 348 | } 349 | 350 | template 351 | pybind11::object morphological_gradient(TArgs&&... args) 352 | { 353 | return attr("morphological_gradient")(std::forward(args)...); 354 | } 355 | 356 | template 357 | pybind11::object morphological_laplace(TArgs&&... args) 358 | { 359 | return attr("morphological_laplace")(std::forward(args)...); 360 | } 361 | 362 | template 363 | pybind11::object percentile_filter(TArgs&&... args) 364 | { 365 | return attr("percentile_filter")(std::forward(args)...); 366 | } 367 | 368 | template 369 | pybind11::object prewitt(TArgs&&... args) 370 | { 371 | return attr("prewitt")(std::forward(args)...); 372 | } 373 | 374 | template 375 | pybind11::object rank_filter(TArgs&&... args) 376 | { 377 | return attr("rank_filter")(std::forward(args)...); 378 | } 379 | 380 | template 381 | pybind11::object rotate(TArgs&&... args) 382 | { 383 | return attr("rotate")(std::forward(args)...); 384 | } 385 | 386 | template 387 | pybind11::object shift(TArgs&&... args) 388 | { 389 | return attr("shift")(std::forward(args)...); 390 | } 391 | 392 | template 393 | pybind11::object sobel(TArgs&&... args) 394 | { 395 | return attr("sobel")(std::forward(args)...); 396 | } 397 | 398 | template 399 | pybind11::object spline_filter(TArgs&&... args) 400 | { 401 | return attr("spline_filter")(std::forward(args)...); 402 | } 403 | 404 | template 405 | pybind11::object spline_filter1d(TArgs&&... args) 406 | { 407 | return attr("spline_filter1d")(std::forward(args)...); 408 | } 409 | 410 | template 411 | pybind11::object standard_deviation(TArgs&&... args) 412 | { 413 | return attr("standard_deviation")(std::forward(args)...); 414 | } 415 | 416 | template 417 | pybind11::object sum(TArgs&&... args) 418 | { 419 | return attr("sum")(std::forward(args)...); 420 | } 421 | 422 | template 423 | pybind11::object uniform_filter(TArgs&&... args) 424 | { 425 | return attr("uniform_filter")(std::forward(args)...); 426 | } 427 | 428 | template 429 | pybind11::object uniform_filter1d(TArgs&&... args) 430 | { 431 | return attr("uniform_filter1d")(std::forward(args)...); 432 | } 433 | 434 | template 435 | pybind11::object variance(TArgs&&... args) 436 | { 437 | return attr("variance")(std::forward(args)...); 438 | } 439 | 440 | template 441 | pybind11::object watershed_ift(TArgs&&... args) 442 | { 443 | return attr("watershed_ift")(std::forward(args)...); 444 | } 445 | 446 | template 447 | pybind11::object white_tophat(TArgs&&... args) 448 | { 449 | return attr("white_tophat")(std::forward(args)...); 450 | } 451 | 452 | template 453 | pybind11::object zoom(TArgs&&... args) 454 | { 455 | return attr("zoom")(std::forward(args)...); 456 | } 457 | }; 458 | 459 | ndimage_module import_ndimage() 460 | { 461 | return pybind11::module::import("scipy.ndimage"); 462 | } 463 | } 464 | } 465 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/optimize.h: -------------------------------------------------------------------------------- 1 | // 2 | // optimize.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class optimize_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object anderson(TArgs&&... args) 22 | { 23 | return attr("anderson")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object approx_fprime(TArgs&&... args) 28 | { 29 | return attr("approx_fprime")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object basinhopping(TArgs&&... args) 34 | { 35 | return attr("basinhopping")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object bisect(TArgs&&... args) 40 | { 41 | return attr("bisect")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object bracket(TArgs&&... args) 46 | { 47 | return attr("bracket")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object brent(TArgs&&... args) 52 | { 53 | return attr("brent")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object brenth(TArgs&&... args) 58 | { 59 | return attr("brenth")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object brentq(TArgs&&... args) 64 | { 65 | return attr("brentq")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object broyden1(TArgs&&... args) 70 | { 71 | return attr("broyden1")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object broyden2(TArgs&&... args) 76 | { 77 | return attr("broyden2")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object brute(TArgs&&... args) 82 | { 83 | return attr("brute")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object check_grad(TArgs&&... args) 88 | { 89 | return attr("check_grad")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object curve_fit(TArgs&&... args) 94 | { 95 | return attr("curve_fit")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object diagbroyden(TArgs&&... args) 100 | { 101 | return attr("diagbroyden")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object differential_evolution(TArgs&&... args) 106 | { 107 | return attr("differential_evolution")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object excitingmixing(TArgs&&... args) 112 | { 113 | return attr("excitingmixing")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object fixed_point(TArgs&&... args) 118 | { 119 | return attr("fixed_point")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object fmin(TArgs&&... args) 124 | { 125 | return attr("fmin")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object fmin_bfgs(TArgs&&... args) 130 | { 131 | return attr("fmin_bfgs")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object fmin_cg(TArgs&&... args) 136 | { 137 | return attr("fmin_cg")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object fmin_cobyla(TArgs&&... args) 142 | { 143 | return attr("fmin_cobyla")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object fmin_l_bfgs_b(TArgs&&... args) 148 | { 149 | return attr("fmin_l_bfgs_b")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object fmin_ncg(TArgs&&... args) 154 | { 155 | return attr("fmin_ncg")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object fmin_powell(TArgs&&... args) 160 | { 161 | return attr("fmin_powell")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object fmin_slsqp(TArgs&&... args) 166 | { 167 | return attr("fmin_slsqp")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object fmin_tnc(TArgs&&... args) 172 | { 173 | return attr("fmin_tnc")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object fminbound(TArgs&&... args) 178 | { 179 | return attr("fminbound")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object fsolve(TArgs&&... args) 184 | { 185 | return attr("fsolve")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object golden(TArgs&&... args) 190 | { 191 | return attr("golden")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object least_squares(TArgs&&... args) 196 | { 197 | return attr("least_squares")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object leastsq(TArgs&&... args) 202 | { 203 | return attr("leastsq")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object line_search(TArgs&&... args) 208 | { 209 | return attr("line_search")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object linear_sum_assignment(TArgs&&... args) 214 | { 215 | return attr("linear_sum_assignment")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object linearmixing(TArgs&&... args) 220 | { 221 | return attr("linearmixing")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object linprog(TArgs&&... args) 226 | { 227 | return attr("linprog")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object linprog_verbose_callback(TArgs&&... args) 232 | { 233 | return attr("linprog_verbose_callback")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object lsq_linear(TArgs&&... args) 238 | { 239 | return attr("lsq_linear")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object minimize(TArgs&&... args) 244 | { 245 | return attr("minimize")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object minimize_scalar(TArgs&&... args) 250 | { 251 | return attr("minimize_scalar")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object newton(TArgs&&... args) 256 | { 257 | return attr("newton")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object newton_krylov(TArgs&&... args) 262 | { 263 | return attr("newton_krylov")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object nnls(TArgs&&... args) 268 | { 269 | return attr("nnls")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object ridder(TArgs&&... args) 274 | { 275 | return attr("ridder")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object root(TArgs&&... args) 280 | { 281 | return attr("root")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object rosen(TArgs&&... args) 286 | { 287 | return attr("rosen")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object rosen_der(TArgs&&... args) 292 | { 293 | return attr("rosen_der")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object rosen_hess(TArgs&&... args) 298 | { 299 | return attr("rosen_hess")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object rosen_hess_prod(TArgs&&... args) 304 | { 305 | return attr("rosen_hess_prod")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object show_options(TArgs&&... args) 310 | { 311 | return attr("show_options")(std::forward(args)...); 312 | } 313 | }; 314 | 315 | optimize_module import_optimize() 316 | { 317 | return pybind11::module::import("scipy.optimize"); 318 | } 319 | } 320 | } 321 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/signal.h: -------------------------------------------------------------------------------- 1 | // 2 | // signal.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class signal_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object abcd_normalize(TArgs&&... args) 22 | { 23 | return attr("abcd_normalize")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object argrelextrema(TArgs&&... args) 28 | { 29 | return attr("argrelextrema")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object argrelmax(TArgs&&... args) 34 | { 35 | return attr("argrelmax")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object argrelmin(TArgs&&... args) 40 | { 41 | return attr("argrelmin")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object band_stop_obj(TArgs&&... args) 46 | { 47 | return attr("band_stop_obj")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object barthann(TArgs&&... args) 52 | { 53 | return attr("barthann")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object bartlett(TArgs&&... args) 58 | { 59 | return attr("bartlett")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object bessel(TArgs&&... args) 64 | { 65 | return attr("bessel")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object besselap(TArgs&&... args) 70 | { 71 | return attr("besselap")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object bilinear(TArgs&&... args) 76 | { 77 | return attr("bilinear")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object bilinear_zpk(TArgs&&... args) 82 | { 83 | return attr("bilinear_zpk")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object blackman(TArgs&&... args) 88 | { 89 | return attr("blackman")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object blackmanharris(TArgs&&... args) 94 | { 95 | return attr("blackmanharris")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object bode(TArgs&&... args) 100 | { 101 | return attr("bode")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object bohman(TArgs&&... args) 106 | { 107 | return attr("bohman")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object boxcar(TArgs&&... args) 112 | { 113 | return attr("boxcar")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object bspline(TArgs&&... args) 118 | { 119 | return attr("bspline")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object buttap(TArgs&&... args) 124 | { 125 | return attr("buttap")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object butter(TArgs&&... args) 130 | { 131 | return attr("butter")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object buttord(TArgs&&... args) 136 | { 137 | return attr("buttord")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object cascade(TArgs&&... args) 142 | { 143 | return attr("cascade")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object cheb1ap(TArgs&&... args) 148 | { 149 | return attr("cheb1ap")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object cheb1ord(TArgs&&... args) 154 | { 155 | return attr("cheb1ord")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object cheb2ap(TArgs&&... args) 160 | { 161 | return attr("cheb2ap")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object cheb2ord(TArgs&&... args) 166 | { 167 | return attr("cheb2ord")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object chebwin(TArgs&&... args) 172 | { 173 | return attr("chebwin")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object cheby1(TArgs&&... args) 178 | { 179 | return attr("cheby1")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object cheby2(TArgs&&... args) 184 | { 185 | return attr("cheby2")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object check_COLA(TArgs&&... args) 190 | { 191 | return attr("check_COLA")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object chirp(TArgs&&... args) 196 | { 197 | return attr("chirp")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object choose_conv_method(TArgs&&... args) 202 | { 203 | return attr("choose_conv_method")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object cmplx_sort(TArgs&&... args) 208 | { 209 | return attr("cmplx_sort")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object coherence(TArgs&&... args) 214 | { 215 | return attr("coherence")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object cont2discrete(TArgs&&... args) 220 | { 221 | return attr("cont2discrete")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object convolve(TArgs&&... args) 226 | { 227 | return attr("convolve")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object convolve2d(TArgs&&... args) 232 | { 233 | return attr("convolve2d")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object correlate(TArgs&&... args) 238 | { 239 | return attr("correlate")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object correlate2d(TArgs&&... args) 244 | { 245 | return attr("correlate2d")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object cosine(TArgs&&... args) 250 | { 251 | return attr("cosine")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object csd(TArgs&&... args) 256 | { 257 | return attr("csd")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object cspline1d(TArgs&&... args) 262 | { 263 | return attr("cspline1d")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object cspline1d_eval(TArgs&&... args) 268 | { 269 | return attr("cspline1d_eval")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object cspline2d(TArgs&&... args) 274 | { 275 | return attr("cspline2d")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object cubic(TArgs&&... args) 280 | { 281 | return attr("cubic")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object cwt(TArgs&&... args) 286 | { 287 | return attr("cwt")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object daub(TArgs&&... args) 292 | { 293 | return attr("daub")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object dbode(TArgs&&... args) 298 | { 299 | return attr("dbode")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object decimate(TArgs&&... args) 304 | { 305 | return attr("decimate")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object deconvolve(TArgs&&... args) 310 | { 311 | return attr("deconvolve")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object detrend(TArgs&&... args) 316 | { 317 | return attr("detrend")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object dfreqresp(TArgs&&... args) 322 | { 323 | return attr("dfreqresp")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object dimpulse(TArgs&&... args) 328 | { 329 | return attr("dimpulse")(std::forward(args)...); 330 | } 331 | 332 | template 333 | pybind11::object dlsim(TArgs&&... args) 334 | { 335 | return attr("dlsim")(std::forward(args)...); 336 | } 337 | 338 | template 339 | pybind11::object dstep(TArgs&&... args) 340 | { 341 | return attr("dstep")(std::forward(args)...); 342 | } 343 | 344 | template 345 | pybind11::object ellip(TArgs&&... args) 346 | { 347 | return attr("ellip")(std::forward(args)...); 348 | } 349 | 350 | template 351 | pybind11::object ellipap(TArgs&&... args) 352 | { 353 | return attr("ellipap")(std::forward(args)...); 354 | } 355 | 356 | template 357 | pybind11::object ellipord(TArgs&&... args) 358 | { 359 | return attr("ellipord")(std::forward(args)...); 360 | } 361 | 362 | template 363 | pybind11::object exponential(TArgs&&... args) 364 | { 365 | return attr("exponential")(std::forward(args)...); 366 | } 367 | 368 | template 369 | pybind11::object fftconvolve(TArgs&&... args) 370 | { 371 | return attr("fftconvolve")(std::forward(args)...); 372 | } 373 | 374 | template 375 | pybind11::object filtfilt(TArgs&&... args) 376 | { 377 | return attr("filtfilt")(std::forward(args)...); 378 | } 379 | 380 | template 381 | pybind11::object find_peaks(TArgs&&... args) 382 | { 383 | return attr("find_peaks")(std::forward(args)...); 384 | } 385 | 386 | template 387 | pybind11::object find_peaks_cwt(TArgs&&... args) 388 | { 389 | return attr("find_peaks_cwt")(std::forward(args)...); 390 | } 391 | 392 | template 393 | pybind11::object findfreqs(TArgs&&... args) 394 | { 395 | return attr("findfreqs")(std::forward(args)...); 396 | } 397 | 398 | template 399 | pybind11::object firls(TArgs&&... args) 400 | { 401 | return attr("firls")(std::forward(args)...); 402 | } 403 | 404 | template 405 | pybind11::object firwin(TArgs&&... args) 406 | { 407 | return attr("firwin")(std::forward(args)...); 408 | } 409 | 410 | template 411 | pybind11::object firwin2(TArgs&&... args) 412 | { 413 | return attr("firwin2")(std::forward(args)...); 414 | } 415 | 416 | template 417 | pybind11::object flattop(TArgs&&... args) 418 | { 419 | return attr("flattop")(std::forward(args)...); 420 | } 421 | 422 | template 423 | pybind11::object freqresp(TArgs&&... args) 424 | { 425 | return attr("freqresp")(std::forward(args)...); 426 | } 427 | 428 | template 429 | pybind11::object freqs(TArgs&&... args) 430 | { 431 | return attr("freqs")(std::forward(args)...); 432 | } 433 | 434 | template 435 | pybind11::object freqs_zpk(TArgs&&... args) 436 | { 437 | return attr("freqs_zpk")(std::forward(args)...); 438 | } 439 | 440 | template 441 | pybind11::object freqz(TArgs&&... args) 442 | { 443 | return attr("freqz")(std::forward(args)...); 444 | } 445 | 446 | template 447 | pybind11::object freqz_zpk(TArgs&&... args) 448 | { 449 | return attr("freqz_zpk")(std::forward(args)...); 450 | } 451 | 452 | template 453 | pybind11::object gauss_spline(TArgs&&... args) 454 | { 455 | return attr("gauss_spline")(std::forward(args)...); 456 | } 457 | 458 | template 459 | pybind11::object gaussian(TArgs&&... args) 460 | { 461 | return attr("gaussian")(std::forward(args)...); 462 | } 463 | 464 | template 465 | pybind11::object gausspulse(TArgs&&... args) 466 | { 467 | return attr("gausspulse")(std::forward(args)...); 468 | } 469 | 470 | template 471 | pybind11::object general_gaussian(TArgs&&... args) 472 | { 473 | return attr("general_gaussian")(std::forward(args)...); 474 | } 475 | 476 | template 477 | pybind11::object get_window(TArgs&&... args) 478 | { 479 | return attr("get_window")(std::forward(args)...); 480 | } 481 | 482 | template 483 | pybind11::object group_delay(TArgs&&... args) 484 | { 485 | return attr("group_delay")(std::forward(args)...); 486 | } 487 | 488 | template 489 | pybind11::object hamming(TArgs&&... args) 490 | { 491 | return attr("hamming")(std::forward(args)...); 492 | } 493 | 494 | template 495 | pybind11::object hann(TArgs&&... args) 496 | { 497 | return attr("hann")(std::forward(args)...); 498 | } 499 | 500 | template 501 | pybind11::object hanning(TArgs&&... args) 502 | { 503 | return attr("hanning")(std::forward(args)...); 504 | } 505 | 506 | template 507 | pybind11::object hilbert(TArgs&&... args) 508 | { 509 | return attr("hilbert")(std::forward(args)...); 510 | } 511 | 512 | template 513 | pybind11::object hilbert2(TArgs&&... args) 514 | { 515 | return attr("hilbert2")(std::forward(args)...); 516 | } 517 | 518 | template 519 | pybind11::object iirdesign(TArgs&&... args) 520 | { 521 | return attr("iirdesign")(std::forward(args)...); 522 | } 523 | 524 | template 525 | pybind11::object iirfilter(TArgs&&... args) 526 | { 527 | return attr("iirfilter")(std::forward(args)...); 528 | } 529 | 530 | template 531 | pybind11::object iirnotch(TArgs&&... args) 532 | { 533 | return attr("iirnotch")(std::forward(args)...); 534 | } 535 | 536 | template 537 | pybind11::object iirpeak(TArgs&&... args) 538 | { 539 | return attr("iirpeak")(std::forward(args)...); 540 | } 541 | 542 | template 543 | pybind11::object impulse(TArgs&&... args) 544 | { 545 | return attr("impulse")(std::forward(args)...); 546 | } 547 | 548 | template 549 | pybind11::object impulse2(TArgs&&... args) 550 | { 551 | return attr("impulse2")(std::forward(args)...); 552 | } 553 | 554 | template 555 | pybind11::object invres(TArgs&&... args) 556 | { 557 | return attr("invres")(std::forward(args)...); 558 | } 559 | 560 | template 561 | pybind11::object invresz(TArgs&&... args) 562 | { 563 | return attr("invresz")(std::forward(args)...); 564 | } 565 | 566 | template 567 | pybind11::object istft(TArgs&&... args) 568 | { 569 | return attr("istft")(std::forward(args)...); 570 | } 571 | 572 | template 573 | pybind11::object kaiser(TArgs&&... args) 574 | { 575 | return attr("kaiser")(std::forward(args)...); 576 | } 577 | 578 | template 579 | pybind11::object kaiser_atten(TArgs&&... args) 580 | { 581 | return attr("kaiser_atten")(std::forward(args)...); 582 | } 583 | 584 | template 585 | pybind11::object kaiser_beta(TArgs&&... args) 586 | { 587 | return attr("kaiser_beta")(std::forward(args)...); 588 | } 589 | 590 | template 591 | pybind11::object kaiserord(TArgs&&... args) 592 | { 593 | return attr("kaiserord")(std::forward(args)...); 594 | } 595 | 596 | template 597 | pybind11::object lfilter(TArgs&&... args) 598 | { 599 | return attr("lfilter")(std::forward(args)...); 600 | } 601 | 602 | template 603 | pybind11::object lfilter_zi(TArgs&&... args) 604 | { 605 | return attr("lfilter_zi")(std::forward(args)...); 606 | } 607 | 608 | template 609 | pybind11::object lfiltic(TArgs&&... args) 610 | { 611 | return attr("lfiltic")(std::forward(args)...); 612 | } 613 | 614 | template 615 | pybind11::object lombscargle(TArgs&&... args) 616 | { 617 | return attr("lombscargle")(std::forward(args)...); 618 | } 619 | 620 | template 621 | pybind11::object lp2bp(TArgs&&... args) 622 | { 623 | return attr("lp2bp")(std::forward(args)...); 624 | } 625 | 626 | template 627 | pybind11::object lp2bp_zpk(TArgs&&... args) 628 | { 629 | return attr("lp2bp_zpk")(std::forward(args)...); 630 | } 631 | 632 | template 633 | pybind11::object lp2bs(TArgs&&... args) 634 | { 635 | return attr("lp2bs")(std::forward(args)...); 636 | } 637 | 638 | template 639 | pybind11::object lp2bs_zpk(TArgs&&... args) 640 | { 641 | return attr("lp2bs_zpk")(std::forward(args)...); 642 | } 643 | 644 | template 645 | pybind11::object lp2hp(TArgs&&... args) 646 | { 647 | return attr("lp2hp")(std::forward(args)...); 648 | } 649 | 650 | template 651 | pybind11::object lp2hp_zpk(TArgs&&... args) 652 | { 653 | return attr("lp2hp_zpk")(std::forward(args)...); 654 | } 655 | 656 | template 657 | pybind11::object lp2lp(TArgs&&... args) 658 | { 659 | return attr("lp2lp")(std::forward(args)...); 660 | } 661 | 662 | template 663 | pybind11::object lp2lp_zpk(TArgs&&... args) 664 | { 665 | return attr("lp2lp_zpk")(std::forward(args)...); 666 | } 667 | 668 | template 669 | pybind11::object lsim(TArgs&&... args) 670 | { 671 | return attr("lsim")(std::forward(args)...); 672 | } 673 | 674 | template 675 | pybind11::object lsim2(TArgs&&... args) 676 | { 677 | return attr("lsim2")(std::forward(args)...); 678 | } 679 | 680 | template 681 | pybind11::object max_len_seq(TArgs&&... args) 682 | { 683 | return attr("max_len_seq")(std::forward(args)...); 684 | } 685 | 686 | template 687 | pybind11::object medfilt(TArgs&&... args) 688 | { 689 | return attr("medfilt")(std::forward(args)...); 690 | } 691 | 692 | template 693 | pybind11::object medfilt2d(TArgs&&... args) 694 | { 695 | return attr("medfilt2d")(std::forward(args)...); 696 | } 697 | 698 | template 699 | pybind11::object minimum_phase(TArgs&&... args) 700 | { 701 | return attr("minimum_phase")(std::forward(args)...); 702 | } 703 | 704 | template 705 | pybind11::object morlet(TArgs&&... args) 706 | { 707 | return attr("morlet")(std::forward(args)...); 708 | } 709 | 710 | template 711 | pybind11::object normalize(TArgs&&... args) 712 | { 713 | return attr("normalize")(std::forward(args)...); 714 | } 715 | 716 | template 717 | pybind11::object nuttall(TArgs&&... args) 718 | { 719 | return attr("nuttall")(std::forward(args)...); 720 | } 721 | 722 | template 723 | pybind11::object order_filter(TArgs&&... args) 724 | { 725 | return attr("order_filter")(std::forward(args)...); 726 | } 727 | 728 | template 729 | pybind11::object parzen(TArgs&&... args) 730 | { 731 | return attr("parzen")(std::forward(args)...); 732 | } 733 | 734 | template 735 | pybind11::object peak_prominences(TArgs&&... args) 736 | { 737 | return attr("peak_prominences")(std::forward(args)...); 738 | } 739 | 740 | template 741 | pybind11::object peak_widths(TArgs&&... args) 742 | { 743 | return attr("peak_widths")(std::forward(args)...); 744 | } 745 | 746 | template 747 | pybind11::object periodogram(TArgs&&... args) 748 | { 749 | return attr("periodogram")(std::forward(args)...); 750 | } 751 | 752 | template 753 | pybind11::object place_poles(TArgs&&... args) 754 | { 755 | return attr("place_poles")(std::forward(args)...); 756 | } 757 | 758 | template 759 | pybind11::object qmf(TArgs&&... args) 760 | { 761 | return attr("qmf")(std::forward(args)...); 762 | } 763 | 764 | template 765 | pybind11::object qspline1d(TArgs&&... args) 766 | { 767 | return attr("qspline1d")(std::forward(args)...); 768 | } 769 | 770 | template 771 | pybind11::object qspline1d_eval(TArgs&&... args) 772 | { 773 | return attr("qspline1d_eval")(std::forward(args)...); 774 | } 775 | 776 | template 777 | pybind11::object qspline2d(TArgs&&... args) 778 | { 779 | return attr("qspline2d")(std::forward(args)...); 780 | } 781 | 782 | template 783 | pybind11::object quadratic(TArgs&&... args) 784 | { 785 | return attr("quadratic")(std::forward(args)...); 786 | } 787 | 788 | template 789 | pybind11::object remez(TArgs&&... args) 790 | { 791 | return attr("remez")(std::forward(args)...); 792 | } 793 | 794 | template 795 | pybind11::object resample(TArgs&&... args) 796 | { 797 | return attr("resample")(std::forward(args)...); 798 | } 799 | 800 | template 801 | pybind11::object resample_poly(TArgs&&... args) 802 | { 803 | return attr("resample_poly")(std::forward(args)...); 804 | } 805 | 806 | template 807 | pybind11::object residue(TArgs&&... args) 808 | { 809 | return attr("residue")(std::forward(args)...); 810 | } 811 | 812 | template 813 | pybind11::object residuez(TArgs&&... args) 814 | { 815 | return attr("residuez")(std::forward(args)...); 816 | } 817 | 818 | template 819 | pybind11::object ricker(TArgs&&... args) 820 | { 821 | return attr("ricker")(std::forward(args)...); 822 | } 823 | 824 | template 825 | pybind11::object savgol_coeffs(TArgs&&... args) 826 | { 827 | return attr("savgol_coeffs")(std::forward(args)...); 828 | } 829 | 830 | template 831 | pybind11::object savgol_filter(TArgs&&... args) 832 | { 833 | return attr("savgol_filter")(std::forward(args)...); 834 | } 835 | 836 | template 837 | pybind11::object sawtooth(TArgs&&... args) 838 | { 839 | return attr("sawtooth")(std::forward(args)...); 840 | } 841 | 842 | template 843 | pybind11::object sepfir2d(TArgs&&... args) 844 | { 845 | return attr("sepfir2d")(std::forward(args)...); 846 | } 847 | 848 | template 849 | pybind11::object slepian(TArgs&&... args) 850 | { 851 | return attr("slepian")(std::forward(args)...); 852 | } 853 | 854 | template 855 | pybind11::object sos2tf(TArgs&&... args) 856 | { 857 | return attr("sos2tf")(std::forward(args)...); 858 | } 859 | 860 | template 861 | pybind11::object sos2zpk(TArgs&&... args) 862 | { 863 | return attr("sos2zpk")(std::forward(args)...); 864 | } 865 | 866 | template 867 | pybind11::object sosfilt(TArgs&&... args) 868 | { 869 | return attr("sosfilt")(std::forward(args)...); 870 | } 871 | 872 | template 873 | pybind11::object sosfilt_zi(TArgs&&... args) 874 | { 875 | return attr("sosfilt_zi")(std::forward(args)...); 876 | } 877 | 878 | template 879 | pybind11::object sosfiltfilt(TArgs&&... args) 880 | { 881 | return attr("sosfiltfilt")(std::forward(args)...); 882 | } 883 | 884 | template 885 | pybind11::object sosfreqz(TArgs&&... args) 886 | { 887 | return attr("sosfreqz")(std::forward(args)...); 888 | } 889 | 890 | template 891 | pybind11::object spectrogram(TArgs&&... args) 892 | { 893 | return attr("spectrogram")(std::forward(args)...); 894 | } 895 | 896 | template 897 | pybind11::object spline_filter(TArgs&&... args) 898 | { 899 | return attr("spline_filter")(std::forward(args)...); 900 | } 901 | 902 | template 903 | pybind11::object square(TArgs&&... args) 904 | { 905 | return attr("square")(std::forward(args)...); 906 | } 907 | 908 | template 909 | pybind11::object ss2tf(TArgs&&... args) 910 | { 911 | return attr("ss2tf")(std::forward(args)...); 912 | } 913 | 914 | template 915 | pybind11::object ss2zpk(TArgs&&... args) 916 | { 917 | return attr("ss2zpk")(std::forward(args)...); 918 | } 919 | 920 | template 921 | pybind11::object step(TArgs&&... args) 922 | { 923 | return attr("step")(std::forward(args)...); 924 | } 925 | 926 | template 927 | pybind11::object step2(TArgs&&... args) 928 | { 929 | return attr("step2")(std::forward(args)...); 930 | } 931 | 932 | template 933 | pybind11::object stft(TArgs&&... args) 934 | { 935 | return attr("stft")(std::forward(args)...); 936 | } 937 | 938 | template 939 | pybind11::object sweep_poly(TArgs&&... args) 940 | { 941 | return attr("sweep_poly")(std::forward(args)...); 942 | } 943 | 944 | template 945 | pybind11::object symiirorder1(TArgs&&... args) 946 | { 947 | return attr("symiirorder1")(std::forward(args)...); 948 | } 949 | 950 | template 951 | pybind11::object symiirorder2(TArgs&&... args) 952 | { 953 | return attr("symiirorder2")(std::forward(args)...); 954 | } 955 | 956 | template 957 | pybind11::object tf2sos(TArgs&&... args) 958 | { 959 | return attr("tf2sos")(std::forward(args)...); 960 | } 961 | 962 | template 963 | pybind11::object tf2ss(TArgs&&... args) 964 | { 965 | return attr("tf2ss")(std::forward(args)...); 966 | } 967 | 968 | template 969 | pybind11::object tf2zpk(TArgs&&... args) 970 | { 971 | return attr("tf2zpk")(std::forward(args)...); 972 | } 973 | 974 | template 975 | pybind11::object triang(TArgs&&... args) 976 | { 977 | return attr("triang")(std::forward(args)...); 978 | } 979 | 980 | template 981 | pybind11::object tukey(TArgs&&... args) 982 | { 983 | return attr("tukey")(std::forward(args)...); 984 | } 985 | 986 | template 987 | pybind11::object unique_roots(TArgs&&... args) 988 | { 989 | return attr("unique_roots")(std::forward(args)...); 990 | } 991 | 992 | template 993 | pybind11::object unit_impulse(TArgs&&... args) 994 | { 995 | return attr("unit_impulse")(std::forward(args)...); 996 | } 997 | 998 | template 999 | pybind11::object upfirdn(TArgs&&... args) 1000 | { 1001 | return attr("upfirdn")(std::forward(args)...); 1002 | } 1003 | 1004 | template 1005 | pybind11::object vectorstrength(TArgs&&... args) 1006 | { 1007 | return attr("vectorstrength")(std::forward(args)...); 1008 | } 1009 | 1010 | template 1011 | pybind11::object welch(TArgs&&... args) 1012 | { 1013 | return attr("welch")(std::forward(args)...); 1014 | } 1015 | 1016 | template 1017 | pybind11::object wiener(TArgs&&... args) 1018 | { 1019 | return attr("wiener")(std::forward(args)...); 1020 | } 1021 | 1022 | template 1023 | pybind11::object zpk2sos(TArgs&&... args) 1024 | { 1025 | return attr("zpk2sos")(std::forward(args)...); 1026 | } 1027 | 1028 | template 1029 | pybind11::object zpk2ss(TArgs&&... args) 1030 | { 1031 | return attr("zpk2ss")(std::forward(args)...); 1032 | } 1033 | 1034 | template 1035 | pybind11::object zpk2tf(TArgs&&... args) 1036 | { 1037 | return attr("zpk2tf")(std::forward(args)...); 1038 | } 1039 | }; 1040 | 1041 | signal_module import_signal() 1042 | { 1043 | return pybind11::module::import("scipy.signal"); 1044 | } 1045 | } 1046 | } 1047 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/spatial.h: -------------------------------------------------------------------------------- 1 | // 2 | // spatial.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class spatial_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object convex_hull_plot_2d(TArgs&&... args) 22 | { 23 | return attr("convex_hull_plot_2d")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object delaunay_plot_2d(TArgs&&... args) 28 | { 29 | return attr("delaunay_plot_2d")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object distance_matrix(TArgs&&... args) 34 | { 35 | return attr("distance_matrix")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object minkowski_distance(TArgs&&... args) 40 | { 41 | return attr("minkowski_distance")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object minkowski_distance_p(TArgs&&... args) 46 | { 47 | return attr("minkowski_distance_p")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object procrustes(TArgs&&... args) 52 | { 53 | return attr("procrustes")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object tsearch(TArgs&&... args) 58 | { 59 | return attr("tsearch")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object voronoi_plot_2d(TArgs&&... args) 64 | { 65 | return attr("voronoi_plot_2d")(std::forward(args)...); 66 | } 67 | }; 68 | 69 | spatial_module import_spatial() 70 | { 71 | return pybind11::module::import("scipy.spatial"); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /include/pyscience11/scipy/stats.h: -------------------------------------------------------------------------------- 1 | // 2 | // stats.h 3 | // pyscience11 4 | // 5 | // Copyright (C) 2018 Rue Yokaze 6 | // Distributed under the MIT License. 7 | // 8 | // This header is compatible with scipy 1.1.0. 9 | // 10 | #pragma once 11 | #include 12 | 13 | namespace scipy11 { 14 | namespace scipy { 15 | 16 | class stats_module : public pybind11::module { 17 | public: 18 | using pybind11::module::module; 19 | 20 | template 21 | pybind11::object anderson(TArgs&&... args) 22 | { 23 | return attr("anderson")(std::forward(args)...); 24 | } 25 | 26 | template 27 | pybind11::object anderson_ksamp(TArgs&&... args) 28 | { 29 | return attr("anderson_ksamp")(std::forward(args)...); 30 | } 31 | 32 | template 33 | pybind11::object ansari(TArgs&&... args) 34 | { 35 | return attr("ansari")(std::forward(args)...); 36 | } 37 | 38 | template 39 | pybind11::object bartlett(TArgs&&... args) 40 | { 41 | return attr("bartlett")(std::forward(args)...); 42 | } 43 | 44 | template 45 | pybind11::object bayes_mvs(TArgs&&... args) 46 | { 47 | return attr("bayes_mvs")(std::forward(args)...); 48 | } 49 | 50 | template 51 | pybind11::object binned_statistic(TArgs&&... args) 52 | { 53 | return attr("binned_statistic")(std::forward(args)...); 54 | } 55 | 56 | template 57 | pybind11::object binned_statistic_2d(TArgs&&... args) 58 | { 59 | return attr("binned_statistic_2d")(std::forward(args)...); 60 | } 61 | 62 | template 63 | pybind11::object binned_statistic_dd(TArgs&&... args) 64 | { 65 | return attr("binned_statistic_dd")(std::forward(args)...); 66 | } 67 | 68 | template 69 | pybind11::object binom_test(TArgs&&... args) 70 | { 71 | return attr("binom_test")(std::forward(args)...); 72 | } 73 | 74 | template 75 | pybind11::object boxcox(TArgs&&... args) 76 | { 77 | return attr("boxcox")(std::forward(args)...); 78 | } 79 | 80 | template 81 | pybind11::object boxcox_llf(TArgs&&... args) 82 | { 83 | return attr("boxcox_llf")(std::forward(args)...); 84 | } 85 | 86 | template 87 | pybind11::object boxcox_normmax(TArgs&&... args) 88 | { 89 | return attr("boxcox_normmax")(std::forward(args)...); 90 | } 91 | 92 | template 93 | pybind11::object boxcox_normplot(TArgs&&... args) 94 | { 95 | return attr("boxcox_normplot")(std::forward(args)...); 96 | } 97 | 98 | template 99 | pybind11::object chi2_contingency(TArgs&&... args) 100 | { 101 | return attr("chi2_contingency")(std::forward(args)...); 102 | } 103 | 104 | template 105 | pybind11::object chisquare(TArgs&&... args) 106 | { 107 | return attr("chisquare")(std::forward(args)...); 108 | } 109 | 110 | template 111 | pybind11::object circmean(TArgs&&... args) 112 | { 113 | return attr("circmean")(std::forward(args)...); 114 | } 115 | 116 | template 117 | pybind11::object circstd(TArgs&&... args) 118 | { 119 | return attr("circstd")(std::forward(args)...); 120 | } 121 | 122 | template 123 | pybind11::object circvar(TArgs&&... args) 124 | { 125 | return attr("circvar")(std::forward(args)...); 126 | } 127 | 128 | template 129 | pybind11::object combine_pvalues(TArgs&&... args) 130 | { 131 | return attr("combine_pvalues")(std::forward(args)...); 132 | } 133 | 134 | template 135 | pybind11::object cumfreq(TArgs&&... args) 136 | { 137 | return attr("cumfreq")(std::forward(args)...); 138 | } 139 | 140 | template 141 | pybind11::object describe(TArgs&&... args) 142 | { 143 | return attr("describe")(std::forward(args)...); 144 | } 145 | 146 | template 147 | pybind11::object energy_distance(TArgs&&... args) 148 | { 149 | return attr("energy_distance")(std::forward(args)...); 150 | } 151 | 152 | template 153 | pybind11::object entropy(TArgs&&... args) 154 | { 155 | return attr("entropy")(std::forward(args)...); 156 | } 157 | 158 | template 159 | pybind11::object f_oneway(TArgs&&... args) 160 | { 161 | return attr("f_oneway")(std::forward(args)...); 162 | } 163 | 164 | template 165 | pybind11::object find_repeats(TArgs&&... args) 166 | { 167 | return attr("find_repeats")(std::forward(args)...); 168 | } 169 | 170 | template 171 | pybind11::object fisher_exact(TArgs&&... args) 172 | { 173 | return attr("fisher_exact")(std::forward(args)...); 174 | } 175 | 176 | template 177 | pybind11::object fligner(TArgs&&... args) 178 | { 179 | return attr("fligner")(std::forward(args)...); 180 | } 181 | 182 | template 183 | pybind11::object friedmanchisquare(TArgs&&... args) 184 | { 185 | return attr("friedmanchisquare")(std::forward(args)...); 186 | } 187 | 188 | template 189 | pybind11::object gmean(TArgs&&... args) 190 | { 191 | return attr("gmean")(std::forward(args)...); 192 | } 193 | 194 | template 195 | pybind11::object hmean(TArgs&&... args) 196 | { 197 | return attr("hmean")(std::forward(args)...); 198 | } 199 | 200 | template 201 | pybind11::object iqr(TArgs&&... args) 202 | { 203 | return attr("iqr")(std::forward(args)...); 204 | } 205 | 206 | template 207 | pybind11::object itemfreq(TArgs&&... args) 208 | { 209 | return attr("itemfreq")(std::forward(args)...); 210 | } 211 | 212 | template 213 | pybind11::object jarque_bera(TArgs&&... args) 214 | { 215 | return attr("jarque_bera")(std::forward(args)...); 216 | } 217 | 218 | template 219 | pybind11::object kendalltau(TArgs&&... args) 220 | { 221 | return attr("kendalltau")(std::forward(args)...); 222 | } 223 | 224 | template 225 | pybind11::object kruskal(TArgs&&... args) 226 | { 227 | return attr("kruskal")(std::forward(args)...); 228 | } 229 | 230 | template 231 | pybind11::object ks_2samp(TArgs&&... args) 232 | { 233 | return attr("ks_2samp")(std::forward(args)...); 234 | } 235 | 236 | template 237 | pybind11::object kstat(TArgs&&... args) 238 | { 239 | return attr("kstat")(std::forward(args)...); 240 | } 241 | 242 | template 243 | pybind11::object kstatvar(TArgs&&... args) 244 | { 245 | return attr("kstatvar")(std::forward(args)...); 246 | } 247 | 248 | template 249 | pybind11::object kstest(TArgs&&... args) 250 | { 251 | return attr("kstest")(std::forward(args)...); 252 | } 253 | 254 | template 255 | pybind11::object kurtosis(TArgs&&... args) 256 | { 257 | return attr("kurtosis")(std::forward(args)...); 258 | } 259 | 260 | template 261 | pybind11::object kurtosistest(TArgs&&... args) 262 | { 263 | return attr("kurtosistest")(std::forward(args)...); 264 | } 265 | 266 | template 267 | pybind11::object levene(TArgs&&... args) 268 | { 269 | return attr("levene")(std::forward(args)...); 270 | } 271 | 272 | template 273 | pybind11::object linregress(TArgs&&... args) 274 | { 275 | return attr("linregress")(std::forward(args)...); 276 | } 277 | 278 | template 279 | pybind11::object mannwhitneyu(TArgs&&... args) 280 | { 281 | return attr("mannwhitneyu")(std::forward(args)...); 282 | } 283 | 284 | template 285 | pybind11::object median_test(TArgs&&... args) 286 | { 287 | return attr("median_test")(std::forward(args)...); 288 | } 289 | 290 | template 291 | pybind11::object mode(TArgs&&... args) 292 | { 293 | return attr("mode")(std::forward(args)...); 294 | } 295 | 296 | template 297 | pybind11::object moment(TArgs&&... args) 298 | { 299 | return attr("moment")(std::forward(args)...); 300 | } 301 | 302 | template 303 | pybind11::object mood(TArgs&&... args) 304 | { 305 | return attr("mood")(std::forward(args)...); 306 | } 307 | 308 | template 309 | pybind11::object mvsdist(TArgs&&... args) 310 | { 311 | return attr("mvsdist")(std::forward(args)...); 312 | } 313 | 314 | template 315 | pybind11::object normaltest(TArgs&&... args) 316 | { 317 | return attr("normaltest")(std::forward(args)...); 318 | } 319 | 320 | template 321 | pybind11::object obrientransform(TArgs&&... args) 322 | { 323 | return attr("obrientransform")(std::forward(args)...); 324 | } 325 | 326 | template 327 | pybind11::object pearsonr(TArgs&&... args) 328 | { 329 | return attr("pearsonr")(std::forward(args)...); 330 | } 331 | 332 | template 333 | pybind11::object percentileofscore(TArgs&&... args) 334 | { 335 | return attr("percentileofscore")(std::forward(args)...); 336 | } 337 | 338 | template 339 | pybind11::object pointbiserialr(TArgs&&... args) 340 | { 341 | return attr("pointbiserialr")(std::forward(args)...); 342 | } 343 | 344 | template 345 | pybind11::object power_divergence(TArgs&&... args) 346 | { 347 | return attr("power_divergence")(std::forward(args)...); 348 | } 349 | 350 | template 351 | pybind11::object ppcc_max(TArgs&&... args) 352 | { 353 | return attr("ppcc_max")(std::forward(args)...); 354 | } 355 | 356 | template 357 | pybind11::object ppcc_plot(TArgs&&... args) 358 | { 359 | return attr("ppcc_plot")(std::forward(args)...); 360 | } 361 | 362 | template 363 | pybind11::object probplot(TArgs&&... args) 364 | { 365 | return attr("probplot")(std::forward(args)...); 366 | } 367 | 368 | template 369 | pybind11::object rankdata(TArgs&&... args) 370 | { 371 | return attr("rankdata")(std::forward(args)...); 372 | } 373 | 374 | template 375 | pybind11::object ranksums(TArgs&&... args) 376 | { 377 | return attr("ranksums")(std::forward(args)...); 378 | } 379 | 380 | template 381 | pybind11::object relfreq(TArgs&&... args) 382 | { 383 | return attr("relfreq")(std::forward(args)...); 384 | } 385 | 386 | template 387 | pybind11::object scoreatpercentile(TArgs&&... args) 388 | { 389 | return attr("scoreatpercentile")(std::forward(args)...); 390 | } 391 | 392 | template 393 | pybind11::object sem(TArgs&&... args) 394 | { 395 | return attr("sem")(std::forward(args)...); 396 | } 397 | 398 | template 399 | pybind11::object shapiro(TArgs&&... args) 400 | { 401 | return attr("shapiro")(std::forward(args)...); 402 | } 403 | 404 | template 405 | pybind11::object sigmaclip(TArgs&&... args) 406 | { 407 | return attr("sigmaclip")(std::forward(args)...); 408 | } 409 | 410 | template 411 | pybind11::object skew(TArgs&&... args) 412 | { 413 | return attr("skew")(std::forward(args)...); 414 | } 415 | 416 | template 417 | pybind11::object skewtest(TArgs&&... args) 418 | { 419 | return attr("skewtest")(std::forward(args)...); 420 | } 421 | 422 | template 423 | pybind11::object spearmanr(TArgs&&... args) 424 | { 425 | return attr("spearmanr")(std::forward(args)...); 426 | } 427 | 428 | template 429 | pybind11::object theilslopes(TArgs&&... args) 430 | { 431 | return attr("theilslopes")(std::forward(args)...); 432 | } 433 | 434 | template 435 | pybind11::object tiecorrect(TArgs&&... args) 436 | { 437 | return attr("tiecorrect")(std::forward(args)...); 438 | } 439 | 440 | template 441 | pybind11::object tmax(TArgs&&... args) 442 | { 443 | return attr("tmax")(std::forward(args)...); 444 | } 445 | 446 | template 447 | pybind11::object tmean(TArgs&&... args) 448 | { 449 | return attr("tmean")(std::forward(args)...); 450 | } 451 | 452 | template 453 | pybind11::object tmin(TArgs&&... args) 454 | { 455 | return attr("tmin")(std::forward(args)...); 456 | } 457 | 458 | template 459 | pybind11::object trim1(TArgs&&... args) 460 | { 461 | return attr("trim1")(std::forward(args)...); 462 | } 463 | 464 | template 465 | pybind11::object trim_mean(TArgs&&... args) 466 | { 467 | return attr("trim_mean")(std::forward(args)...); 468 | } 469 | 470 | template 471 | pybind11::object trimboth(TArgs&&... args) 472 | { 473 | return attr("trimboth")(std::forward(args)...); 474 | } 475 | 476 | template 477 | pybind11::object tsem(TArgs&&... args) 478 | { 479 | return attr("tsem")(std::forward(args)...); 480 | } 481 | 482 | template 483 | pybind11::object tstd(TArgs&&... args) 484 | { 485 | return attr("tstd")(std::forward(args)...); 486 | } 487 | 488 | template 489 | pybind11::object ttest_1samp(TArgs&&... args) 490 | { 491 | return attr("ttest_1samp")(std::forward(args)...); 492 | } 493 | 494 | template 495 | pybind11::object ttest_ind(TArgs&&... args) 496 | { 497 | return attr("ttest_ind")(std::forward(args)...); 498 | } 499 | 500 | template 501 | pybind11::object ttest_ind_from_stats(TArgs&&... args) 502 | { 503 | return attr("ttest_ind_from_stats")(std::forward(args)...); 504 | } 505 | 506 | template 507 | pybind11::object ttest_rel(TArgs&&... args) 508 | { 509 | return attr("ttest_rel")(std::forward(args)...); 510 | } 511 | 512 | template 513 | pybind11::object tvar(TArgs&&... args) 514 | { 515 | return attr("tvar")(std::forward(args)...); 516 | } 517 | 518 | template 519 | pybind11::object variation(TArgs&&... args) 520 | { 521 | return attr("variation")(std::forward(args)...); 522 | } 523 | 524 | template 525 | pybind11::object wasserstein_distance(TArgs&&... args) 526 | { 527 | return attr("wasserstein_distance")(std::forward(args)...); 528 | } 529 | 530 | template 531 | pybind11::object weightedtau(TArgs&&... args) 532 | { 533 | return attr("weightedtau")(std::forward(args)...); 534 | } 535 | 536 | template 537 | pybind11::object wilcoxon(TArgs&&... args) 538 | { 539 | return attr("wilcoxon")(std::forward(args)...); 540 | } 541 | 542 | template 543 | pybind11::object zmap(TArgs&&... args) 544 | { 545 | return attr("zmap")(std::forward(args)...); 546 | } 547 | 548 | template 549 | pybind11::object zscore(TArgs&&... args) 550 | { 551 | return attr("zscore")(std::forward(args)...); 552 | } 553 | }; 554 | 555 | stats_module import_stats() 556 | { 557 | return pybind11::module::import("scipy.stats"); 558 | } 559 | } 560 | } 561 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | default: 2 | python3 generator/generator.py 3 | 4 | tidy: 5 | flake8 6 | find . -name *.h | xargs clang-format -i 7 | find . -name *.cpp | xargs clang-format -i 8 | 9 | wheel: 10 | python3 setup.py bdist_wheel 11 | 12 | clean: 13 | rm dist/*.whl 14 | -------------------------------------------------------------------------------- /pyscience11/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Rue Yokaze 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pyscience11/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yokaze/pyscience11/b385505eaa470cb6d6c73e20a06751577cbec664/pyscience11/__init__.py -------------------------------------------------------------------------------- /pyscience11/original_license/MATPLOTLIB_LICENSE: -------------------------------------------------------------------------------- 1 | https://matplotlib.org/users/license.html 2 | 3 | License agreement for matplotlib 2.2.2 4 | 1. This LICENSE AGREEMENT is between the Matplotlib Development Team (“MDT”), and the Individual or Organization (“Licensee”) accessing and otherwise using matplotlib software in source or binary form and its associated documentation. 5 | 6 | 2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib 2.2.2 alone or in any derivative version, provided, however, that MDT’s License Agreement and MDT’s notice of copyright, i.e., “Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved” are retained in matplotlib 2.2.2 alone or in any derivative version prepared by Licensee. 7 | 8 | 3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib 2.2.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib 2.2.2. 9 | 10 | 4. MDT is making matplotlib 2.2.2 available to Licensee on an “AS IS” basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 2.2.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 11 | 12 | 5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB 2.2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB 2.2.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 13 | 14 | 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 15 | 16 | 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 17 | 18 | 8. By copying, installing or otherwise using matplotlib 2.2.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. 19 | -------------------------------------------------------------------------------- /pyscience11/original_license/NUMPY_LICENSE: -------------------------------------------------------------------------------- 1 | http://www.numpy.org/license.html 2 | 3 | Numpy License 4 | 5 | Copyright © 2005-2017, NumPy Developers. 6 | All rights reserved. 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8 | 9 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 11 | Neither the name of the NumPy Developers nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | -------------------------------------------------------------------------------- /pyscience11/original_license/SCIPY_LICENSE: -------------------------------------------------------------------------------- 1 | https://www.scipy.org/scipylib/license.html 2 | 3 | SciPy license 4 | 5 | Copyright © 2001, 2002 Enthought, Inc. 6 | All rights reserved. 7 | 8 | Copyright © 2003-2013 SciPy Developers. 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 11 | 12 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 13 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | Neither the name of Enthought nor the names of the SciPy Developers may be used to endorse or promote products derived from this software without specific prior written permission. 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.command.install_headers import install_headers 2 | from pathlib import Path 3 | from setuptools import setup 4 | 5 | 6 | class pyscience11_install_headers(install_headers): 7 | def run(self): 8 | headers = self.distribution.headers 9 | if not headers: 10 | return 11 | 12 | for header in headers: 13 | source_header_path = Path(header).relative_to('include/pyscience11') 14 | install_path = Path(self.install_dir)/source_header_path 15 | install_dir = str(install_path.parent) 16 | self.mkpath(install_dir) 17 | 18 | (out, _) = self.copy_file(header, install_dir) 19 | self.outfiles.append(out) 20 | 21 | 22 | headers = [ 23 | 'include/pyscience11/matplotlib/pyplot.h', 24 | 'include/pyscience11/numpy/dual.h', 25 | 'include/pyscience11/numpy/fft.h', 26 | 'include/pyscience11/numpy/linalg.h', 27 | 'include/pyscience11/numpy/random.h', 28 | 'include/pyscience11/scipy/io/wavfile.h', 29 | 'include/pyscience11/scipy/fftpack.h', 30 | 'include/pyscience11/scipy/integrate.h', 31 | 'include/pyscience11/scipy/interpolate.h', 32 | 'include/pyscience11/scipy/io.h', 33 | 'include/pyscience11/scipy/linalg.h', 34 | 'include/pyscience11/scipy/ndimage.h', 35 | 'include/pyscience11/scipy/optimize.h', 36 | 'include/pyscience11/scipy/signal.h', 37 | 'include/pyscience11/scipy/spatial.h', 38 | 'include/pyscience11/scipy/special.h', 39 | 'include/pyscience11/scipy/stats.h', 40 | 'include/pyscience11/matplotlib.h', 41 | 'include/pyscience11/numpy.h', 42 | 'include/pyscience11/scipy.h', 43 | ] 44 | 45 | # Fields are ordered: https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata 46 | # Classifiers: https://pypi.org/pypi?%3Aaction=list_classifiers 47 | setup( 48 | name='pyscience11', 49 | version='0.5', 50 | url='https://github.com/yokaze/pyscience11', 51 | author='Rue Yokaze', 52 | author_email='yokaze.rue@gmail.com', 53 | classifiers=[ 54 | 'Development Status :: 3 - Alpha', 55 | 'Intended Audience :: Science/Research', 56 | 'License :: OSI Approved :: MIT License', 57 | 'Programming Language :: C++', 58 | 'Programming Language :: Python :: 3', 59 | 'Programming Language :: Python :: 3.6', 60 | ], 61 | license='MIT', 62 | description='C++11 wrapper for NumPy, SciPy and Matplotlib', 63 | long_description='C++11 wrapper for NumPy, SciPy and Matplotlib', 64 | keywords=['C++', 'pybind11', 'numpy', 'scipy', 'matplotlib'], 65 | packages=['pyscience11'], 66 | package_data={ 67 | '': [ 68 | 'LICENSE', 69 | 'original_license/MATPLOTLIB_LICENSE', 70 | 'original_license/NUMPY_LICENSE', 71 | 'original_license/SCIPY_LICENSE' 72 | ], 73 | }, 74 | headers=headers, 75 | cmdclass={'install_headers': pyscience11_install_headers}, 76 | ) 77 | --------------------------------------------------------------------------------