Metadata-Version: 2.4
Name: shift-fft
Version: 1.1.1
Summary: SHIFT is a scalable MPI library for computing fast Fourier transforms in python.
Author-email: Krishna Naidoo <krishna.naidoo.11@ucl.ac.uk>
Maintainer-email: Krishna Naidoo <krishna.naidoo.11@ucl.ac.uk>
License: MIT License
        
        Copyright (c) 2026 Krishna Naidoo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/knaidoo29/SHIFT
Project-URL: Repository, https://github.com/knaidoo29/SHIFT
Project-URL: Documentation, https://shift.readthedocs.io/en/latest/
Project-URL: Bug Tracker, https://github.com/knaidoo29/SHIFT/issues
Project-URL: Changelog, https://github.com/knaidoo29/SHIFT/blob/main/CHANGELOG.md
Keywords: mathematics,fourier transforms
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numba
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Provides-Extra: docs
Requires-Dist: numpydoc; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: mpi
Requires-Dist: mpi4py; extra == "mpi"
Dynamic: license-file

![biglogo](https://raw.githubusercontent.com/knaidoo29/SHIFT/main/docs/source/_static/SHIFT_logo_large_github.jpg)

<p align="center">
    <a href="https://github.com/knaidoo29/SHIFT/actions/workflows/tests.yml">
    <img src="https://github.com/knaidoo29/SHIFT/actions/workflows/tests.yml/badge.svg" alt="Python Tests">
    </a>
    <a href="https://codecov.io/gh/knaidoo29/SHIFT" > 
    <img src="https://codecov.io/gh/knaidoo29/SHIFT/graph/badge.svg?token=HX4OB31MS3"/> 
    </a>
    <a href="https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12-blue">
    <img src="https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12-blue" alt="Python Version Support">
    </a>
    <a href="https://img.shields.io/github/v/release/knaidoo29/SHIFT">  
    <img src="https://img.shields.io/github/v/release/knaidoo29/SHIFT" alt="Version">
    </a>
    <a href="https://pypi.org/project/shift-fft/">
    <img src="https://img.shields.io/pypi/v/shift-fft.svg" alt="PyPI version">
    </a>
    <a href="https://shift.readthedocs.io/en/latest/">
    <img src="https://readthedocs.org/projects/shift/badge/?version=latest" alt="Documentation Status">
    </a>
    <a href="https://github.com/knaidoo29/SHIFT">
    <img src="https://img.shields.io/badge/GitHub-repo-blue?logo=github" alt="GitHub repository">
    </a>
    <a href="https://img.shields.io/github/stars/knaidoo29/shift">
    <img src="https://img.shields.io/github/stars/knaidoo29/shift" alt="github: stars">
    </a>
    <a href="https://img.shields.io/github/stars/knaidoo29/shift">
    <img src="https://img.shields.io/github/forks/knaidoo29/shift" alt="github: forks">
    </a>
    <a href="https://opensource.org/licenses/MIT">
    <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
    </a>
    <a href="https://doi.org/10.5281/zenodo.17093446">
    <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.17093446.svg" alt="zenodo: DOI">
    </a>
</p>

# SHIFT : Scalable High-level Interface for Fourier Transforms

## Introduction

SHIFT is a lightweight Python library designed to simplify Fourier
transforms and spectral calculations on regular grids. Built around
SciPy's FFT routines, SHIFT provides a convenient interface for
computing Fourier, discrete cosine (DCT), and discrete sine (DST)
transforms in one, two, and three dimensions, alongside utilities
for constructing grids and their corresponding Fourier-space modes.

A central motivation behind SHIFT is to make parallel Fourier
transforms easier to install, use, and integrate into scientific
applications. Unlike implementations requiring FFTW and additional
compiled extensions, SHIFT uses SciPy's FFT backend and supports
distributed transforms through ``mpi4py``, employing an MPI slab
decomposition. This avoids the need for a separate FFTW installation
while retaining compatibility with standard scientific Python
environments.

In addition to spectral transforms, SHIFT provides utilities for
MPI communication and distributed array operations, making it
suitable for integration into larger scientific computing workflows.

> **NOTE**: SHIFT was originally conceived as a framework for Fourier
  transforms in Cartesian, polar, and spherical coordinate systems.
  Current development focuses on Cartesian spectral transforms and
  MPI-based scientific computing. Experimental polar and spherical
  transform implementations are available in the ``sphere`` branch,
  but are not part of the supported release and should be used
  with caution. Further development of these capabilities is
  planned.

## Dependencies

* `numba`
* `numpy`
* `scipy`
* `mpi4py` [Optional: enables MPI distributed processes]

## Installation

SHIFT can be installed via `pip`:

```
pip install shift-fft
```

Or by cloning the github repository:

```
git clone https://github.com/knaidoo29/SHIFT.git
cd SHIFT
pip install .
```

The latter of which can be used to install specific branches. 

Once this is done you should be able to call `SHIFT` from python:

```python
import shift
```

To use the `MPI` functionality please take a look at the documentation which instructs users how to use the `SHIFT` `MPI` object and how to run these distributed jobs successfully without errors or MPI related hanging.

## Documentation

In depth documentation and tutorials are provided [here](https://shift.readthedocs.io/).

## License

SHIFT is released under the MIT License. See [LICENSE](LICENSE) for details.

## Citation

If you use **SHIFT** in your work, please cite:

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17093446.svg)](https://doi.org/10.5281/zenodo.17093446)

```bibtex
  @software{naidoo_shift_2025,
    author       = {Naidoo, Krishna},
    title        = {SHIFT: a scalable MPI library for computing fast Fourier transforms in python},
    year         = 2025,
    publisher    = {Zenodo},
    doi          = {10.5281/zenodo.17093446},
    url          = {https://doi.org/10.5281/zenodo.17093446}}
```

## Support

If you have any issues with the code or want to suggest ways to improve it please open a new issue ([here](https://github.com/knaidoo29/SHIFT/issues))
or (if you don't have a github account) email _krishna.naidoo.11@ucl.ac.uk_.
