Comments (6)
Upload MWE with 0, 1 and 2 samples to expose the bug
mwe.zip
from pyxdf.
Thanks @jzerfowski! I'd rather not break
out of the loop though, because that way you ignore any additional streams that also need to be processed. Therefore, I propose the following change (starting at line 383):
for stream in temp.values():
if len(stream.time_stamps) > 1: # requires at least two samples
duration = stream.time_stamps[-1] - stream.time_stamps[0]
stream.effective_srate = len(stream.time_stamps) / duration
else:
stream.effective_srate = 0
I wonder why you could not open a PR - this should work. Can you provide more details? I would like you to implement this change because you found the issue, reported the issue, and proposed a solution, so you should be credited for all of that!
from pyxdf.
I wonder why you could not open a PR - this should work. Can you provide more details? I would like you to implement this change because you found the issue, reported the issue, and proposed a solution, so you should be credited for all of that!
Nevermind, I guess I just didn't look properly. Will open a PR for the next issue I find!
from pyxdf.
hey, @cbrnr just had made that same design choice and opened a PR. Only difference was i initialized stream.effective_srate explitivly with a float, i.e 0.0
.
3c712f2#diff-ef075678955858b0ccf9c1a819363246f7d68dc5a2aae4320a5f9ab91e164385R384-R388
Feel free to merge if that's ok with you.
from pyxdf.
Hi @cbrnr, the proposed solution by @agricolab looks good to me, merging that PR would be fine for me. You're right that my break
statement doesn't make sense. I guess this should have been a continue
instead, but I guess the explicit if/else is more pythonic anyways.
from pyxdf.
Alright!
from pyxdf.
Related Issues (20)
- Bump Python to >= 3.9 HOT 1
- Replace Azure Pipelines with GitHub Actions HOT 2
- New Release HOT 3
- Clean up branches HOT 1
- XDF.jl (Julia importer) HOT 4
- xdf_load does not synchronize clocks HOT 8
- Rename master -> main HOT 2
- jooc: why are some values in stream meta-data lists of dicts and some just dicts? HOT 2
- unpack requires a buffer of 8 bytes HOT 7
- Merge streams HOT 2
- Nominal vs. effective sampling rate HOT 25
- "Reading chunk length error" after a Python crash at the end of the recording, any solution ? HOT 5
- OSError: Invalid XDF file HOT 5
- Make progress bar HOT 2
- Incompatible with numpy 1.24
- Azure Pipelines broken? HOT 6
- Single PC clock offset vs. latency and jitter HOT 10
- Possible bug with _clock_sync and clock reset detection HOT 2
- 2-n order drift correction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxdf.