Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CPM1D/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
*.egg-info
27 changes: 27 additions & 0 deletions CPM1D/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,30 @@ description: This folder contains services to compute the 1D integral

A libraty for collision probability method in 1d reference frames (slab,
cyclinder and sphere), created by [ndarmage](https://github.com/ndarmage).

# Install (in a virtual environment)

Create an activate a virtual environment:

```sh
# create virtual env
python3 -m venv my-virtual-env
# activate virtual env
my-virtual-env/bin/activate
```

Install the package (each time package sources are modified)

```sh
pip install path_to_this_directory
```

Use it
```sh
python
```
```python
import KinPy.algo609 as algo
dir(algo)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '__version__', '_algo609_error', 'bdiff', 'bkias', 'bkisr', 'bskin', 'd1mach', 'dbdiff', 'dbkias', 'dbkisr', 'dbskin', 'dexint', 'dgamrn', 'dhkseq', 'dpsixn', 'dqckin', 'exint', 'fdump', 'gamrn', 'hkseq', 'i1mach', 'j4save', 'psixn', 'qckin', 'r1mach', 's88fmt', 'xerabt', 'xerclr', 'xerctl', 'xerdmp', 'xermax', 'xerprt', 'xerror', 'xerrwv', 'xersav', 'xgetf', 'xgetua', 'xgetun', 'xsetf', 'xsetua', 'xsetun']
```
2 changes: 2 additions & 0 deletions CPM1D/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "numpy"]
33 changes: 33 additions & 0 deletions CPM1D/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""from https://numpy.org/doc/stable/f2py/buildtools/distutils.html"""
from pathlib import Path

from numpy.distutils.core import Extension, setup
from setuptools import find_packages


src_dir = Path('src') # Path allows to be complient wit Linux and Windows
f_flags = [ # from CPM1D/tools/wrap_f77_to_pylib.sh
'-ffixed-line-length-72',
'-Wextra',
'-Wall',
'-std=legacy'
]
extension = Extension(name='KinPy.algo609',
sources=[str(src_dir / 'KinPy' / 'algo609.f')],
# see https://numpy.org/doc/stable/reference/generated/numpy.distutils.core.Extension.html#numpy.distutils.core.Extension
# for compile options.
extra_f77_compile_args=f_flags,
extra_f90_compile_args=f_flags,
)

setup(name='CPM1D',
description=("Services to compute the 1D integral transport"
"equation by the collision probability method"),
author="Daniele tomatis",
author_email="???",
version="0.0.1",
ext_modules=[extension,],
install_requires = ["setuptools", "wheel", "numpy"],
package_dir={"": "src"}, # To install KinPy and all python files in it (requires __init__.py in each subfolders to install)
packages=find_packages(where="src"), # to locate src dir
)
Empty file added CPM1D/src/KinPy/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.