Skip to content

Commit

Permalink
Merge branch 'topic/default/maintain' into 'branch/default'
Browse files Browse the repository at this point in the history
Maintain: format and doc

See merge request fluiddyn/transonic!139
  • Loading branch information
paugier committed Jun 5, 2024
2 parents f5dc91a + f57191a commit a144c88
Show file tree
Hide file tree
Showing 126 changed files with 547 additions and 547 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: prefix-dev/setup-pixi@v0.4.1
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.11.1
pixi-version: v0.23.0
cache: false
- name: Tests
run: |
Expand Down
31 changes: 14 additions & 17 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ See also the

## [0.6.0] (2024-01-16)

- Support for
[Meson build](https://transonic.readthedocs.io/en/latest/packaging.html) through
`transonic --meson` and multi-backends
- Support for [Meson build](https://transonic.readthedocs.io/en/latest/packaging.html)
through `transonic --meson` and multi-backends
- Support for Python 3.12

## [0.5.3] (2023-08-21)

- [!110](https://foss.heptapod.net/fluiddyn/transonic/-/merge_requests/110) Quick
fix autopep8 bug + fix CI (py3.9)
- [!110](https://foss.heptapod.net/fluiddyn/transonic/-/merge_requests/110) Quick fix
autopep8 bug + fix CI (py3.9)

## [0.5.2] (2022-01-04)

Expand Down Expand Up @@ -62,8 +61,8 @@ See also the

## 0.4.9 (2021-07-02)

- Avoid new Gast and Beniget versions by pinning to the previous versions (0.4.0
and 0.3.0). No Python 3.10 support!
- Avoid new Gast and Beniget versions by pinning to the previous versions (0.4.0 and
0.3.0). No Python 3.10 support!

## 0.4.8 (2021-05-03)

Expand Down Expand Up @@ -99,8 +98,7 @@ See also the

## 0.4.1 (2019-10-08)

- Cython backend: less bugs, better support for fused types, nonecheck, cdivision,
...
- Cython backend: less bugs, better support for fused types, nonecheck, cdivision, ...
- Fix default parameters for Pythran

## 0.4.0 (2019-09-22)
Expand Down Expand Up @@ -137,10 +135,9 @@ See also the

- Support source in multiple files
([#14](https://foss.heptapod.net/fluiddyn/transonic/issues/14) and #21)
- Fix issues #8 (Recursion for boosted method), #17 (Bad formating for Pythran
error), #18 (Improve logging jit), #19 (Change default arguments of jit
decorator) and #20 (No Pythran signature generated for boosted functions without
arguments)!
- Fix issues #8 (Recursion for boosted method), #17 (Bad formating for Pythran error),
#18 (Improve logging jit), #19 (Change default arguments of jit decorator) and #20 (No
Pythran signature generated for boosted functions without arguments)!

## 0.2.3 (2019-06-11)

Expand Down Expand Up @@ -202,8 +199,8 @@ See also the

## 0.1.5 (2018-12-12)

- {code}`jit` for simple methods (without assignation to attributes and call of
other methods)
- {code}`jit` for simple methods (without assignation to attributes and call of other
methods)
- {code}`Union` for annotations
- {code}`include` decorator

Expand Down Expand Up @@ -242,8 +239,8 @@ See also the

## 0.0.9 (2018-11-20)

- {code}`TRANSONIC_COMPILE_AT_IMPORT` mode for ahead-of-time and just-in-time
compilation (works also in IPython)
- {code}`TRANSONIC_COMPILE_AT_IMPORT` mode for ahead-of-time and just-in-time compilation
(works also in IPython)
- By default, the fluidpythran commandline uses Pythran

## 0.0.8 (2018-11-16)
Expand Down
43 changes: 21 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# How to contribute to Transonic

Thank you for considering contributing to Transonic. Transonic is a
community-driven project. It's people like you that make Transonic useful and
successful. There are many ways to contribute, from writing tutorials or
examples, improvements to the documentation, submitting bug reports and feature
requests, or even writing code which can be incorporated into Transonic for
everyone to use. (Paragraph shamelessly taken and adapted from the MetPy
project!)
Thank you for considering contributing to Transonic. Transonic is a community-driven
project. It's people like you that make Transonic useful and successful. There are many
ways to contribute, from writing tutorials or examples, improvements to the
documentation, submitting bug reports and feature requests, or even writing code which
can be incorporated into Transonic for everyone to use. (Paragraph shamelessly taken and
adapted from the MetPy project!)

## Reporting Issues

When opening an issue to report a problem
(<https://foss.heptapod.net/fluiddyn/transonic/issues>), please try to provide
a minimal code example that reproduces the issue along with details of the
system you are using. You can copy-paste the output of the command `fluidinfo
-v` provided by the Python package
[fluiddyn](https://pypi.org/project/fluiddyn/) ([Github
gists](https://gist.github.com/) are good for that!).
(<https://foss.heptapod.net/fluiddyn/transonic/issues>), please try to provide a minimal
code example that reproduces the issue along with details of the system you are using.
You can copy-paste the output of the command `fluidinfo -v` provided by the Python
package [fluiddyn](https://pypi.org/project/fluiddyn/)
([Github gists](https://gist.github.com/) are good for that!).

## Development process

Transonic is part of the wider project FluidDyn. For FluidDyn, we use the
revision control software Mercurial and our main repositories are hosted here:
Transonic is part of the wider project FluidDyn. For FluidDyn, we use the revision
control software Mercurial and our main repositories are hosted here:
<https://foss.heptapod.net/fluiddyn>.

Please read our documentation on [developer
essentials](https://fluiddyn.readthedocs.io/en/latest/advice_developers.html),
and especially on [setting up
Mercurial](https://fluiddyn.readthedocs.io/en/latest/mercurial_heptapod.html).
Please read our documentation on
[developer essentials](https://fluiddyn.readthedocs.io/en/latest/advice_developers.html),
and especially on
[setting up Mercurial](https://fluiddyn.readthedocs.io/en/latest/mercurial_heptapod.html).

## Setup a development environment and use it

We use [PDM](https://pdm-project.org) so the first step is to [install this
tool](https://pdm-project.org/latest/#installation). Then, in the root
directory of the repository, you can create and activate a local virtual environment with:
We use [PDM](https://pdm-project.org) so the first step is to
[install this tool](https://pdm-project.org/latest/#installation). Then, in the root
directory of the repository, you can create and activate a local virtual environment
with:

```sh
pdm install
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@

**Documentation**: <https://transonic.readthedocs.io>

<!-- start short description -->

Transonic is a pure Python package (requiring Python >= 3.9) to easily accelerate modern
Python-Numpy code with different accelerators (currently [Cython], [Pythran], [Numba] and
[JAX], but potentially later [Cupy], [PyTorch], [Weld], [Pyccel], etc...).

**The accelerators are not hard dependencies of Transonic:** Python codes using Transonic
run fine without any accelerators installed (of course without speedup)!

<!-- end short description -->

> [!WARNING] Transonic is still in an active development stage (see our
> [roadmap](https://transonic.readthedocs.io/en/latest/roadmap.html)). Remarks and
> suggestions are very welcome.
Expand Down
56 changes: 28 additions & 28 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@

## Cython backend (beta version)

Less bugs and more Cython features... Note that unfortunately we are [limited
by Cython bugs](backends/cython.md)!
Less bugs and more Cython features... Note that unfortunately we are
[limited by Cython bugs](backends/cython.md)!

- [done] Header also for Pythran (`.pythran`)
- (done) Header also for Pythran (`.pythran`)

- [done] Refactore backends "for method"
- (done) Refactore backends "for method"

- [done] Recompile if header changed
- (done) Recompile if header changed

- [done] test_run.py: also check signature files
- (done) test_run.py: also check signature files

- [done] Fused types rather than more than one signature for
- (done) Fused types rather than more than one signature for

- [done] boost functions
- [done] boost methods
- [done] blocks
- [done] jit functions
- [done] jit methods
- (done) boost functions
- (done) boost methods
- (done) blocks
- (done) jit functions
- (done) jit methods

- [done] BackendJITCython
- (done) BackendJITCython

- [done] Check/fix
- (done) Check/fix

- [done] boost methods
- [done] blocks
- [done] jit functions
- [done] jit methods
- (done) boost methods
- (done) blocks
- (done) jit functions
- (done) jit methods

- [done] Cython decorators (boundscheck, wraparound, cdivision, nonecheck)
- (done) Cython decorators (boundscheck, wraparound, cdivision, nonecheck)

- [done] void type
- (done) void type

- [done] Correct use of fused types (only 1 set of annotations supported)
- (done) Correct use of fused types (only 1 set of annotations supported)

- Special function definitions

- [done] inline
- [done] return type
- (done) inline
- (done) return type
- nogil

- better fused types
Expand All @@ -66,8 +66,9 @@ by Cython bugs](backends/cython.md)!

It would allow one to use `numba.jitclass` and Cython extension type.

A interesting goal would be to rewrite [pygbm](https://github.com/ogrisel/pygbm) (written in Numba) with Transonic. Note
that the Cython translation is [here](https://github.com/scikit-learn/scikit-learn/tree/master/sklearn/ensemble/_hist_gradient_boosting)
A interesting goal would be to rewrite [pygbm](https://github.com/ogrisel/pygbm) (written
in Numba) with Transonic. Note that the Cython translation is
[here](https://github.com/scikit-learn/scikit-learn/tree/master/sklearn/ensemble/_hist_gradient_boosting)
in scikit-learn. Good Rosetta stone!

## Backends as Transonic extensions
Expand All @@ -84,9 +85,8 @@ Which API?

## Parallelism

We can already use OpenMP with Transonic-Pythran. But OpenMP pragmas are not
understood by the other backends. Numba and Cython use different notations
(with `prange`):
We can already use OpenMP with Transonic-Pythran. But OpenMP pragmas are not understood
by the other backends. Numba and Cython use different notations (with `prange`):

- <https://cython.readthedocs.io/en/latest/src/userguide/parallelism.html>
- <https://numba.pydata.org/numba-doc/dev/user/parallel.html>
Expand Down
18 changes: 9 additions & 9 deletions THANKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

The main contributors are:

- [Pierre Augier](http://www.legi.grenoble-inp.fr/people/Pierre.Augier/)
(LEGI, CNRS, UGA)
- [Pierre Augier](http://www.legi.grenoble-inp.fr/people/Pierre.Augier/) (LEGI, CNRS,
UGA)
- [Ashwin Vishnu](https://github.com/ashwinvis) (KTH, Stockholm)
- [Pierre Blanc-fatin](https://github.com/PierreBlancfat) (UGA)

with ideas from [Serge Sans Paille](https://github.com/serge-sans-paille/)
and [Wolf Vollprecht](https://twitter.com/wuoulf).
with ideas from [Serge Sans Paille](https://github.com/serge-sans-paille/) and
[Wolf Vollprecht](https://twitter.com/wuoulf).

Of course Transonic could not exist without Serge, a benefactor to humankind
who brings efficiency for numerical computing to snake tamers. Trugarez for his
great work on Pythran and Beniget!
Of course Transonic could not exist without Serge, a benefactor to humankind who brings
efficiency for numerical computing to snake tamers. Trugarez for his great work on
Pythran and Beniget!

A very special thanks to [Laura Mendoza](https://github.com/lasofivec) who
replaced Pierre Augier to give our presentation at [Pyconfr 2019](https://www.pycon.fr/2019/).
A very special thanks to [Laura Mendoza](https://github.com/lasofivec) who replaced
Pierre Augier to give our presentation at [Pyconfr 2019](https://www.pycon.fr/2019/).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gast
import numpy as np
from .for_test_exterior_import_jit_2 import func_import_2

from .for_test_exterior_import_jit_2 import func_import_2

const = 1
foo = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import gast
import numpy as np


const = 1
foo = 1

Expand Down
3 changes: 1 addition & 2 deletions _transonic_testing/src/_transonic_testing/for_test_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np

from transonic import Transonic, boost, Array, Union, const

from transonic import Array, Transonic, Union, boost, const

# transonic def func(int, float)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from transonic import jit, boost
from transonic import boost, jit
from transonic.mpi import Path


Expand Down Expand Up @@ -71,9 +71,10 @@ def check(self):
assert self.myfunc(1) == 3


from numpy import pi

# FIXME support multilevel imported jitted function call in a jitted function
from .for_test_exterior_import_jit import foo, func_import, func_import2
from numpy import pi

const = 1

Expand Down
1 change: 1 addition & 0 deletions data_tests/test_packaging/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A pure Python module containing a few functions"""

import numpy as np


Expand Down
3 changes: 3 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,6 @@ notebook:

autobuild:
@sphinx-autobuild --watch ../src --re-ignore '_build\/.*' "$(SOURCEDIR)" "$(BUILDDIR)/html"

format:
mdformat *.md */*.md
27 changes: 12 additions & 15 deletions doc/backends.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
# Supported backends

Transonic can use different tools to accelerate the code. We use the name
**backend**.
Transonic can use different tools to accelerate the code. We use the name **backend**.

The default backend is Pythran and currently, there are 3 other backends
("cython", "numba" or "python"). The "python" backend is mainly used for
internal testing.
The default backend is Pythran and currently, there are 3 other backends ("cython",
"numba" or "python"). The "python" backend is mainly used for internal testing.

There are different methods to choose which backend is used:

- An environment variable {code}`TRANSONIC_BACKEND` (which has to be "pythran",
"cython", "numba" or "python") should be used to change the backend globally
for one process.
- An environment variable {code}`TRANSONIC_BACKEND` (which has to be "pythran", "cython",
"numba" or "python") should be used to change the backend globally for one process.
- The `transonic` command-line has an option `-b` (`--backend`).
- The functions {func}`transonic.backends.make_backend_files` and
{func}`transonic.dist.init_transonic_extensions` have an optional argument
`backend`. Note that these functions should be imported from the
{mod}`transonic.dist` package.
{func}`transonic.dist.init_transonic_extensions` have an optional argument `backend`.
Note that these functions should be imported from the {mod}`transonic.dist` package.
- There are two functions {func}`transonic.config.set_backend` and
{func}`transonic.backends.set_backend_for_this_module`. Note that these
functions can be imported from the {mod}`transonic` package.
{func}`transonic.backends.set_backend_for_this_module`. Note that these functions can
be imported from the {mod}`transonic` package.
- The `boost` and `jit` decorators have an optional argument `backend`.

```{toctree}
:maxdepth: 2
---
maxdepth: 2
---
examples/bench_row_sum/txt
backends/pythran
backends/cython
Expand Down
Loading

0 comments on commit a144c88

Please sign in to comment.