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

hs2.LoadDetected() crashes when no spikes were detected #15

Closed
JanoHorvath opened this issue Feb 19, 2018 · 4 comments
Closed

hs2.LoadDetected() crashes when no spikes were detected #15

JanoHorvath opened this issue Feb 19, 2018 · 4 comments
Assignees
Labels

Comments

@JanoHorvath
Copy link
Collaborator

If the file_name (usually ProcessedSpikes.bin) is a path to an empty file, LoadDetected() crashes with ValueError: cannot mmap an empty file

Instead, it should just fill self.spikes dataframe with empty values.

@JanoHorvath JanoHorvath self-assigned this Feb 19, 2018
@martinosorb
Copy link
Collaborator

Wait, if it's empty something is wrong, it's ok to throw an error...

@JanoHorvath
Copy link
Collaborator Author

I agree, however it shouldn't crash the whole execution. How about a warning?

I am doing some automatic parameter optimisation, and sometimes I need to initialize parameters to something ridiculous (e.g. maxsl = 1 ). In that case I would like the program to handle this graciously.

@martinosorb
Copy link
Collaborator

I see what you mean. Do you actually need to load the detected spikes for that?

Incidentally, while you are at it, could you check if there are redundant parameters passed to the detection function? I don't even know what these parameters mean and it should be documented.

@JanoHorvath
Copy link
Collaborator Author

Yes, unfortunately I do need to load them. I've created a pull request with my code suggestion, what do you think?

I can check, no problem. Do you mean on python level, or cpp level?

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

No branches or pull requests

2 participants