cwruchiellab / axographio Goto Github PK
View Code? Open in Web Editor NEWA Python package for reading and writing AxoGraph data files
Home Page: https://pypi.org/project/axographio/
License: BSD 3-Clause "New" or "Revised" License
A Python package for reading and writing AxoGraph data files
Home Page: https://pypi.org/project/axographio/
License: BSD 3-Clause "New" or "Revised" License
With AxoGraph X 1.7.0 (likely much earlier), changes were introduced to the developer's interface provided with the software in the axograph_readwrite
directory. These files have begun to diverge from the copies included in this repository (see here for files as of 8ccf296). It might be good to update the axographio package to use the latest versions of these files.
The new files: axograph_readwrite-1.7.0.zip
The changes are relatively minor (mostly type changes), but after putting a little time into it I was unable to get the package to work with them. The main issue seems to be that support for non-Mac platforms in fileUtils.cpp
was completely dropped, and the code now completely relies on Apple's (deprecated) Carbon API. Even when I put back in the necessary pieces of this file for compiling the package on non-Mac platforms (everything below this line), Python aborts without any error messages when axographio.read()
is executed. Managing file pointers seems to be the problem.
At this time, updating the package to use the latest axograph_readwrite
seems like more trouble than it's worth. However, since I've already invested some time, I thought I'd at least document what I learned and provide this patch which contains my efforts so far, and which can be applied to 8ccf296:
Work in progress: update-axograph_readwrite.patch.txt
axographio v0.1.1b1 and earlier is incompatible with Python 3. Installation fails with an error:
$ pip3 install axographio==0.1.1b1
Downloading/unpacking axographio==0.1.1b1
Downloading axographio-0.1.1b1.tar.gz (77kB): 77kB downloaded
Running setup.py (path:/tmp/pip_build_gill/axographio/setup.py) egg_info for package axographio
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_gill/axographio/setup.py", line 13, in <module>
m.Extension.__dict__ = m._Extension.__dict__
AttributeError: attribute '__dict__' of 'type' objects is not writable
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_gill/axographio/setup.py", line 13, in <module>
m.Extension.__dict__ = m._Extension.__dict__
AttributeError: attribute '__dict__' of 'type' objects is not writable
The environment includes the dependency cython>=0.19
but unfortunately version 0.30 of cython includes some breaking changes (also seen in other projects that use cython). We could find a workaround locally by fixing the required version to cython==0.29
.
axographio is unable to open file paths containing non-ASCII characters. Instead, a UnicodeEncodeError
exception (Python 3) or an IOError
exception (Python 2) is raised.
Some files that contain only ASCII characters in the path but contain non-ASCII column names cannot be opened and may raise a UnicodeDecodeError
exception (Python 3). Others can be opened, but their column names are decoded incorrectly.
These problems have been present since axographio's initial release, but the explicit instruction to Cython for encoding strings in ASCII introduced in commit 77e0ed3 to provide Python 3 compatibility didn't help.
These files can be used for testing: test-non-ascii.zip
As is explained here, Numpy 1.20 introduced a change to its C API. This affects Python packages with compiled components that depend on Numpy, such as axographio. The version of Numpy installed at compile time can limit the versions of Numpy compatible with the package at run time. That is:
Unaware of any of this, today I published a new wheel for Python 3.9 to PyPI (axographio-0.3.1-cp39-cp39-win_amd64.whl
). I had Numpy 1.20 installed when building. The wheel is incompatible with Python 3.9 installations running Numpy 1.19, resulting in this error when trying to read a file:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
Because setup.py
does not indicate a run-time requirement of Numpy 1.20, anyone installing axographio into an environment with Python 3.9 and Numpy 1.19 or older will get a broken version of axographio.
I don't have the privileges on PyPI needed to replace or delete the bad wheel. To work around this, I plan to release a new version of axographio built with Numpy 1.19, which should be compatible with Numpy 1.20 too. The only change will be a version number bump.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.