Giter Club home page Giter Club logo

pycedfs's People

Stargazers

 avatar

Watchers

 avatar  avatar

pycedfs's Issues

DLL not found

Hi,

Thanks for sharing this potentially very useful library. Unfortunately, after installing it to give it a try (trying to simplify the toolchain from stfio) I ran into a DLL issue that stopped me when I tried to import the package. Apparently the ctype.CDLL call fails because it can't find the DLL (FileNotFoundError). This is surprising because the CFS64.dll is there, and the path is correct. I tried all the suggestions I could find on Google (be in the directory before loading it, adding the directory to the path, etc.) but not luck. Do you have any other suggestion / idea? Encountered this issue before?
Thanks.

Pure Python backend / cross-platform support

Hi again,

Since I put together my previous PR, I've done some additional work with the CFS format you might be interested in integrating! Specifically, I was running into some issues with pyCEDFS not parsing all the Data Section variables I wanted in my file (would only read the first 30 or so), so rather than get deep into ctypes debugging I adapted some old EDF-parser code I'd written to create a pure-Python CFS header parser. Once that was together, it was only a little extra work to get it reading Data Section variables and channel data without the DLL too. The end result runs nicely on macOS, and should be fully cross-platform for any systems that support Numpy!

Screen Shot 2021-11-16 at 3 50 42 PM

Of course, given how strongly pyCEDFS is based on the ctypes/DLL interface, cleaning up my work for a PR would involve replacing a ton of the existing code which might have various unintended consequences. As such, I'm not sure whether you'd prefer this work be merged into pyCEDFS or exist as a separate project.

I've attached my WIP code so you can take a look. The main function is "read_cfs", which accepts a file path as an argument. It returns a dict with a header and a list of Frame objects (data sections), which contain the data section variables and channel data for each frame. The structure.py file contains the names and byte widths of each field of each form of header in the file, which the read.py file uses to grab the bytes associated with each field and convert them to their corresponding data types. The cfs.py file contains some half-implemented container object types for CFS files and frames.

Let me know what you think!

cfs.zip

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.