ytree-project / ytree

A yt-based merger-tree code.
Other
15 stars 10 forks source link

Testing the detection of file formats #102

Closed manodeep closed 3 years ago

manodeep commented 3 years ago

Now that ytree supports quite a wide variety of file formats, it might be good to test that the file formats are always being inferred correctly. Given that ytree has a suite of test datafiles with known formats, would it be worthwhile to run each test datafile through all the frontends and make sure that the format is detected correctly (i.e., the answer is False for all but one file)?

Perhaps such a (unit)-test is already being done as part of the usual testing...

brittonsmith commented 3 years ago

This is included in the ArborTest class as the test_arbor_type function.

brittonsmith commented 3 years ago

To expand a bit on my previous answer, the ytree.load operation tests all possible frontends to see if _is_valid returns true. An exception is raised if more than one frontend is identified with a given file. I'll let you close this issue as a test of your new powers if this answers your question.

manodeep commented 3 years ago

By the (new) powers vested in me, I declare this issue closed :D