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

store path to data in phy export to relative instead of absolute path #2021

Closed
hummuscience opened this issue Sep 19, 2023 · 3 comments
Closed
Labels
exporters Related to exporters module

Comments

@hummuscience
Copy link

When exporting to phy, the params.py file contains the path to the recording.dat file as an absolute path. The moment the folder is moved to another machine, phy fails to open as the path is wrong.

https://github.com/SpikeInterface/spikeinterface/blob/843b451282369565ca8e62863b4814c772c479f8/src/spikeinterface/exporters/to_phy.py#L152C18-L152C18

I wonder if it makes sense to turn it into a relative path. I tried it on one session and it resolved the issue. Unless that breaks some other functionality I am not aware of.

@alejoe91 alejoe91 added the exporters Related to exporters module label Sep 19, 2023
@alejoe91
Copy link
Member

Hi @Cumol

Yes I think we should give the option to use relative paths with respect to the output folder. We have a similar option for the waveform extractor that we could propagate here. Thanks for the suggestion!

@zm711
Copy link
Collaborator

zm711 commented Sep 20, 2023

Just in case people search here in the future how the export_to_phy behaves related to native KS behavior:

KS1 and KS2 supply just the name of the binary file in the dat_path
KS2.5 and KS3 supply the absolute path in the dat_path (specifically to the temp_wh.dat.

@zm711
Copy link
Collaborator

zm711 commented Sep 27, 2023

@Cumol, the option to use a relative path is now merged with #2041. To use you would need to install spikeinterface from source (instructions) or wait for the next pypi release. The new keyword argument is use_relative_path.

use_relative_path : bool, default: False
If True and `copy_binary=True` saves the binary file `dat_path` in the `params.py` relative to `output_folder` (ie `dat_path=r'recording.dat'`). If `copy_binary=False`, then uses a path relative to the `output_folder`
If False, uses an absolute path in the `params.py` (ie `dat_path=r'path/to/the/recording.dat'`)

@zm711 zm711 closed this as completed Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporters Related to exporters module
Projects
None yet
Development

No branches or pull requests

3 participants