pylhc / tfs

Python package to handle TFS files
https://pylhc.github.io/tfs/
MIT License
9 stars 4 forks source link

Merging functions and reorganized structure #87

Closed fsoubelet closed 3 years ago

fsoubelet commented 3 years ago

This is a draft for #56 as well as a small reorganization of the internal structure to be cleaner and closer to pandas. It is not breaking as functions are exported to top level.

A concat function is also added and exported as tfs.concat and the following functions are overwritten from the pandas.DataFrame: append, join and merge.

Data manipulation is fully handled by the corresponding pandas functions.

TO BE DONE

JoschD commented 3 years ago

I would:

About the headers: I thought about what I think would make the most sense and then looked what you did. And it was exactly the same. So for me this looks fine.

fsoubelet commented 3 years ago

I think this is ready for review now.

Review away.

fsoubelet commented 3 years ago

Tentatively, commit d9f4241 adds cpymad as a test dependency only and adds a test that loads a TFS file written by tfs-pandas (with an eol at eof) into a table in the MAD-X process to confirm these are accepted.

fsoubelet commented 3 years ago

As of dc4fd58, testing the loading of a file written by tfs-pandas with eol at eof into MAD-X is complete.

The presence of the appropriate loaded table is tested, and the tests make use of pandas.testing.assert_series_equal to allow for a small relative tolerance (which numpy.array_equal does not allow) to test that the content of the loaded table is the proper one.