From f6cf8eb5f141d1cf7d8e889318dc7ec5d8575e3d Mon Sep 17 00:00:00 2001 From: Marco Garten Date: Tue, 30 Aug 2022 16:58:49 -0700 Subject: [PATCH] Update examples according to API changes Caution: Examples still not working again --- examples/chicane/chicane.madx | 2 +- examples/chicane/run_chicane_madx.py | 4 ++-- examples/fodo/run_fodo_madx.py | 4 ++-- src/python/impactx/MADXParser.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/chicane/chicane.madx b/examples/chicane/chicane.madx index 5c11b2464..21c8c29f4 100644 --- a/examples/chicane/chicane.madx +++ b/examples/chicane/chicane.madx @@ -11,7 +11,7 @@ SBEND1: sbend, L=0.50037, angle=0.048345, e1=0.000, e2=0.000, k1=0.00; SBEND2: sbend, L=0.50037, angle=-0.048345, e1=0.000, e2=0.000, k1=0.00; ! dipole edge elements DIPEDGE1: dipedge, H=0.096618357, e1=-0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00; -DIPEDGE2: dipedge, H=0.096618357, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;; +DIPEDGE2: dipedge, H=0.096618357, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00; CHICANE: Line=(SBEND1,DIPEDGE1,DRIFT1,DIPEDGE2,SBEND2,DRIFT2,SBEND2,DIPEDGE2,DRIFT1,DIPEDGE1,SBEND1,DRIFT3); USE, SEQUENCE = CHICANE; diff --git a/examples/chicane/run_chicane_madx.py b/examples/chicane/run_chicane_madx.py index 7da2a3d59..bab8ed69f 100755 --- a/examples/chicane/run_chicane_madx.py +++ b/examples/chicane/run_chicane_madx.py @@ -9,7 +9,7 @@ import amrex from impactx import (ImpactX, MADXParser, RefPart, distribution, elements, - madx2impactx_beam, madx2impactx_lattice) + read_beam, read_lattice) sim = ImpactX() @@ -37,7 +37,7 @@ beamline = madx.getBeamline() -ref_particle_dict = madx2impactx_beam( +ref_particle_dict = read_beam( madx.getParticle(), # if particle species is known, mass, charge, and potentially energy are set to default # TODO MADX parser needs to extract charge if it's given, # TODO MADX parser needs to extract mass if it's given, diff --git a/examples/fodo/run_fodo_madx.py b/examples/fodo/run_fodo_madx.py index 66a9a5ce4..afd68530e 100755 --- a/examples/fodo/run_fodo_madx.py +++ b/examples/fodo/run_fodo_madx.py @@ -9,7 +9,7 @@ import amrex from impactx import (ImpactX, MADXParser, RefPart, distribution, elements, - madx2impactx_beam, madx2impactx_lattice) + read_beam, read_lattice) sim = ImpactX() @@ -36,7 +36,7 @@ beamline = madx.getBeamline() -ref_particle_dict = madx2impactx_beam( +ref_particle_dict = read_beam( madx.getParticle(), # if particle species is known, mass, charge, and potentially energy are set to default # TODO MADX parser needs to extract charge if it's given, # TODO MADX parser needs to extract mass if it's given, diff --git a/src/python/impactx/MADXParser.py b/src/python/impactx/MADXParser.py index a6520ad8b..f6c6d815d 100644 --- a/src/python/impactx/MADXParser.py +++ b/src/python/impactx/MADXParser.py @@ -213,7 +213,7 @@ def parse(self, fn): self.__dipedge[obj.group(i)] = float(obj.group(i + 1)) else: raise MADXInputError( - "DipEgde", + "DipEdge", "Line " + str(nLine) + ": Parameter " @@ -393,7 +393,7 @@ def __str__(self): + " * #quadrupole:\t" + str(nTypes[2]) + "\n" - + " * #dipedge:\t" + + " * #dipedge:\t" + str(nTypes[3]) + "\n" + " beam:\t\n"