Skip to content Skip to sidebar Skip to footer
Showing posts with the label Cython

Passing And Returning Numpy Arrays To C++ Methods Via Cython

There are lots of questions about using numpy in cython on this site, a particularly useful one bei… Read more Passing And Returning Numpy Arrays To C++ Methods Via Cython

Pep-484 Type Annotations With Own Types

PEP-484 provides semantics for type annotations. These are geared very much towards a) documentatio… Read more Pep-484 Type Annotations With Own Types

Libpython2.7.a Missing Many References

I'm trying to compile a cython module with -static, but I am getting a lot of errors about miss… Read more Libpython2.7.a Missing Many References

Passing Memoryview To C Function

I have a C function declared as follows: void getIndexOfState(long *p, long C, long G, long B, long… Read more Passing Memoryview To C Function

Fastest Way To Compute Distance Beetween Each Points In Python

In my project I need to compute euclidian distance beetween each points stored in an array. The ent… Read more Fastest Way To Compute Distance Beetween Each Points In Python

Strange Segmentation Fault In Pyarray_simplenewfromdata

My question is similar 'in spirit' to Segmentation fault in PyArray_SimpleNewFromData I hav… Read more Strange Segmentation Fault In Pyarray_simplenewfromdata

Cython - Iterate Through Map

I was wondering if this was possible to iterate through a map directly in Cython code, ie, in the .… Read more Cython - Iterate Through Map

"typeerror: __cinit__() Takes Exactly 8 Positional Arguments (3 Given)" When Loading Sklearn Pickle

I have a Flask app on pythonanywhere (Python 2.7) that needs to load a pickle file containing a mac… Read more "typeerror: __cinit__() Takes Exactly 8 Positional Arguments (3 Given)" When Loading Sklearn Pickle

How To Deallocate A Typed Numpy Array? Is Setting Callback_free_data A Viable Option?

While using an open source Cython library I found a memory leak. The leak seems to come from a type… Read more How To Deallocate A Typed Numpy Array? Is Setting Callback_free_data A Viable Option?

How Can A #defined C Value Be Exposed To Python In A Cython Module?

I'd like to make the integer constants (ACTIVE_TAG, etc) defined here: //island management, m_a… Read more How Can A #defined C Value Be Exposed To Python In A Cython Module?

Efficient Matrix Operations In Cython With No Python Objects

I'm writing a function that I'd like to translate to C as much as possible using Cython. To… Read more Efficient Matrix Operations In Cython With No Python Objects

Buffer Types Only Allowed As Function Local Variables, But That's What I'm Doing

Cython doesn't like numpy arrays in closures? %%cython import numpy as np cimport numpy as np … Read more Buffer Types Only Allowed As Function Local Variables, But That's What I'm Doing

Python Setuptools: How Can I Install Package With Cython Submodules?

I have a python package named pytools. It contains a cython-based submodule nms. When I install the… Read more Python Setuptools: How Can I Install Package With Cython Submodules?

How To Expose A Constexpr To Cython?

A file Globals.h contains the following definition of a constant: namespace MyNameSpace { /** Cons… Read more How To Expose A Constexpr To Cython?

Can't Redirect Error Stream From Cython

The SFML library that I'm trying to cythonize defines this function below that allows to change… Read more Can't Redirect Error Stream From Cython

Specify Cython Output File

It seems that by default setup from distutils.core with cmdclass set to build_ext, compiles a cpp … Read more Specify Cython Output File

Passing 3d Numpy Array From Cython To C++

I recently used cython to speedup an application, and now struggle with passing a 3D numpy array fr… Read more Passing 3d Numpy Array From Cython To C++

Building Python Package Containing Multiple Cython Extensions

I have the following directory structure: testcython/ setup.py testcython/ __init__… Read more Building Python Package Containing Multiple Cython Extensions

Initialise Cython Memoryview Efficiently

I'm currently setting my MemoryViews in my Cython pyx file as follows: @cython.boundscheck(Fals… Read more Initialise Cython Memoryview Efficiently

How Write Code And Run Python's Files Using Spacy? (using Windows)

I want to implement a new model language for spaCY. I have installed spaCy (using the guide of the … Read more How Write Code And Run Python's Files Using Spacy? (using Windows)