Skip to content

Commit

Permalink
Merge pull request #19 from neutrinoceros/rel_0.1
Browse files Browse the repository at this point in the history
REL: v0.1.0
  • Loading branch information
neutrinoceros authored Oct 4, 2022
2 parents 1d971a0 + c6255f6 commit f58720a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
__pycache__
.python-version
.coverage*
.mypy_cache
.pytest_cache

*~
__pycache__

MANIFEST
build
dist
gpgi/clib/*.html
gpgi/clib/*.so
gpgi/clib/*.c
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include gpgi/clib/*.pyx
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# GPGI
A **G**eneric **P**article + **G**rid data **I**nterface
[![PyPI](https://img.shields.io/pypi/v/gpgi.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/gpgi/)
[![PyPI](https://img.shields.io/badge/requires-Python%20≥%203.9-blue?logo=python&logoColor=white)](https://pypi.org/project/gpgi/)

[![](https://img.shields.io/badge/test_coverage-100%-brightgreen)]()
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/neutrinoceros/gpgi/main.svg)](https://results.pre-commit.ci/latest/github/neutrinoceros/gpgi/main)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

This small Python library implements fundamental grid deposition algorithms to analyse grid + particle datasets, with an emphasize on performance.
Core algorithms are writen as Cython extensions.
A **G**eneric **P**article + **G**rid data **I**nterface

This small Python library implements fundamental grid deposition algorithms to
analyse (rectilinear) grid + particle datasets, with an emphasize on
performance. Core algorithms are implemented as Cython extensions.
### Installation

```shell
python -m pip install git@https://github.com/neutrinoceros/gpgi.git
pip install gpgi
```



### Usage

The API consists in a `load` function, which returns a `Dataset` object.
Expand Down Expand Up @@ -52,7 +57,7 @@ which both hold a `fields` attribute for accessing their data.
But more importantly, the `Dataset` has a `deposit` method to
translate particle fields to the grid formalism.

**Deposit Particle fields on the grid **
**Deposit Particle fields on the grid**

```python
particle_mass = ds.deposit("mass", method="particle_in_cell") # or "pic" for shorts
Expand All @@ -72,7 +77,7 @@ im = ax.pcolormesh(
particle_mass.T,
data=ds.grid.cell_edges,
cmap="viridis",
)
)
fig.colorbar(im, ax=ax)
```

Expand Down
2 changes: 1 addition & 1 deletion gpgi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from .api import load

__version__ = "0.0.1"
__version__ = "0.1.0"
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ requires = [

[project]
name = "gpgi"
version = "0.0.1"
description = "A generic interface to ... grid-based and lagrangian particle spatial data"
version = "0.1.0"
description = "A Generic Particle+Grid Interface"
authors = [
{ name = "C.M.T. Robert" },
]
classifiers = [
"Intended Audience :: Astronomers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import numpy
from Cython.Build import cythonize
from distutils.core import setup
from distutils.extension import Extension
from setuptools import setup

ext_modules = ["gpgi/clib/_indexing.pyx"]


setup(
name="Hello world app",
ext_modules=cythonize(
[
Extension(
Expand Down

0 comments on commit f58720a

Please sign in to comment.