Skip to content
Merged
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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Release 0.2.0 (TBD)
-------------------

New:
* Support Cython 3 stable release
* Support Cherab 1.5

Bug fixes:
* Fix parsing of integer data from TRAN files in recent versions of EPROC.


Release 0.1.0 (7 Nov 2022)
--------------------------

Initial release.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cherab add-on module for EDGE2D simulations.

This module enables the creation of Cherab plasma objects from EDGE2D simulations.
EDGE2D tran files are supported.
Please see the examples in the [demos](demos) directory for an illustration of how to use the module.
Please see the examples in the demos directory for an illustration of how to use the module.

## Installation

Expand All @@ -27,18 +27,10 @@ source ~/venvs/cherab-venv/bin/activate
This module depends on the core Cherab framework and Eproc EDGE2D processing library.

Cherab core, and all of its dependencies, are available on PyPI and can be installed using `pip`.
However, the EDGE2D module will need to be installed from this repository.

Note also that a [bug](https://github.com/cython/cython/issues/2918) in Cython prevents Cherab submodules from installing correctly.
This bug is fixed, but not yet released in the stable version of Cython.
As a result, you will need to install the latest alpha version of Cython before installing this package.

First, clone this repository, then do:
However, the EDGE2D module will need to be installed from this repository:

```bash
pip install -U cython==3.0a5
pip install cherab
pip install <path-to-cherab-edge2d>
pip install git@https://github.com/cherab/edge2d
```

This will pull in `cherab-core`, `raysect` `numpy` and other dependencies, then build and install the EDGE2D module.
Expand All @@ -64,6 +56,8 @@ export PYTHONPATH=$PYTHONPATH:$EPROCDIR/python
export PYTHONPATH=$PYTHONPATH:$EPROCDIR/python/eproc
```

Demos are installed at `~/venvs/cherab-venv/share/cherab/demos/edge2d`. Please see the examples in this directory for an illustration of how to use the module.


### Developers

Expand Down
2 changes: 1 addition & 1 deletion cherab/edge2d/models/line_emitter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ cdef class Edge2DLineEmitter(PlasmaModel):
self._wavelength = self._atomic_data.wavelength(self._line.element, self._line.charge, self._line.transition)

# instance line shape renderer
self._lineshape = self._lineshape_class(self._line, self._wavelength, self._target_species, self._plasma,
self._lineshape = self._lineshape_class(self._line, self._wavelength, self._target_species, self._plasma, self._atomic_data,
*self._lineshape_args, **self._lineshape_kwargs)

def _change(self):
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "oldest-supported-numpy", "cython~=3.0", "raysect==0.8.1.*", "cherab==1.5.*"]
build-backend="setuptools.build_meta"
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
cherab
cherab==1.5.*
raysect==0.8.1.*
cython~=3.0
43 changes: 41 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from collections import defaultdict
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize
import sys
import numpy
import os
import os.path as path
from pathlib import Path

force = False
profile = False
Expand Down Expand Up @@ -34,13 +36,50 @@
else:
directives = {}

# Include demos in a separate directory in the distribution as data_files.
demo_parent_path = Path("share/cherab/demos/edge2d")
data_files = defaultdict(list)
demos_source = Path("demos")
for item in demos_source.rglob("*"):
if item.is_file():
install_dir = demo_parent_path / item.parent.relative_to(demos_source)
data_files[str(install_dir)].append(str(item))
data_files = list(data_files.items())

with open("README.md") as f:
long_description = f.read()


setup(
name="cherab-edge2d",
version="0.1.0",
version="0.2.0",
license="EUPL 1.1",
namespace_packages=['cherab'],
description="Cherab spectroscopy framework: EDGE2D submodule",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
],
url="https://github.com/cherab",
project_urls=dict(
Tracker="https://github.com/cherab/edge2d/issues",
Documentation="https://cherab.github.io/documentation/",
),
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
include_package_data=True,
package_data={"": [
"**/*.pyx", "**/*.pxd", # Needed to build Cython extensions.
],
},
data_files=data_files,
install_requires=["raysect==0.8.1.*", "cherab==1.5.*"],
ext_modules=cythonize(extensions, force=force, compiler_directives=directives)
)