Skip to content

Commit fd6df65

Browse files
committed
Merge branch 'devel' into Issue1037_rays_touch
2 parents 92455d5 + aa5fe46 commit fd6df65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+10712
-182
lines changed

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ include _updateversion.py
77
recursive-include tofu/geom *.pxd
88
recursive-include tofu/geom/inputs *.txt
99
recursive-include tofu/spectro *.txt
10+
11+
# physics
12+
tofu/physics_tools/runaways/emission/*.csv
13+
tofu/physics_tools/transmission/inputs_filter/*.txt
14+
tofu/physics_tools/transmission/inputs_filter/*.csv
15+
16+
# tests data
1017
recursive-include tofu/tests/tests01_geom/test_data *.txt
1118
recursive-include tofu/tests/tests01_geom/test_data *.npz
1219
recursive-include tofu/tests/tests01_geom/test_data *.svg

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Do you want to use **tofu** on IMAS and don't know where to start?
108108

109109

110110
## Installing tofu
111+
Tofu installation currently works with Python 3.10 & 3.11.
112+
113+
For Windows installations, make sure that you've installed [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) prior to proceeding. Select the "Desktop Development with C++" module.
111114

112115
**From source** (compiled on your system using pip, all platforms)
113116

pyproject.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

pyproject_temp.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=40.8.0, <64",
4+
"wheel",
5+
"Cython>=0.26",
6+
"numpy",
7+
]
8+
build-backend = "setuptools.build_meta"
9+
10+
[project]
11+
name = "tofu"
12+
dynamic = ["version"]
13+
description="A python library for Tomography for Fusion"
14+
readme = "README.md"
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3 :: Only",
23+
]
24+
authors = [
25+
{ name = "Didier Vezinet", email = "didier.vezinet@gmail.com" }
26+
]
27+
requires-python = ">=3.8"
28+
dependencies = [
29+
"setuptools>=40.8.0, <64",
30+
"numpy",
31+
"scipy",
32+
# "scikit-sparse",
33+
# "scikit-umfpack",
34+
"matplotlib",
35+
"contourpy",
36+
"requests",
37+
"svg.path",
38+
"Polygon3",
39+
"cython>=0.26",
40+
"datastock>=0.0.49",
41+
"bsplines2d>=0.0.21",
42+
"spectrally>=0.0.9",
43+
]
44+
45+
[project.optional-dependencies]
46+
interactive = ["PyQt5", "PySide2"]
47+
48+
[tool.setuptools.packages.find]
49+
where = ["tofu"]
50+
51+
[tool.setuptools.package-data]
52+
"*" = ["*.txt", "*.csv", "*.pxd", "*.in", "*.toml", "*.npz", "*.svg", "*.sh", "*.f"]
53+
54+
[tool.coverage.report]
55+
precision = 2
56+
fail_under = 85
57+
58+
[tool.pytest.ini_options]
59+
testpaths = [
60+
"tofu.tests",
61+
]
62+
63+
[project.urls]
64+
Homepage = "https://tofuproject.github.io/tofu/index.html"
65+
Documentation = "https://tofuproject.github.io/tofu/index.html"
66+
Repository = "https://github.com/ToFuProject/tofu"
67+
"Bug Tracker" = "https://github.com/ToFuProject/tofu/issues"

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ svg.path
1111
Polygon3
1212

1313
######## Requirements with Version Specifier ########
14+
datastock>=0.0.49
15+
bsplines2d>=0.0.21
1416
spectrally>=0.0.9
1517
Cython>=0.26

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def get_version_tofu(path=_HERE):
325325
"svg.path",
326326
"Polygon3",
327327
"cython>=0.26",
328+
"datastock>=0.0.49",
329+
"bsplines2d>=0.0.21",
328330
"spectrally>=0.0.9",
329331
],
330332
python_requires=">=3.6",
@@ -361,6 +363,8 @@ def get_version_tofu(path=_HERE):
361363
"tofu.tests.tests06_mesh.test_data": ['*.txt', '*.npz'],
362364
"tofu.geom.inputs": ["*.txt"],
363365
"tofu.spectro": ["*.txt"],
366+
"tofu.physics_tools.runaways.emission": ['*.csv'],
367+
"tofu.physics_tools.transmission.inputs_filter": ['*.txt', '*.csv'],
364368
"tofu.mag.mag_ripple": ['*.sh', '*.f']
365369
},
366370
include_package_data=True,

tofu/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
import tofu.spectro as spectro
8989
import tofu.tests as tests
9090
import tofu.benchmarks as benchmarks
91+
from . import physics_tools
92+
from . import omas2tofu
9193

9294

9395
# -------------------------------------

tofu/data/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
from ._class10_Inversion import Inversion as Collection
1313
from ._spectralunits import *
1414
from ._saveload import *
15-
from ._class08_saveload_from_file import load as load_diagnostic_from_file
15+
from ._class08_saveload_from_file import load as load_diagnostic_from_file

tofu/data/_class02_save2stp.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -624,17 +624,6 @@ def _extract(
624624

625625
for k0, v0 in dptsx.items():
626626

627-
# get kcam
628-
kcam, axis = _get_kcam(
629-
coll=coll,
630-
k0=k0,
631-
key=key,
632-
key_cam=key_cam,
633-
key_rays=key_rays,
634-
)
635-
636-
shape_cam = coll.dobj['camera'][kcam]['dgeom']['shape']
637-
638627
# both ways
639628
npts = dptsx[k0].shape[0]
640629
sli = tuple(
@@ -662,7 +651,19 @@ def _extract(
662651
dptsz[k0] = np.ravel(ptsz, order='F')
663652

664653
elif chain == 'pixel':
654+
655+
# get kcam
656+
kcam = _get_kcam(
657+
coll=coll,
658+
k0=k0,
659+
key=key,
660+
key_cam=key_cam,
661+
key_rays=key_rays,
662+
)[0]
663+
664+
shape_cam = coll.dobj['camera'][kcam]['dgeom']['shape']
665665
shape = shape_cam + (-1,)
666+
666667
dptsx[k0] = np.moveaxis(
667668
np.moveaxis(ptsx, 0, -1).reshape(shape),
668669
-1,

tofu/data/_class08_Diagnostic.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from . import _class8_plot as _plot
3232
from . import _class8_plot_vos as _plot_vos
3333
from . import _class8_plot_coverage as _plot_coverage
34-
from . import _class08_save2stp as _save2stp
34+
# from . import _class08_save2stp as _save2stp
3535
from . import _class08_saveload_from_file as _saveload_from_file
3636

3737

@@ -395,6 +395,7 @@ def add_rays_from_diagnostic(
395395
config=None,
396396
# storing
397397
store=None,
398+
strict=None,
398399
key_rays=None,
399400
overwrite=None,
400401
):
@@ -410,6 +411,7 @@ def add_rays_from_diagnostic(
410411
config=config,
411412
# storing
412413
store=store,
414+
strict=strict,
413415
key_rays=key_rays,
414416
overwrite=overwrite,
415417
)
@@ -1262,6 +1264,9 @@ def plot_diagnostic(
12621264
alpha=None,
12631265
dx0=None,
12641266
dx1=None,
1267+
# plot vos polygons
1268+
plot_pcross=None,
1269+
plot_phor=None,
12651270
# config
12661271
plot_config=None,
12671272
plot_colorbar=None,
@@ -1297,6 +1302,9 @@ def plot_diagnostic(
12971302
alpha=alpha,
12981303
dx0=dx0,
12991304
dx1=dx1,
1305+
# plot vos polygons
1306+
plot_pcross=plot_pcross,
1307+
plot_phor=plot_phor,
13001308
# config
13011309
plot_config=plot_config,
13021310
plot_colorbar=plot_colorbar,
@@ -1334,6 +1342,9 @@ def plot_diagnostic_vos(
13341342
vmax_cam=None,
13351343
dvminmax=None,
13361344
alpha=None,
1345+
# plot vos polygons
1346+
plot_pcross=None,
1347+
plot_phor=None,
13371348
plot_colorbar=None,
13381349
# config
13391350
plot_config=None,
@@ -1368,6 +1379,9 @@ def plot_diagnostic_vos(
13681379
vmax_cam=vmax_cam,
13691380
dvminmax=dvminmax,
13701381
alpha=alpha,
1382+
# plot vos polygons
1383+
plot_pcross=plot_pcross,
1384+
plot_phor=plot_phor,
13711385
plot_colorbar=plot_colorbar,
13721386
# config
13731387
plot_config=plot_config,
@@ -1521,4 +1535,4 @@ def add_diagnostic_from_file(
15211535
coll=self,
15221536
pfe=pfe,
15231537
returnas=returnas,
1524-
)
1538+
)

0 commit comments

Comments
 (0)