VERITAS-Observatory / gammapy-tools

Repository with tools for gammapy analysis
GNU General Public License v3.0
2 stars 0 forks source link

Cannot Rerun prepare datasets #35

Closed matthew-w-lundy closed 1 month ago

matthew-w-lundy commented 1 month ago

prepare_datasetdoes not allow the user to pass an overwrite flag to copy_obs which means that to re-run prepare datasets you need to delete your index files.

https://github.com/VERITAS-Observatory/gammapy-tools/blob/6c24bc96abf49c74fae55d9ad4040a363bc0790e/gammapy_tools/make_background/prepare_data.py#L51C1-L62C1

steob92 commented 1 month ago

This is mainly a gammapy issue. There is no overwrite flag for copy_obs. My philosophy was not to trust that the user hasn't passed some important directory by accident and instead require that they manually delete it.

We could implement our own check to see if there are index files, include an overwrite flag and/or have them enter "yes" to delete or something.

matthew-w-lundy commented 1 month ago

I believe there is this functionality in gammapy: https://github.com/gammapy/gammapy/blob/18b65d5cce21876d53aa7faf54aaeccd68e8b76c/gammapy/data/data_store.py#L419C1-L434C41

steob92 commented 1 month ago

hmm. Seems to work now. Must be a new addition. Added to: ffca60a

We'll make a new release with #34 and #36 (and other errors that come up with testing...)