Skip to content

Convert doprnt to a Number #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions tests/tests/test-convergence/converge.mad
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ local function run_test(cfg)
if not cfg.dorun then
local cfg_tbl, res_tbl = get_prev_res(cfg.name, out_dir)
res_tbl.max_order = cfg.order
if cfg.doprnt then show_res(res_tbl, cfg_tbl, cfg_tbl:colnames(), cfg.tol) end
if cfg.doprnt > 0 then show_res(res_tbl, cfg_tbl, cfg_tbl:colnames(), cfg.tol) end
if cfg.doplot then plot_res(res_tbl, cfg, plt_dir, cfg.dofit, cfg_tbl) end
return
end
Expand All @@ -239,7 +239,7 @@ local function run_test(cfg)
novector = true,
}

if cfg.doprnt then
if cfg.doprnt > 1 then
io.write("Running ", cfg.name, " (tol = ", cfg.tol, ")\n")
for i = 0, cfg.order do io.write("order ", i, "\t") end
io.write("\n")
Expand Down Expand Up @@ -285,7 +285,7 @@ local function run_test(cfg)
end

-- Print the results
if cfg.doprnt then
if cfg.doprnt > 0 then
show_res(results, results, cfg.alist, cfg.tol)
end

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-convergence/test-convergence.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false
dofit = false, -- Default: false
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-all-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ref_cfg = MAD.object "ref" { -- The reference configuration for all tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doplot = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false

dobck = true, -- Default: true -> Whether to do backtracking (not fringes)
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-curved-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestCurved = {}
function TestCurved:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-electric-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function TestElectric:setUp()
-- Turn off all unnecessary components for unit testing

ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-fringe-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestFringes = {}
function TestFringes:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-misalignment-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestMis = {} --backtrack has high error (1e-12) for straight elements
function TestMis:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-misc-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestMisc = {}
function TestMisc:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-multipole-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestMult = {}
function TestMult:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-patch-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TestPatch = {}
function TestPatch:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test-ng-maps/test-subelm-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function TestSubElm:setUp()
-- Turn off all unnecessary components for unit testing

ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/test-ng-maps/trackvsng.mad
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ local function run_test(cfg, equiv)
novector = true,
}

if cfg.doprnt then
io.write("Running ", cfg.name, " (tol = ", tostring(cfg.tol), ")\n")
io.write("Running ", cfg.name, " (tol = ", tostring(cfg.tol), ")\n")
if cfg.doprnt > 1 then
-- Print the header
io.write("cfgid\t")
for i = 0, cfg.order do io.write("order "..i.."\t") end
Expand Down Expand Up @@ -300,7 +300,7 @@ local function run_test(cfg, equiv)
if cfg.dosave then save_res(cfg, results, nil, {"cfgid", "test_type"}) end

-- Print the results
if cfg.doprnt then show_res(results, results, cfg.alist, cfg.tol) end
if cfg.doprnt > 0 then show_res(results, results, cfg.alist, cfg.tol) end

-- Plot the results
if cfg.doplot then
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-electric-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -40,7 +40,7 @@ function TestElectric:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-misalignment-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand Down Expand Up @@ -34,7 +34,7 @@ TestMis = {}
function TestMis:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-misc-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestMisc:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-mult-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestMult:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-octupole-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestOctupole:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-patch-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestPatch:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-quad-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestQuad:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-rbend-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestRBend:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-sbend-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestSBend:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-sextupole-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestSextupole:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/test-ptc-maps/test-sol-maps.mad
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local ref_cfg = object "ref" {
-- How to run the tests
dorun = true, -- Default: true
dosave = false, -- Default: false
doprnt = false, -- Default: false
doprnt = 0 , -- Default: 0
dodbg = false, -- Default: false
doplot = false, -- Default: false

Expand All @@ -38,7 +38,7 @@ function TestSol:setUp()
-- Turn off all unnecessary components for unit testing
ref_cfg.gen_utest = false
ref_cfg.dodbg = false
ref_cfg.doprnt = false
ref_cfg.doprnt = 0
ref_cfg.dosave = false

-- Turn on the components for unit testing
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/test-ptc-maps/trackvsptc.mad
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ local function run_test(cfg)
novector = true,
}

if cfg.doprnt then
io.write("Running ", cfg.name, " (tol = ", tostring(cfg.tol), ")\n", "cfgid\t")
io.write("Running ", cfg.name, " (tol = ", tostring(cfg.tol), ")\n", "cfgid\t")
if cfg.doprnt > 1 then
for i = 0, cfg.order do io.write("order ", i, "\t") end
io.write("\n")
end
Expand All @@ -129,7 +129,7 @@ local function run_test(cfg)
if cfg.dosave then save_res(cfg, results) end

-- Print the results
if cfg.doprnt then show_res(results, results, cfg.alist, cfg.tol) end
if cfg.doprnt > 0 then show_res(results, results, cfg.alist, cfg.tol) end

-- Plot the results
if cfg.doplot then plot_trk_res(results, cfg, plt_dir) end
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/tools/plot-tool.mad
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ end
local function do_norun(cfg)
local cfg_tbl, res_tbl = get_prev_res(cfg.name, out_dir)
res_tbl.max_order = cfg.order
if cfg.doprnt then show_res(res_tbl, cfg_tbl, cfg_tbl:colnames(), cfg.tol) end
if cfg.doprnt > 0 then show_res(res_tbl, cfg_tbl, cfg_tbl:colnames(), cfg.tol) end
if cfg.doplot then plot_trk_res(res_tbl, cfg, plt_dir, cfg_tbl) end
end

Expand Down
Loading