Closed cbrnr closed 5 years ago
@tstenner @cboulay ready to merge - please double-check if these changes have any unintended side effects.
Also, the test I've added requires a folder with XDF files. We can leave this test in for now, but we should start discussing how we could host test files. For most of the files I have, I will get permission from the original owners to use them in our tests.
but we should start discussing how we could host test files.
There was some suggestion to use git-lfs, but I don't know how this works with CI. Maybe we should keep that discussion in #38
git-lfs should work with CIs even when a repo is cloned before git-lfs is installed. But let's continue this in #38. Meanwhile, I have removed the test again so that this PR can get merged.
We could put this example file in the repo:
Its size is somewhat reasonable for a repository (554 bytes) and it has two streams, so for a quick check it should suffice.
Sure, we could put several small files in the repo, this would be better than nothing. But what is the size limit? Our collection of small test files will still grow so we are only postponing the decision. In MNE-Python, we created a separate repository just for testing data. That way, we don't contaminate our code, we can choose to test specific files (even in CIs where we could use the URLs of specific files instead of cloning the whole repo), or we can download the whole repo for local testing. The downside is that the data still lives in a normal git repo, which tends to be very slow for large binary files.
Let's talk about test data in #38. This PR is ready to be merged, could someone please review?
Can you just squash and merge?
I've added smoke tests for XDF test files in a local folder. I found two warnings in
_clock_sync
:clock_times
(andclock_values
) is a list with only one element,time_diff
is an empty list andnp.median
of an empty list raises a warning. I've solved this by handling clock resets only for two or more time stamps. I hope this change doesn't affect anything else I might have overlooked.This is because
d
contains elements that are exactly 0. I have disabled this warning for this particular line.