GithubHelp home page GithubHelp logo

Comments (6)

jzerfowski avatar jzerfowski commented on July 30, 2024 1

Upload MWE with 0, 1 and 2 samples to expose the bug
mwe.zip

from pyxdf.

cbrnr avatar cbrnr commented on July 30, 2024 1

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.

jzerfowski avatar jzerfowski commented on July 30, 2024 1

@cbrnr

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.

agricolab avatar agricolab commented on July 30, 2024

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.

jzerfowski avatar jzerfowski commented on July 30, 2024

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.

cbrnr avatar cbrnr commented on July 30, 2024

Alright!

from pyxdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.