cython Questions

3

Solved

Would compiling with cython work with a python 3.4 Django app, or could it be made to work without a huge amount of effort? This answer - https://mcmap.net/q/49562/-how-do-i-protect-python-code-fr...
Edmanda asked 15/9, 2015 at 4:42

3

I'm trying to install pyclipper to use with nototools. https://github.com/googlefonts/nototools But I can't get pyclipper installed. I think there is something with Visual Studio buildtools. Collec...
Ingeminate asked 27/12, 2020 at 2:55

2

Solved

Is there any way to use pep8 with cython files? pep8 does not work with operators for example. getline(& line) produces error: E225 missing whitespace around operator Now if i try to fix...
Aime asked 7/7, 2015 at 13:11

18

I was trying to compile a simple .pyx file using Cython. print("hello") Here's my setup.py: from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize(...
Emir asked 13/10, 2016 at 10:25

5

I am trying to create a new column in a dataframe based on pairs of information and its previous values. Although the code that I run is correct, and gives the results I need, it is very slow when ...
Segal asked 12/2, 2020 at 18:38

1

With the latest version of setuptools, the python setup.py install command is being deprecated (see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for more info). (venv) [jon@dev...
Holmun asked 3/2, 2022 at 11:57

5

Solved

What is the most efficient and portable way to generate a random random in [0,1] in Cython? One approach is to use INT_MAX and rand() from the C library: from libc.stdlib cimport rand cdef extern ...
Aekerly asked 22/4, 2013 at 1:25

2

Solved

When trying to install a certain Python geophysical toolkit, I get this error: LINK : fatal error LNK1181: cannot open input file 'm.lib' I believe it is due to my use of the MSVC's buildtools...
Clotilda asked 12/10, 2013 at 11:54

2

I have this file em.pyx in the same folder as the Jupyter notebook where I try to import it but it is giving me the error ImportError: No module named em I've tried adding import sys sys.path...
Angelia asked 21/3, 2019 at 14:34

4

Solved

I have a Cython module that I would like to lint PEP8 style, however pylint syntax errors on Cython cdef syntax. Does anyone have a suggestion about how to maintain Python coding standards for Cyth...
Savitt asked 27/8, 2014 at 19:35

1

I am starting to compile my Python 3 project with Cython, and I would like to know if it's possible to reduce my current compile time workflow to a single instruction. This is my setup.py as of no...
Patin asked 19/10, 2017 at 6:50

3

Solved

As suggested here, I have succesfully installed Microsoft Visual C++ Compiler for Python 2.7 to compile some Cython code, but: from distutils.core import setup from Cython.Build import cythonize s...
Nympholepsy asked 6/11, 2018 at 13:10

4

Solved

Been playing with cython. Normally program in Python, but used C in a previous life. I can't figure out how to make a free-standing executable. I've downloaded cython, and I can make a .pyx file (...
Fibrinolysin asked 19/3, 2014 at 13:35

1

Solved

In an external library is a macro to a type: typedef TCHAR MY_TYPE; #define MY_MACRO_TYPE MY_TYPE; At any place in the library the macro is used instead of the type. So how can I provide this mac...
Drop asked 17/8, 2022 at 8:0

1

Solved

I want to implement some fast convex analysis operations - proximal operators and the like. I'm new to Cython and thought that this would be the right tool for the job. I have implementations both ...
Capability asked 14/8, 2022 at 17:16

1

I'm in the process of writing a Cython wrapper for a complex C++ library. I think I've mostly figured out how to write the necessary .pxd and .pyx files. My problem now is that although my C++ prog...
Beech asked 12/1, 2015 at 3:9

3

Is there anyway to access the underlying structures in cython/c++ for polars? I have a number of scripts that grab np.ndarrays and iterates. Is there anything similar for polars?
Lucilius asked 24/7, 2022 at 22:28

3

I am trying to generate javascript from python using cython and emscripten. hello.py: print 'Hello world.' Then I compile this to c using cython >>> cython --embed hello.py -v This...
Holofernes asked 12/6, 2013 at 11:15

2

Solved

I'm using Cython in --embed mode to produce a .exe. I'm evaluating the Minimal set of files required to distribute an embed-Cython-compiled code and make it work on any machine. To do this, I only ...

0

The Numba documentation describes how to import a Cython function by creating a ctypes.CFUNCTYPE. However, the Cython function in the example only takes a scalar argument. I have a Cython function ...
Geography asked 6/7, 2022 at 21:3

2

I have to write a small simulation in cython, which is usually accelerated with numba. But I have to make this transition, since numba didn't support a scipy function which I wanted to use for modi...
Bergamo asked 30/6, 2022 at 15:50

3

Solved

I am a bit struggled with so many int data types in cython. np.int, np.int_, np.int_t, int I guess int in pure python is equivalent to np.int_, then where does np.int come from? I cannot find the...
Toneytong asked 18/2, 2014 at 11:11

3

Solved

I have a c program(.c file). I am converting that to a shared object(.so). How can i call and run the shared object from my python code? If possible, please suggest me a list of libraries that can ...
Overbite asked 22/2, 2018 at 4:36

1

My code structure is as follows: myMLCode │ ├── main.py ├── ML_lib | ├── __init__.py │ └── core.py | └── set1 | ├── __init__.py │ └── mymod1.py │ └── mymod2.py | └── set2 | ├── __init__.py │ └── ...
Therapeutics asked 12/5, 2021 at 10:42

1

Solved

When we write Cython code (with types), this will eventually be compiled like C-compiled code and we can't recover the source code (except disassembling but then this is similar to disassembling C ...
Dogface asked 17/5, 2022 at 13:49

© 2022 - 2024 — McMap. All rights reserved.