Recent Releases of bioread

bioread - Fix rare revision printing bug

Yup. There was a print() call left in bioread, somehow.

Now it is gone.

- Python
Published by njvack 11 months ago

bioread - Refactor headers and readers, add acq_layout tool, tweak acq2mat

This (finally) adds single-precision support to acq2mat.

Also, this adds the new acq_layout tool, which outputs a TSV-based map of the binary file. Want to see the offsets, lengths, and contents of every single header and field? This shows you all that.

If you're trying to figure out why a file isn't loading, it should help point you in the correct direction.

Also. I said I was done refactoring, and I lied.

Now, instead of storing a bunch of unpacked headers in specific fields on Reader and Datafile, store every header, in the order it's read, in a headers list. (This makes acq_layout possible.)

This also changes the structures in headers.py to have a uniform naming convention for pre- and post- version 4 files -- now it's always a "Pre4" or "Post4" suffix, rather than sometimes being a V2 / V3 / V4 prefix. Also, it removes the weird get_<foo>_header_for_revision() pattern to choose header classes in favor of subclassing with just a touch of metaclass sprinkles. Now, instead of:

def get_compression_header_class(rev): if rev >= V_400B: return CompressionHeaderPost4 return CompressionHeaderPre4

you do

``` class CompressionHeader(Header): pass

class CompressionHeaderPre4(CompressionHeader): isvalidforrevision = revisionrange(maxrevision=V400B) # ...

class CompressionHeaderPost4(CompressionHeader): isvalidforrevision = revisionrange(minrevision=V400B) # ...

elsewhere

ch = CompressionHeader.for_revision(rev, ...) ```

and you'll get the correct subclass.

There are some other various renamings and cleanings, but I think I'm about done with all that.

- Python
Published by njvack about 1 year ago

bioread - Data Reading Robustness

Now, if reading the journal fails, you will still get the data. Most reading exceptions will not cause bioread to crash outright; they log errors and continue if at all possible.

Also interprets a few headers differently to help with journal reading.

- Python
Published by njvack about 1 year ago

bioread - The Grand Refactor

This release is a big one. The internals of reading .acq files has been mostly rewritten -- the code should be cleaner and easier to follow, with fewer if clauses and more "here is a class that just reads the thing."

The internally-written StructDict solution has been phased out in favor of plain ol' ctypes. This should not affect much of anything (really, anything at all!) but it's less weird.

All known file reading issues are now fixed. In addition, if there are problems reading metadata after the end of the data stream, that should not cause the data to not be read at all.

acq2mat's --data-only option should really, truly, only write the data.

I've also added a deprecation warning to acq2mat -- the data structures it produces are super gross, and Matlab can read HDF5 files directly. Just use acq2hdf5.

The test suite is more complete -- now, every single .acq file in test/data should go through the tests. There are a few known problems marked xfail there. One of them seems to be bad test data, the other affects acq2mat on one data file only and I'm not planning to fix it.

Finally! This switches to calendar versioning, since my semantic versions were not really that semantic.

If you have problems with this, please let me know, and use 3.1.0 or 3.0.1.

- Python
Published by njvack about 1 year ago

bioread - Modern numpy compatibility

Makes bioread work with numpy >= 1.20

Also remove last references to the GPL

Also also bump CI test versions (now python 3.7, 3.9, and 3.11)

Also also also update copyright to 2023

- Python
Published by njvack about 3 years ago

bioread - Change license to MIT

This release changes the license from GPL v2 to MIT.

Additionally, copyright is updated to 2022.

No other functionality is changed in this release.

- Python
Published by njvack over 3 years ago

bioread - Fix crash on reading marker dates

Some marker timestamps don't make sense to me; in this case, ignore the timestamps instead of crashing.

- Python
Published by njvack over 4 years ago

bioread - Hopefully make file reading more robust

Replace a dodgy "read X bytes ahead" magic number hack with a hopefully-less-dodgy "seek for the channel data type headers" procedure.

This seems more robust in practice.

- Python
Published by njvack over 5 years ago

bioread - Improve file reading

This adds support for version 4 files that have foreign data. (No, I don't know what that is.)

It also trades one set of gross hacks for another, maybe less gross hack.

With these changes, we're back to "reading all known files" status!

- Python
Published by njvack over 5 years ago

bioread - Autodetecting encodings! Data-only conversions! Yay!

This release will, with any luck at all, be the end of character encoding issues. (Fie on you, µV!) Files from before Acqknowledge 4.0 are assumed to be using latin-1 encoding, while 4.0 and on are assumed to be using UTF-8. This strikes me as likely true, but if it seems not to be, let me know. I can't run old versions of Acqknowledge any more, so I'm relying on examples people send in. Thanks to @benoitvalery and others who have done exactly that.

Also, if you're going to be publishing data, acq2hdf5 and acq2mat have a new option that may make you happy: --data-only. With that option, event markers and the journal (both of which can contain identifiers such as visit dates) will not be written into the output files.

Go forth! Read data! Wear a mask!

- Python
Published by njvack over 5 years ago

bioread - Version 2.0!

Now supports Python 3.6 and up! No more weird unicode issues!

Thanks to @pvelasco, we now know when event markers were created, as long as data files are from Acq 4.4.0 or newer. In addition, we've added Datafile.earliest_marker_created_at which reports the earliest date for an event marker, which will usually be the created_at time for the file — Acq automatically creates an apnd marker when recording starts.

Also, packaging was improved by @smoia, so bioread should install properly on clean systems and docker / singularity images.

Along the same lines (and thanks again to @smoia), optional installation dependencies for h5py and scipy are specified. You won't need them for basic library support, so they aren't installed all the time. Get them with:

```

Just h5py

pip install bioread[hdf5]

Just scipy

pip install bioread[mat]

The whole shebang

pip install bioread[all] ```

Also also now uses Github Actions to run tests automatically on push. Pretty great! Python 3.6, 3.7, and 3.8 on ubuntu-latest are being tested at the moment, if you want to do testing on other platforms, let me know or make a PR.

Also also also removes vendor/ in favor of install-time dependencies. If we're gonna depend on numpy, we can depend on docopt.

That's a wrap, I think! I have effectively no roadmap for future versions, so this should be stable for a long time.

- Python
Published by njvack almost 6 years ago

bioread - v1.0.4

First official Github release! Now with a Zenodo record!

- Python
Published by njvack over 6 years ago