Skip to content

Commit

Permalink
Fixed string handling for Python 3
Browse files Browse the repository at this point in the history
This change provides compatibility with Python 3 for recommended use cases. Requires Cython 0.19 or later.

Some tests in test_axographio.py are still failing in Python 3 (but not Python 2). Iterating over linearsequence and scaledarray objects currently fails in Python 3. This bug does not affect conversion of these objects to arrays using numpy.asarray or scipy.asarray, which is the recommended usage.

This change also explicity handles strings using ASCII encoding, so file paths containing non-ASCII characters are currently not supported in Python 3. Strangely, they nevertheless work in Python 2. Column names containing non-ASCII characters are rendered with hexadecimal escape codes in both Python 2 and 3.
  • Loading branch information
jpgill86 committed May 30, 2018
1 parent f3f036d commit 77e0ed3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions axographio.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cython: c_string_type=str, c_string_encoding=ascii

import numpy as np
cimport numpy as np

Expand Down

0 comments on commit 77e0ed3

Please sign in to comment.