Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ab7185b
This passes the old tests
giadarol Nov 18, 2025
6982a71
From template
giadarol Nov 18, 2025
21b94f2
Propagate new arguments
giadarol Nov 18, 2025
ef743d3
Passes some tests...
giadarol Nov 18, 2025
1141376
WIP extending RBend
giadarol Nov 18, 2025
8f13f0a
This passes selected tests
giadarol Nov 18, 2025
9c15e28
Adapted C code
giadarol Nov 18, 2025
d56db47
Adapt test
giadarol Nov 19, 2025
ae9a71c
Update test
giadarol Nov 19, 2025
9e52ac1
This compiles
giadarol Nov 19, 2025
426464f
better
giadarol Nov 19, 2025
07aff62
Passes asserts
giadarol Nov 19, 2025
03e5cd3
Getting to backtracking
giadarol Nov 20, 2025
8a638c5
Backtrack seems to work
giadarol Nov 20, 2025
190df5c
Clean up
giadarol Nov 20, 2025
47e5ff2
Clean up
giadarol Nov 20, 2025
59b1570
Handle rbend shift correctly
giadarol Nov 20, 2025
461d08d
Passes existing tests
giadarol Nov 20, 2025
c8538e5
Rename rbend_mid_angle -> rbend_angle_diff
giadarol Nov 20, 2025
d0cf1a6
Deprecate Line.unfreeze with a warning
szymonlopaciuk Nov 20, 2025
309f26c
This works...
giadarol Nov 20, 2025
7af1076
This also works ?!
giadarol Nov 20, 2025
f8e9b2a
Needed to adapt python, seems to work now
giadarol Nov 20, 2025
ea4c464
Clean up
giadarol Nov 20, 2025
04cf9a6
Add properties
giadarol Nov 20, 2025
466fd70
Updating survey
giadarol Nov 20, 2025
20943aa
Working on survey
giadarol Nov 20, 2025
54f5e4b
Survey starts looking ok
giadarol Nov 20, 2025
e85ee7e
Propagate data for shift
giadarol Nov 20, 2025
4f9a422
Introduce compensate sagitta
giadarol Nov 21, 2025
1ba43c9
There is a problem with angle_rad in the table
giadarol Nov 21, 2025
74805bd
Generalize angle column in line table
giadarol Nov 21, 2025
49c0307
Something to be understood here....
giadarol Nov 21, 2025
a6bc144
Passes all checks
giadarol Nov 21, 2025
6f4c188
Generated line h=0
giadarol Nov 21, 2025
765451c
Status
giadarol Nov 21, 2025
11ab59b
Clarify ACDipole kick definition and parameters
eltos Nov 21, 2025
f76ae55
Working on it
giadarol Nov 21, 2025
6751e76
Ok now we need to adjust the positions
giadarol Nov 21, 2025
5e705ee
Right length!
giadarol Nov 21, 2025
a28b098
Lo script e' qua
giadarol Nov 21, 2025
52b3014
Clean up
giadarol Nov 21, 2025
f182cab
Checks
giadarol Nov 22, 2025
58e42f5
Add checks
giadarol Nov 23, 2025
42ff724
Some more asserts
giadarol Nov 23, 2025
00655e7
More checks
giadarol Nov 23, 2025
b47190d
Strange discrepancy, to be insvestigated
giadarol Nov 23, 2025
7a2aabf
Bug in the setup
giadarol Nov 23, 2025
7f27895
Foudn bug in the test
giadarol Nov 23, 2025
e1cac9c
More testing
giadarol Nov 23, 2025
883f430
More checks
giadarol Nov 24, 2025
23fc79c
More checks
giadarol Nov 24, 2025
37339ff
More checks
giadarol Nov 24, 2025
5de5738
more checks
giadarol Nov 24, 2025
d0e23f3
More checks
giadarol Nov 24, 2025
95b9e2c
More checks
giadarol Nov 24, 2025
c8c7f97
More checks
giadarol Nov 24, 2025
a7386de
Vertical beta completely off!
giadarol Nov 24, 2025
c07ca0c
More checks
giadarol Nov 24, 2025
0431cd5
Doc: Clearify that particle_ref defaults to line.particle_ref
eltos Nov 24, 2025
51bc111
more checks
giadarol Nov 24, 2025
341f8ab
Linear case also passes
giadarol Nov 24, 2025
e6f3242
Add comment
giadarol Nov 24, 2025
151fc2f
Check backward twiss
giadarol Nov 25, 2025
6b5f506
Check survey back
giadarol Nov 25, 2025
faf73b3
Add checks
giadarol Nov 25, 2025
b0f4a61
Check on angle
giadarol Nov 25, 2025
27b9ae0
I have a sign error on the angle
giadarol Nov 25, 2025
dcacd70
Comments
giadarol Nov 25, 2025
bab2399
Check angle on sliced survey
giadarol Nov 25, 2025
7de0506
Checks on chicane quite complete
giadarol Nov 25, 2025
5af68c0
Strange file... will remove
giadarol Nov 25, 2025
c5bef3d
Add check
giadarol Nov 25, 2025
ee77b84
Vertical chicane
giadarol Nov 25, 2025
1dcf014
Add test
giadarol Nov 25, 2025
4496468
Add test
giadarol Nov 25, 2025
ebb0af3
Add test
giadarol Nov 25, 2025
1931cd5
Add test
giadarol Nov 25, 2025
576830a
Fix in example and test
giadarol Nov 26, 2025
eb7de1d
Enable packages to dynamically register include paths with xobjects
szymonlopaciuk Aug 1, 2025
b21bd64
Make more progress on migrating Xtrack to the include-headers facility
szymonlopaciuk Aug 7, 2025
395ac10
Align with Xobjects
szymonlopaciuk Nov 10, 2025
23fd910
Remove magic comments from Xtrack (incl. local particle api placeholder)
szymonlopaciuk Nov 14, 2025
019e8e0
Bump to Python 3.9+
szymonlopaciuk Nov 14, 2025
ccdcc5f
Add tfs-pandas to pyproject.toml
szymonlopaciuk Nov 26, 2025
619df51
Merge branch 'feature/generic_rbend' into release/0.97.0
szymonlopaciuk Nov 26, 2025
8fabe09
Get rid of some warnings
szymonlopaciuk Nov 26, 2025
e709825
Merge branch 'deprecate-warn-unfreeze' into release/0.97.0
szymonlopaciuk Nov 26, 2025
8bf2101
Merge remote-tracking branch 'eltos/patch-8' into release/0.97.0
szymonlopaciuk Nov 26, 2025
1e33ae3
Merge remote-tracking branch 'eltos/patch-7' into release/0.97.0
szymonlopaciuk Nov 26, 2025
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
13 changes: 7 additions & 6 deletions examples/element_internal_record/000_internal_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,22 @@ class TestElementRecord(xo.HybridClass):
# element number.

track_method_source = r'''
/*gpufun*/
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0){
#include "xtrack/headers/track.h"

GPUFUN
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0)
{
// Extract the record and record_index
TestElementRecordData record = TestElementData_getp_internal_record(el, part0);
RecordIndex record_index = NULL;
if (record){
if (record) {
record_index = TestElementRecordData_getp__index(record);
}

int64_t n_kicks = TestElementData_get_n_kicks(el);
printf("n_kicks %d\n", (int)n_kicks);

//start_per_particle_block (part0->part)
START_PER_PARTICLE_BLOCK(part0, part);

for (int64_t i = 0; i < n_kicks; i++) {
double rr = 1e-6 * RandomUniform_generate(part);
Expand All @@ -72,8 +74,7 @@ class TestElementRecord(xo.HybridClass):
}
}


//end_per_particle_block
END_PER_PARTICLE_BLOCK;
}
'''

Expand Down
8 changes: 5 additions & 3 deletions examples/element_internal_record/001_multirecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class TestElementRecord(xo.HybridClass):
# code of the beam element.

TestElement_track_method_source = r'''
/*gpufun*/
#include "xtrack/headers/track.h"

GPUFUN
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0){

// Extract the record and record_index
Expand All @@ -60,7 +62,7 @@ class TestElementRecord(xo.HybridClass):
int64_t n_kicks = TestElementData_get_n_kicks(el);
printf("n_kicks %d\n", (int)n_kicks);

//start_per_particle_block (part0->part)
START_PER_PARTICLE_BLOCK(part0, part);

// Record in table1 info about the ingoing particle
if (record){
Expand Down Expand Up @@ -106,7 +108,7 @@ class TestElementRecord(xo.HybridClass):
}
}

//end_per_particle_block
END_PER_PARTICLE_BLOCK;
}
'''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class TestElementRecord(xo.HybridClass):
# code of the beam element.

TestElement_track_method_source = r'''
/*gpufun*/
#include "xtrack/headers/track.h"

GPUFUN
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0){

// Extract the record and record_index
Expand All @@ -59,7 +61,7 @@ class TestElementRecord(xo.HybridClass):
int64_t n_kicks = TestElementData_get_n_kicks(el);
// printf("n_kicks %d\n", (int)n_kicks);

//start_per_particle_block (part0->part)
START_PER_PARTICLE_BLOCK(part0, part);

// Record in table1 info about the ingoing particle
if (record){
Expand Down Expand Up @@ -105,7 +107,7 @@ class TestElementRecord(xo.HybridClass):
}
}

//end_per_particle_block
END_PER_PARTICLE_BLOCK;
}
'''

Expand Down
11 changes: 7 additions & 4 deletions examples/random_number_generator/001_usage_in_beam_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ class TestElement(xt.BeamElement):

_extra_c_sources = [
'''
/*gpufun*/
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0){
//start_per_particle_block (part0->part)
#include "xtrack/headers/track.h"

GPUFUN
void TestElement_track_local_particle(TestElementData el, LocalParticle* part0)
{
START_PER_PARTICLE_BLOCK(part0, part);
double rr = !!GENERATOR!!_generate(part);
LocalParticle_set_x(part, rr);
//end_per_particle_block
END_PER_PARTICLE_BLOCK;
}
'''.replace('!!GENERATOR!!', generator_to_test)
]
Expand Down
20 changes: 10 additions & 10 deletions examples/spin_lep/chirp_kicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ class VerticalChirpKicker(xt.BeamElement):

_extra_c_sources =['''

#include <headers/track.h>
#include <beam_elements/elements_src/track_magnet.h>
#include "xtrack/headers/track.h"
#include "xtrack/beam_elements/elements_src/track_magnet.h"

/*gpufun*/
GPUFUN
void VerticalChirpKicker_track_local_particle(
VerticalChirpKickerData el, LocalParticle* part0){

VerticalChirpKickerData el, LocalParticle* part0)
{
double const k0sl = VerticalChirpKickerData_get_k0sl(el);
double const q_start = VerticalChirpKickerData_get_q_start(el);
double const q_end = q_start + VerticalChirpKickerData_get_q_span(el);
double const num_turns = VerticalChirpKickerData_get_num_turns(el);
double const length = VerticalChirpKickerData_get_length(el);

//start_per_particle_block (part0->part)
START_PER_PARTICLE_BLOCK(part0, part);
double const at_turn = LocalParticle_get_at_turn(part);
if (at_turn < num_turns){
if (at_turn < num_turns) {
// integrating to get the instantaneous phase
double const phi = 2 * PI * q_start * at_turn
+ PI * (q_end - q_start) / ((double) num_turns) * ((double) at_turn * at_turn);
Expand All @@ -60,9 +60,9 @@ class VerticalChirpKicker(xt.BeamElement):
0, // frame curvature
length,
length // lpath - same for a thin element
);
#endif
);
#endif
}
//end_per_particle_block
END_PER_PARTICLE_BLOCK;
}
''']
3 changes: 2 additions & 1 deletion examples/true_rbend/000a_check_edge_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
l_ref = xt.Line([b_ref])
l_ref.append('end', xt.Marker())
l_ref.particle_ref = xt.Particles(p0c=10e9)
tw_ref0 = l_ref.twiss(betx=1, bety=1)
tw_ref0 = l_ref.twiss(betx=1, bety=1, strengths=True)
tw_ref = l_ref.twiss(betx=1, bety=1, x=2e-3, px=1e-3, y=2e-3, py=2e-3, delta=1e-3)

b_test = xt.RBend(
angle=0.1, k0_from_h=True, length_straight=3)
b_test.rbend_model = 'straight-body'
b_test.model = 'bend-kick-bend'
b_test.num_multipole_kicks = 100
b_test.rbend_compensate_sagitta = True
b_test.edge_entry_model = edge_model
b_test.edge_exit_model = edge_model
l_test = xt.Line([b_test])
Expand Down
72 changes: 72 additions & 0 deletions examples/true_rbend/000c_check_edge_full_angle._diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import xtrack as xt
import numpy as np
import xobjects as xo

edge_model = 'full'

b_ref = xt.RBend(angle=0.1, k0_from_h=True, length_straight=3., rbend_angle_diff=0.1)
b_ref.edge_entry_model = edge_model
b_ref.edge_exit_model = edge_model
b_ref.model = 'rot-kick-rot'
b_ref.num_multipole_kicks = 100
l_ref = xt.Line([b_ref])
l_ref.append('end', xt.Marker())
l_ref.particle_ref = xt.Particles(p0c=10e9)
tw_ref0 = l_ref.twiss(betx=1, bety=1, strengths=True)
tw_ref = l_ref.twiss(betx=1, bety=1, x=2e-3, px=1e-3, y=2e-3, py=2e-3, delta=1e-3)

b_test = xt.RBend(
angle=0.1, k0_from_h=True, length_straight=3, rbend_angle_diff=0.1,
rbend_shift=0, rbend_compensate_sagitta=False)
b_test.rbend_model = 'straight-body'
b_test.model = 'bend-kick-bend'
b_test.num_multipole_kicks = 100
b_test.edge_entry_model = edge_model
b_test.edge_exit_model = edge_model

b_test.rbend_shift += b_test._x0_in

l_test = xt.Line([b_test])
l_test.append('end', xt.Marker())
l_test.particle_ref = xt.Particles(p0c=10e9)
tw_test0 = l_test.twiss(betx=1, bety=1)
tw_test = l_test.twiss(betx=1, bety=1, x=2e-3, px=1e-3, y=2e-3, py=2e-3, delta=1e-3)

xo.assert_allclose(tw_ref0.betx, tw_test0.betx, rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_ref0.bety, tw_test0.bety, rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_ref0.x, tw_test0.x, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.y, tw_test0.y, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.s, tw_test0.s, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.zeta, tw_test0.zeta, rtol=0, atol=1e-11)
xo.assert_allclose(tw_ref0.px, tw_test0.px, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.py, tw_test0.py, rtol=0, atol=1e-12)

xo.assert_allclose(tw_ref.betx, tw_test.betx, rtol=5e-9, atol=0.0)
xo.assert_allclose(tw_ref.bety, tw_test.bety, rtol=5e-9, atol=0.0)
xo.assert_allclose(tw_ref.x, tw_test.x, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref.y, tw_test.y, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref.s, tw_test.s, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref.zeta, tw_test.zeta, rtol=0, atol=1e-1)
xo.assert_allclose(tw_ref.px, tw_test.px, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref.py, tw_test.py, rtol=0, atol=1e-12)

l_sliced = l_test.copy(shallow=True)
l_sliced.cut_at_s(np.linspace(0, l_test.get_length(), 100))
tw_test_sliced0 = l_sliced.twiss(betx=1, bety=1)

xo.assert_allclose(tw_test_sliced0.betx[-1], tw_test0.betx[-1], rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced0.bety[-1], tw_test0.bety[-1], rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced0.x[-1], tw_test0.x[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.y[-1], tw_test0.y[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.s[-1], tw_test0.s[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.zeta[-1], tw_test0.zeta[-1], rtol=0, atol=1e-11)
xo.assert_allclose(tw_test_sliced0.px[-1], tw_test0.px[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.py[-1], tw_test0.py[-1], rtol=0, atol=1e-12)

import matplotlib.pyplot as plt
plt.close('all')

tw_test_sliced0.plot('x')
plt.xlim(-0.1, 3.1)

plt.show()
96 changes: 96 additions & 0 deletions examples/true_rbend/000d_check_edge_linear_angle_diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import xtrack as xt
import numpy as np
import xobjects as xo

edge_model = 'linear'

b_ref = xt.RBend(angle=0.1, k0_from_h=True, length_straight=3., rbend_angle_diff=0.1)
b_ref.edge_entry_model = edge_model
b_ref.edge_exit_model = edge_model
b_ref.model = 'rot-kick-rot'
b_ref.num_multipole_kicks = 100
l_ref = xt.Line([b_ref])
l_ref.append('end', xt.Marker())
l_ref.particle_ref = xt.Particles(p0c=10e9)
tw_ref0 = l_ref.twiss(betx=1, bety=1)
tw_ref = l_ref.twiss(betx=1, bety=1, x=2e-3, px=1e-3, y=2e-3, py=2e-3, delta=1e-3)

b_test = xt.RBend(
angle=0.1, k0_from_h=True, length_straight=3, rbend_angle_diff=0.1,
rbend_shift=0, rbend_compensate_sagitta=False)
b_test.rbend_model = 'straight-body'
b_test.model = 'bend-kick-bend'
b_test.num_multipole_kicks = 100
b_test.edge_entry_model = edge_model
b_test.edge_exit_model = edge_model

b_test.rbend_shift += b_test._x0_in

l_test = xt.Line([b_test])
l_test.append('end', xt.Marker())
l_test.particle_ref = xt.Particles(p0c=10e9)
tw_test0 = l_test.twiss(betx=1, bety=1)
tw_test = l_test.twiss(betx=1, bety=1, x=2e-3, px=1e-3, y=2e-3, py=2e-3, delta=1e-3)

xo.assert_allclose(tw_ref0.betx, tw_test0.betx, rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_ref0.bety, tw_test0.bety, rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_ref0.x, tw_test0.x, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.y, tw_test0.y, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.s, tw_test0.s, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.zeta, tw_test0.zeta, rtol=0, atol=1e-11)
xo.assert_allclose(tw_ref0.px, tw_test0.px, rtol=0, atol=1e-12)
xo.assert_allclose(tw_ref0.py, tw_test0.py, rtol=0, atol=1e-12)

xo.assert_allclose(tw_ref.betx, tw_test.betx, rtol=5e-6, atol=0.0)
xo.assert_allclose(tw_ref.bety, tw_test.bety, rtol=5e-6, atol=0.0)
xo.assert_allclose(tw_ref.x, tw_test.x, rtol=0, atol=2e-8)
xo.assert_allclose(tw_ref.y, tw_test.y, rtol=0, atol=2e-8)
xo.assert_allclose(tw_ref.s, tw_test.s, rtol=0, atol=2e-12)
xo.assert_allclose(tw_ref.zeta, tw_test.zeta, rtol=0, atol=1e-1)
xo.assert_allclose(tw_ref.px, tw_test.px, rtol=0, atol=5e-9)
xo.assert_allclose(tw_ref.py, tw_test.py, rtol=0, atol=5e-9)

tw_back = l_test.twiss(init=tw_test, init_at='end')

assert tw_back.orientation == 'backward'
xo.assert_allclose(tw_back.betx, tw_test.betx, rtol=5e-6, atol=0.0)
xo.assert_allclose(tw_back.bety, tw_test.bety, rtol=5e-6, atol=0.0)
xo.assert_allclose(tw_back.x, tw_test.x, rtol=0, atol=1e-8)
xo.assert_allclose(tw_back.y, tw_test.y, rtol=0, atol=1e-8)
xo.assert_allclose(tw_back.s, tw_test.s, rtol=0, atol=1e-12)
xo.assert_allclose(tw_back.zeta, tw_test.zeta, rtol=0, atol=1e-1)
xo.assert_allclose(tw_back.px, tw_test.px, rtol=0, atol=1e-9)
xo.assert_allclose(tw_back.py, tw_test.py, rtol=0, atol=1e-9)

l_sliced = l_test.copy(shallow=True)
l_sliced.cut_at_s(np.linspace(0, l_test.get_length(), 100))
tw_test_sliced0 = l_sliced.twiss(betx=1, bety=1)

xo.assert_allclose(tw_test_sliced0.betx[-1], tw_test0.betx[-1], rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced0.bety[-1], tw_test0.bety[-1], rtol=1e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced0.x[-1], tw_test0.x[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.y[-1], tw_test0.y[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.s[-1], tw_test0.s[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.zeta[-1], tw_test0.zeta[-1], rtol=0, atol=1e-11)
xo.assert_allclose(tw_test_sliced0.px[-1], tw_test0.px[-1], rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced0.py[-1], tw_test0.py[-1], rtol=0, atol=1e-12)

tw_test_sliced_back = l_sliced.twiss(init=tw_test_sliced0, init_at='end')

assert tw_test_sliced_back.orientation == 'backward'
xo.assert_allclose(tw_test_sliced_back.betx, tw_test_sliced0.betx, rtol=5e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced_back.bety, tw_test_sliced0.bety, rtol=5e-9, atol=0.0)
xo.assert_allclose(tw_test_sliced_back.x, tw_test_sliced0.x, rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced_back.y, tw_test_sliced0.y, rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced_back.s, tw_test_sliced0.s, rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced_back.zeta, tw_test_sliced0.zeta, rtol=0, atol=1e-11)
xo.assert_allclose(tw_test_sliced_back.px, tw_test_sliced0.px, rtol=0, atol=1e-12)
xo.assert_allclose(tw_test_sliced_back.py, tw_test_sliced0.py, rtol=0, atol=1e-12)

import matplotlib.pyplot as plt
plt.close('all')

tw_test_sliced0.plot('x')
plt.xlim(-0.1, 3.1)

plt.show()
Loading