Closed Buglakova closed 8 months ago
I figured that the
dataset.json
still has entries about this deleted source and if I go and remove them manually, I can add it again. What would be the correct way to completely delete a source?
remove_source
will remove the entry from the dataset.json
if it fully runs through. I just checked and the unittest covers this, so I am pretty sure this works. However, in your case remove_source
fails with an error, so the function does not reach the point where the updated metadata is written out. You can see in the source code that this is the last thing that happens in the function.
The function fails because the folder 'g/kreshuk/buglakova/projects/platy_registration/data/platybrowser-smfish-project/data/1.0.1/images/bdv-n5/prox-brn3-sfg_pl3_dapi.n5'
that it tries to remove (because of remove_data=True
) is not there. Probably you have some inconsistent state because some previous failed attempt to remove the source. Can you try again with a source where you are sure that the image data is there? Then it should work.
This is not such an issue, because I can just delete that directory after adding the source, but it's quite unexpected.
Yes, that is true. You have to remove this tmp
folder in order to re-add the source. I agree that it's a bit unexpected but this folder contains important debug information, so I don't want to remove it automatically.
I figured out that it was because I run it with Snakemake and the n5
file was the target of the rule. When the rule is rerun, Snakemake deletes the target file before running any commands. Thanks for help!
Hello,
I add an image source and then want to delete it before adding another image with the same source name. I remove source the following way:
Then adding it with
add_image
fails with the following error:I figured that the
dataset.json
still has entries about this deleted source and if I go and remove them manually, I can add it again. What would be the correct way to completely delete a source?Another problem I have is that after adding the source I have temporary directories with the name like "tmp_dataset_source" remaining in the directory where I was running a script. If I delete the source and information in
dataset.json
but this temporary directory is there, I can't add the image with the same name, failing with the following error:This is not such an issue, because I can just delete that directory after adding the source, but it's quite unexpected.