mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
Feat/files idl xsf (#185)
* added kwrg idl to ms5_xsf_read * change output, warn user if expected idl not found
This commit is contained in:
parent
e97cc519a9
commit
1a811b04f3
2 changed files with 61 additions and 19 deletions
|
@ -121,7 +121,7 @@ def test_gf_coupling():
|
|||
|
||||
|
||||
def test_read_ms5_xsf():
|
||||
path = './tests//data/openqcd_test/'
|
||||
path = './tests/data/openqcd_test/'
|
||||
prefix = "ms5_xsf_T24L16"
|
||||
corr = "gA"
|
||||
qc = 'dd'
|
||||
|
@ -145,6 +145,37 @@ def test_read_ms5_xsf():
|
|||
pe.input.openQCD.read_ms5_xsf(path, prefix, qc, fcorr)
|
||||
|
||||
|
||||
def test_read_ms5_xsf_idl():
|
||||
path = './tests/data/openqcd_test/'
|
||||
prefix = "ms5_xsf_T24L16"
|
||||
corr = "gA"
|
||||
qc = 'dd'
|
||||
|
||||
c = pe.input.openQCD.read_ms5_xsf(path, prefix, qc, corr, idl=[range(1, 6), range(1, 7), range(1, 8)])
|
||||
|
||||
assert c.real[12].names == ['ms5_xsf_T24L16|r1', 'ms5_xsf_T24L16|r2', 'ms5_xsf_T24L16|r3']
|
||||
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r1'] == 5)
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r2'] == 6)
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r3'] == 7)
|
||||
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r1'] == range(1, 6))
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r2'] == range(1, 7))
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r3'] == range(1, 8))
|
||||
|
||||
c = pe.input.openQCD.read_ms5_xsf(path, prefix, qc, corr, idl=[range(1, 11, 2), range(1, 11, 2), range(1, 11, 2)])
|
||||
|
||||
assert c.real[12].names == ['ms5_xsf_T24L16|r1', 'ms5_xsf_T24L16|r2', 'ms5_xsf_T24L16|r3']
|
||||
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r1'] == 5)
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r2'] == 5)
|
||||
assert (c.real[12].shape['ms5_xsf_T24L16|r3'] == 5)
|
||||
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r1'] == range(1, 11, 2))
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r2'] == range(1, 11, 2))
|
||||
assert (c.real[12].idl['ms5_xsf_T24L16|r3'] == range(1, 11, 2))
|
||||
|
||||
|
||||
def test_find_files():
|
||||
path = './tests/data/openqcd_test/'
|
||||
prefix = "ms5_xsf_T24L16"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue