GithubHelp home page GithubHelp logo

Comments (5)

swharden avatar swharden commented on August 18, 2024

Hi @JPacheco5, thanks for this question! Can you share the entire exception message so we can assess what function is calling for this unpacking?

Alternatively/additionally can you share the ABF you are having trouble opening?

Can you confirm the ABF can successfully be opened by ClampFit or another "official" ABF reading program? It's possible this error message is the result from a damaged ABF file. Thanks!

I'll close this issue now since I can't reproduce it, but if you provide additional information we can open it back up again 👍

from pyabf.

TheSuperbohl avatar TheSuperbohl commented on August 18, 2024

Hello, I have just stumbled upon this same issue myself. I am new to using this but I have a file to batch-read a Data Directory with only ABFs in it and then put every figure into a data dump. It works flawlessly for about 50-60 files every time without issues. I can then remove the files that were graphed from the Data Directory at the point of error and keep going with the next ABF in sequence. All of these ABFs work as I have gone through this data previously. Thank you for any help you can give. Attached is the error array I receive from Spyder, and it is identical to the one I get if I run from the terminal.
Screenshot 2023-08-15 at 11 39 13 PM

from pyabf.

swharden avatar swharden commented on August 18, 2024

Hi @TheSuperbohl, thanks for extending @JPacheco5's initial issue!

For reference, this is the function that fails:

def readByte(self):
bytes = self._fb.read(1)
values = struct.unpack("B", bytes)
return int(values[0])

Based on the line of code that failed, I think the error is that you are both hitting an ABF file which is incomplete, corrupted, or was deleted or moved after the python program started running. I'll leave this issue open to track adding a more descriptive error message in this spot so a failure produces a more helpful error message.

If anyone hits an ABF file which repeatedly generates this error, first confirm it's not corrupted (e.g., try to look at it in ClampFit), and if pyabf still has problems with it you can upload it here (drag/drop it into the comments window) and I can take a closer look 👍

from pyabf.

TheSuperbohl avatar TheSuperbohl commented on August 18, 2024

Hi Scott,
Thank you for reaching back out. Will any incomplete file be considered one that was supposed to be say 8 sweeps but I canceled it after 4 full sweeps? Or is it more likely it's incomplete if I have cut the abf file off in the middle of the defined sweep no matter the actual sweep number. Currently have been testing with a data folder of unsorted raw data that can include both of those situations.

from pyabf.

swharden avatar swharden commented on August 18, 2024

Will any incomplete file be considered one that was supposed to be say 8 sweeps but I canceled it after 4 full sweeps?

No, when you click the "stop" button in ClampEx it writes a little bit of data to the end of the file (things like tag comments), even if you stop after 4 sweeps but there were 8 in the protocol.

It writes to disk every few seconds, but if power is lost (for example) then that little header at the end never gets written, and that is an incomplete file that will throw this error

Hope it helps!

from pyabf.

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.