Skip to content

Commit 378f7f2

Browse files
authored
Merge pull request #1070 from ToFuProject/devel
Prepare 1.8.8
2 parents 0ec3812 + be689a9 commit 378f7f2

File tree

11 files changed

+757
-121
lines changed

11 files changed

+757
-121
lines changed

.github/workflows/test-complete-matrix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ jobs:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest, macOS-latest]
1717
python-version: ['3.8', '3.9', '3.10', '3.11']
18-
include:
19-
- python-version: '3.7.11'
20-
os: ubuntu-20.04
2118
exclude:
2219
- python-version: ['3.11']
2320
os: windows-latest
@@ -30,9 +27,12 @@ jobs:
3027
python-version: ${{ matrix.python-version }}
3128
- name: Install dependencies
3229
run: |
30+
curl -X PURGE https://pypi.org/simple/datastock/
31+
curl -X PURGE https://pypi.org/simple/bsplines2d/
32+
curl -X PURGE https://pypi.org/simple/spectrally/
3333
pip install --upgrade pip
3434
pip install flake8 pytest coverage wheel
35-
pip install -r requirements.txt
35+
pip install -r requirements.txt --no-cache
3636
- name: Lint with flake8
3737
run: |
3838
# stop the build if there are Python syntax errors or undefined names

requirements.txt

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

1313
######## Requirements with Version Specifier ########
14-
datastock>=0.0.49
15-
bsplines2d>=0.0.21
14+
datastock>=0.0.54
15+
bsplines2d>=0.0.22
1616
spectrally>=0.0.9
1717
Cython>=0.26

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +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",
328+
"datastock>=0.0.54",
329+
"bsplines2d>=0.0.22",
330330
"spectrally>=0.0.9",
331331
],
332332
python_requires=">=3.6",

tofu/data/_class02_Rays.py

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
from . import _class02_touch as _touch
1212
from . import _class02_sample as _sample
1313
from . import _class02_tangency_radius as _tangency_radius
14+
from . import _class02_single_point_camera as _single_point_cam
1415
from . import _class2_plot as _plot
1516
from . import _class2_sinogram as _sinogram
1617
from . import _class02_save2stp as _save2stp
18+
from . import _class8_plot
1719

1820

1921
__all__ = ['Rays']
@@ -157,7 +159,12 @@ def get_rays_vect(
157159
key_cam=None,
158160
norm=None,
159161
):
160-
return _check._get_vect(coll=self, key=key, key_cam=key_cam, norm=norm)
162+
return _check._get_vect(
163+
coll=self,
164+
key=key,
165+
key_cam=key_cam,
166+
norm=norm,
167+
)
161168

162169
# --------------
163170
# touch
@@ -363,10 +370,60 @@ def get_rays_intersect_radius(
363370
)
364371

365372
# --------------
366-
# plotting
373+
# Single point camera
367374
# --------------
368375

369-
def plot_rays(
376+
def add_single_point_camera2d(
377+
self,
378+
key=None,
379+
cent=None,
380+
nin=None,
381+
e0=None,
382+
e1=None,
383+
angle0=None,
384+
angle1=None,
385+
config=None,
386+
strict=None,
387+
# optional naming
388+
key_angle0=None,
389+
key_angle1=None,
390+
ref_angle0=None,
391+
ref_angle1=None,
392+
units_angles=None,
393+
):
394+
""" Add a set of 2d rays from a single point
395+
396+
Rays are sampling a portion of sphere around cent
397+
Portion is defined by 2 angles:
398+
- alpha
399+
- beta
400+
401+
"""
402+
403+
return _single_point_cam.main(
404+
coll=self,
405+
key=key,
406+
cent=cent,
407+
nin=nin,
408+
e0=e0,
409+
e1=e1,
410+
angle0=angle0,
411+
angle1=angle1,
412+
config=config,
413+
strict=strict,
414+
# optional naming
415+
key_angle0=key_angle0,
416+
key_angle1=key_angle1,
417+
ref_angle0=ref_angle0,
418+
ref_angle1=ref_angle1,
419+
units_angles=units_angles,
420+
)
421+
422+
# ------------------
423+
# plotting - static
424+
# ------------------
425+
426+
def plot_rays_static(
370427
self,
371428
key=None,
372429
proj=None,
@@ -407,6 +464,75 @@ def plot_rays(
407464
connect=connect,
408465
)
409466

467+
# ------------------
468+
# plotting - interactive
469+
# ------------------
470+
471+
def plot_rays(
472+
self,
473+
# keys
474+
key=None,
475+
keyZ=None,
476+
# options
477+
proj=None,
478+
res=None,
479+
# data plot
480+
data=None,
481+
units=None,
482+
cmap=None,
483+
vmin=None,
484+
vmax=None,
485+
alpha=None,
486+
dx0=None,
487+
dx1=None,
488+
# config
489+
plot_config=None,
490+
plot_colorbar=None,
491+
# figure
492+
dax=None,
493+
dmargin=None,
494+
fs=None,
495+
wintit=None,
496+
# interactivity
497+
color_dict=None,
498+
nlos=None,
499+
dinc=None,
500+
connect=None,
501+
):
502+
503+
return _class8_plot._plot_diagnostic(
504+
coll=self,
505+
isray=True,
506+
# keys
507+
key=key,
508+
keyZ=keyZ,
509+
# options
510+
proj=proj,
511+
los_res=res,
512+
# data plot
513+
data=data,
514+
units=units,
515+
cmap=cmap,
516+
vmin=vmin,
517+
vmax=vmax,
518+
alpha=alpha,
519+
dx0=dx0,
520+
dx1=dx1,
521+
# config
522+
plot_config=plot_config,
523+
plot_colorbar=plot_colorbar,
524+
# figure
525+
dax=dax,
526+
dmargin=dmargin,
527+
fs=fs,
528+
wintit=wintit,
529+
# interactivity
530+
color_dict=color_dict,
531+
nlos=nlos,
532+
dinc=dinc,
533+
connect=connect,
534+
)
535+
410536
# --------------
411537
# sinogram
412538
# --------------

0 commit comments

Comments
 (0)