Skip to content

Commit 6332714

Browse files
committed
Python: Simplify Map6x6 Exposure
1 parent f6d70b1 commit 6332714

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

examples/fodo_userdef/run_fodo_userdef.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# -*- coding: utf-8 -*-
88

9-
from impactx import ImpactX, distribution, elements, twiss
9+
from impactx import ImpactX, Map6x6, distribution, elements, twiss
1010

1111
sim = ImpactX()
1212

@@ -49,7 +49,7 @@
4949
monitor = elements.BeamMonitor("monitor", backend="h5")
5050

5151
# add a user-defined, linear element for the drifts
52-
Iden = elements.LinearMap.Map6x6.identity()
52+
Iden = Map6x6.identity()
5353
R1, R2 = Iden, Iden
5454

5555
ds1 = 0.25

examples/linear_map/run_map.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# from elements import LinearTransport
1010
import numpy as np
1111

12-
from impactx import ImpactX, distribution, elements, twiss
12+
from impactx import ImpactX, Map6x6, distribution, elements, twiss
1313

1414
sim = ImpactX()
1515

@@ -57,7 +57,7 @@
5757
monitor = elements.BeamMonitor("monitor", backend="h5")
5858

5959
# initialize the linear map
60-
Iden = elements.LinearMap.Map6x6.identity()
60+
Iden = Map6x6.identity()
6161
Rmat = Iden
6262

6363
# desired tunes

examples/scraping_beam/run_scraping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# -*- coding: utf-8 -*-
88

9-
from impactx import ImpactX, distribution, elements
9+
from impactx import ImpactX, Map6x6, distribution, elements
1010

1111
sim = ImpactX()
1212

@@ -61,7 +61,7 @@
6161
monitor = elements.BeamMonitor("monitor", backend="h5")
6262

6363
# initialize the linear map
64-
Iden = elements.LinearMap.Map6x6.identity()
64+
Iden = Map6x6.identity()
6565
Rmat = Iden
6666
Rmat[2, 1] = correlation_k
6767
Rmat[4, 3] = correlation_k

src/python/elements.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,7 @@ namespace
158158

159159
void init_elements(py::module& m)
160160
{
161-
/*
162-
m.def_property_readonly_static(
163-
"Map6x6",
164-
[](py::object){ return py::type::of<Map6x6>(); },
165-
"1-indexed, Fortran-ordered, 6x6 linear transport map type"
166-
);
167-
*/
161+
m.attr("Map6x6") = py::type::of<Map6x6>();
168162

169163
py::module_ me = m.def_submodule(
170164
"elements",

0 commit comments

Comments
 (0)