gammapy / gamma-cat

An open data collection and source catalog for gamma-ray astronomy
https://gamma-cat.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
15 stars 17 forks source link

Clean up build of input index file #234

Open pdeiml opened 6 years ago

pdeiml commented 6 years ago

This PR is on top of https://github.com/gammapy/gamma-cat/pull/211. Hence, you should firstly review and merge https://github.com/gammapy/gamma-cat/pull/211 before looking at the diff of this PR!

The plan is to have to classes InputCollection and OutputCollection each handling - as the names suggests - every data in the input and output folders, respectively.

This PR starts to write the InputCollection and it implements to first things: 1) A list of all info.yaml files (stored in input folder) is created via the class InputInfoCollection (see inline comment). 2) All of these info-files are validated (see inline comment). 3) Secondly, the input_index_file is created after (!) the info-files are validated (see inline comment). Step 2) and 3) are handled via a run function in InputCollection (see inline comment).

In the future these three steps should be the very first thing make.py does! This PR does not (!) change the procedure of make.py, it only introduces a ugly way to run the upper steps when make.py collection --step input-index is executed (see inline comment). There needs to be done a follow up PR which cleans up make.py.

The second small commit is only a small fix in the _make_index_file_input function so that it uses the to_list() function of InputInfoCollection. But the functionality is not changed.

pdeiml commented 6 years ago

I don't understand the error of travis ci. It is a http error? make.py all does work locally, hence, there shouldn't be an error.

pdeiml commented 6 years ago

Honestly, I don't know whether you can merge this now after merging #211 :-D I won't have time the next days but I will try to take a look to this again and then I give you feedback here.