Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling empty prefix #212

Open
hiraksarkar opened this issue Sep 27, 2024 · 5 comments
Open

Handling empty prefix #212

hiraksarkar opened this issue Sep 27, 2024 · 5 comments

Comments

@hiraksarkar
Copy link

https://github.com/scverse/spatialdata-io/blame/bc17abc065c39e07d6b17affaf2c4b95adbaafea/src/spatialdata_io/readers/visium_hd.py#L357

Currently visium_hd function can't handle empty file prefixes. In other words,

binned_outputs       feature_slice.h5     molecule_info.h5              probe_set.csv  web_summary.html
cloupe_008um.cloupe  metrics_summary.csv  possorted_genome_bam.bam.bai  spatial

This would be unreadable by the function. Can this be fixed. Alternatively I raise a pull request.

@ddiez
Copy link

ddiez commented Oct 2, 2024

Same problem with me. The problem is here where the assignment of the dataset_id is done. Perhaps if dataset_id is None and the guessing returns empty then do not add "_". Something like this?

if dataset_id is None:
        dataset_id = _infer_dataset_id(path)

if dataset_id is "":
  filename_prefix = ""
else
  filename_prefix = f"{dataset_id}_"

@hiraksarkar A temporary solution for me to avoid renaming the files was to create a symlink to feature_slice.h5. Something like ln -s feature_slice.h5 id_ feature_slice.h5 where id is whatever label works for your project.

@ddiez
Copy link

ddiez commented Oct 2, 2024

@hiraksarkar just realized you offered a PR so probably didn't need my "temporary solution". Sorry for the noise although perhaps it is useful for someone else until this is fixed!

@LucaMarconato
Copy link
Member

Thanks for reporting the bug and for the discussion. @hiraksarkar, if you could make a PR it would be wonderful, thank you! Happy to review it 😊

@ddiez
Copy link

ddiez commented Oct 3, 2024

Thanks @LucaMarconato sounds great. @hiraksarkar will you do the PR? If not, I can do it myself although I have not tested yet my proposed solution.

This was referenced Oct 3, 2024
@ddiez
Copy link

ddiez commented Jan 9, 2025

Was the PR for this finally submitted? @LucaMarconato @hiraksarkar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants