-
Notifications
You must be signed in to change notification settings - Fork 249
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
BaseTestRawIO's setUp function deletes data needed for subsequent tests--on windows #1550
Comments
I wonder if this is a problem with Windows. One time Alessio and I were trying to share some files and he ended up only being able to share the stub with me from Windows. Could you give me the exact command you are using to try to run the test? |
I literally just ran test_plexon2rawio.py in my IDE (Visual Studio Code) by pressing Ctrl+F5. |
I wonder if this is related |
I think we should move this setUp to classSetUp. |
@samuelgarcia, I trust you to do that. As a pytest baby I would hate to mess it up :) |
We merged the PR moving the test setUp into main, but if you run the tests on your Windows machine and this issue persists could you open a new issue @nikhilchandra. If you still have problems it is likely datalad related. I'll leave this open for a bit though. |
Hi @zm711, I cloned the NeuralEnsemble master branch to my Windows desktop and was able to run the test successfully once (this was after deleting the ephys_testing_data folder from $HOME). But the second time around, it once again deleted a subset of files in the plexon folder, causing the same break as before. |
I did some further digging. I think the issue is with the command "repo.call_git(["checkout", "--force", "master"]). This is a git annex repo, not a pure git repo, and so doing a forced checkout causes the previously download files to be replaced with 1 kb symbolic links. The options for a fix would be to either replace the forced checkout with something more appropriate (not sure what), or we could just run an unlock command after:
I tried this locally and it fixed the problem, but I hesitate to submit a pull request just yet without further inputs @h-mayorquin @samuelgarcia @zm711 @cheydrick |
Hey @nikhilchandra, I would give the PR a quick try with your solution. If it breaks our CI then we will need to work on a different solution, but I as someone who has tried this on Windows have also struggled with the stubs/symlink stuff. So I switched to do Mac for most Neo dev. But I think it is worth a try; I don't know if any of us are actually git-annex or datalad experts so giving it a test is worth a try and we can close the PR if needed. |
Describe the bug
I am putting together a unit test for issue #1546 (Link) but when I try to run unittest.main() from test_plexon2rawio.py, the code breaks.
To Reproduce
Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\nikhil\Documents\Projects\python-neo\neo\rawio\baserawio.py", line 463, in segment_t_start return self._segment_t_start(block_index, seg_index) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nikhil\Documents\Projects\python-neo\neo\rawio\plexon2rawio\plexon2rawio.py", line 379, in _segment_t_start return self.pl2reader.pl2_file_info.m_StartRecordingTime / self.pl2reader.pl2_file_info.m_TimestampFrequency ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZeroDivisionError: float division by zero
Expected behaviour
I would expect subsequent calls to setUp() to not erase a subset of files as is currently happening.
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: