mobie / mobie-utils-python

Python tools for MoBIE
MIT License
9 stars 5 forks source link

Error in removing source #117

Closed Buglakova closed 9 months ago

Buglakova commented 9 months ago

Hello,

I'm trying to delete a source that I added earlier with the following code:

dataset_folder = "/g/kreshuk/buglakova/data/platybrowser-smfish-project/data/1.0.1"
segm_name = "prox-brn3-sfg_pl3_segm"
mobie.remove_source(dataset_folder, segm_name, remove_data=True)

I get the following error:

Traceback (most recent call last):                                                                                                                                                                                 
  File "/g/kreshuk/buglakova/projects/platy_registration/platy_browser_add/add_image.py", line 65, in <module>                                                                                    
    mobie.remove_source(dataset_folder, segm_name, remove_data=True)                                                                                                                                               
  File "/g/kreshuk/buglakova/libraries/mobie-utils-python/mobie/source_utils.py", line 103, in remove_source                                                                                                       
    rmtree(os.path.join(dataset_folder, tab_data["tsv"]))                                                                                                                                                          
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                           
  File "<frozen posixpath>", line 90, in join                                                                                                                                                                      
  File "<frozen genericpath>", line 152, in _check_arg_types                                                                                                                                                       
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'dict'   
constantinpape commented 9 months ago

Looks like the unit test for this is missing and so it wasn't updated when the data layout changed. I will fix it.