Questions tagged [pythran]

Pythran is a Python-subset-to-C++-transcompiler, geared towards speeding up scientific programs by using available processor-level parallelism.

Pythran transcompiles Python modules written in a subset of the Python language and annotated with some interface description to to system-native (C++) code. The result is a new Python module wrapping the generated C++ code, with the same interface as the original module.

The aim of this conversion is a runtime speedup due to

  • system-native instead of interpreted/JiT-compiled code
  • usage of multiple cores
  • usage of units

Pythran is geared towards scientific programs.

25 questions
0
votes
1 answer

How to indicate a list of dicts in pythran?

I don't know how to indicate a list of dicts in Pythran. Say I call the function dictest() in a pure python file. A list of dicts (here: ll) need to be provided as arguments: import test_pythran as tp dd = { "ux": 10.0, "uy": 5, …
Martin R
  • 31
  • 2
0
votes
1 answer

Access files generated in the backend

I'm a beginner. I started exploring Pythran and Transonic a few days back. I learned that Pythran generates a C++ file from the Python input file. I want to read those C++ generated files in the backend. Do anyone of you have any idea about…
0
votes
1 answer

Erroneous SciPy 1.7 source build

When installing SciPy 1.7.1 from source on Linux using python setup.py build python setup.py install (along with environment and site.cfg hacking as needed) I end up with a broken build. My particular build recipe works for SciPy <= 1.6 Once SciPy…
jmd_dk
  • 12,125
  • 9
  • 63
  • 94
0
votes
1 answer

How can I ensure and confirm that the scipy package I installed has pythran optimized functions available?

How can I ensure and confirm that the SciPy package I installed has pythran optimized functions available? I am installing python 3.9.5 from python software foundation website, using PyCharm IDE for package management that uses pip to set up…
ahsabali
  • 39
  • 1
0
votes
1 answer

Pythran "undefined reference to `ATL_caxpby'" error

I've installed pythran as per instruction: sudo apt-get install libatlas-base-dev sudo apt-get install python-dev python-ply python-networkx python-numpy pip install pythran I have pythran==0.9.7, gast==0.4.0, g++==5.5.0, ubuntu 16.04 Trying to run…
Viktoriya Malyasova
  • 1,343
  • 1
  • 11
  • 25
0
votes
1 answer

Pythran cannot find vcvarsall.bat

I installed the Python library Pythran on a Windows machine using 'pip install pythran', and got no error. But when trying to compile a function using 'pythran functionName.py' I get the following result: pythran functionName.py WARNING: Failed to…
0
votes
0 answers

Regular expression to find function definitions in Python file

I have a python project with function definitions written in CamelCase style. I'm trying to write a script to convert them to snake_case style. CaseFormatter class import re class CaseFormatter: def __init__(self, file_directory): …
Ali.Wassouf
  • 309
  • 4
  • 21
0
votes
1 answer

import pythran module in a python packages with PythranExtension

I try to make a python package using the excellent pythran. With this file structure $ tree ../proj ../proj ├── ccompile.py ├── Makefile ├── proj │   ├── __init__.py │   └── lib.py └── setup.py My pythran stuff is in ccompile.py: $ cat…
user3313834
  • 7,327
  • 12
  • 56
  • 99
0
votes
1 answer

Pythran export dict with tuples as key

I try to use Pythran in a function that needs an int array and for the second arg a dict with tuples of ints as keys and an int as value: myarray = np.array([[0, 0], [0, 1], [1, 1], [1, 2], [2, 2], [1, 3]]) dict_with_tuples_key…
user3313834
  • 7,327
  • 12
  • 56
  • 99
-2
votes
1 answer

how to use pythran add a myfunction from other py files?

toolsTep.py def HelloWord(): print('hello word') testpythran.py from calaTools.toolsTep import * #pythran export callOtherPyFiles() def callOtherPyFiles(): HelloWord() complie pythran testpythran.py CRITICAL : I am in trouble. Your input…
杨钰德
  • 1
  • 1
1
2