You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pytest.mark.parametrize("file_fixture", ["_tfs_file_wise"], ids=["wise"])deftest_madx_can_read_it(self, file_fixture, request):
""" Use this test to assert that madx can read all our example files"""file_path=request.getfixturevalue(file_fixture)
dframe=tfs.read(file_path)
withMadx() asmadx:
madx.command.readtable(file=str(file_path), table="test_table")
assertmadx.table.test_tableisnotNone# check table has loaded# for the wise test, the header is all scrambled:# headers = {k.upper(): v for k, v in madx.table.test_table.summary.items()}# Check validity of the loaded table, here we use pandas.Series and assert_series_equal instead# of numpy.array_equal to allow for (very) small relative numerical differences on loadingforcolumnindframe.columns:
assertcolumninmadx.table.test_tabletry:
series=dframe[column].str.lower() # MADX converts ALL strings to lowercaseexceptAttributeError:
series=dframe[column]
assert_series_equal(
pandas.Series(madx.table.test_table[column]), series, check_names=False
)
Feature Description
Option to check for madx-compatibility on writing
Possible Implementation
into the writer add a flag: madx_compatibility with the options
None
(default),warn
orerror
.If not none it should be checked that:
a) the header contains TYPE
b) header-names do not contain spaces
... maybe more?
The text was updated successfully, but these errors were encountered: