Giter VIP home page Giter VIP logo

axographio's People

Contributors

jpgill86 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pikapei

axographio's Issues

Update axograph_readwrite?

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

Incompatible with Python 3

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

Cython version >= 0.3 includes breaking changes for axographio

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.

File paths and column names containing non-ASCII characters are mishandled

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

Backwards incompatible change in C API with Numpy 1.20

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:

  • The API changes are not backwards-compatible: If axographio is built with Numpy 1.20, the wheel will not be compatible with installations running older versions of Numpy.
  • Numpy 1.20 is still compatible with older wheels: If axographio is built with Numpy 1.19, the wheel will still be compatible with installations running newer versions of Numpy.

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.

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.