8000 Merge pull request #8377 from eric-wieser/pypi-plex · numpy/numpy@3add9ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 3add9ed

Browse files
authored
Merge pull request #8377 from eric-wieser/pypi-plex
Switch to the PyPI version of plex to generate lapack_lite
2 parents 2498b74 + 79988e1 commit 3add9ed

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

numpy/linalg/lapack_lite/README renamed to numpy/linalg/lapack_lite/README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ required by the ``LinearAlgebra`` module, and wrapped by the ``lapack_lite``
99
module. The scripts in this directory can be used to create these files
1010
automatically from a directory of LAPACK source files.
1111

12-
You'll need `Plex 1.1.4`_ installed to do the appropriate scrubbing.
12+
You'll need `plex 2.0.0dev`_, available from PyPI, installed to do the
13+
appropriate scrubbing. As of writing, **this is only available for python 2.7**,
14+
and is unlikely to ever be ported to python 3.
1315

14-
.. _Plex 1.1.4: http://www.cosc.canterbury.ac.nz/~greg/python/Plex/
16+
.. _plex 2.0.0dev: https://pypi.python.org/pypi/plex/
1517

1618
The routines that ``lapack_litemodule.c`` wraps are listed in
1719
``wrapped_routines``, along with a few exceptions that aren't picked up
1820
properly. Assuming that you have an unpacked LAPACK source tree in
1921
``~/LAPACK``, you generate the new routines in a directory ``new-lite/`` with::
2022

21-
$ python ./make_lite.py wrapped_routines ~/LAPACK new-lite/
23+
$ python2 ./make_lite.py wrapped_routines ~/LAPACK new-lite/
2224

2325
This will grab the right routines, with dependencies, put them into the
2426
appropriate ``blas_lite.f``, ``dlapack_lite.f``, or ``zlapack_lite.f`` files,

numpy/linalg/lapack_lite/clapack_scrub.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
from __future__ import division, absolute_import, print_function
33

44
import sys, os
5-
from io import StringIO
5+
from io import BytesIO
66
import re
7-
8-
from Plex import *
9-
from Plex.Traditional import re as Re
7+
from plex import Scanner, Str, Lexicon, Opt, Bol, State, AnyChar, TEXT, IGNORE
8+
from plex.traditional import re as Re
109

1110
class MyScanner(Scanner):
1211
def __init__(self, info, name='<default>'):
@@ -22,8 +21,8 @@ def sep_seq(sequence, sep):
2221
return pat
2322

2423
def runScanner(data, scanner_class, lexicon=None):
25-
info = StringIO(data)
26-
outfo = StringIO()
24+
info = BytesIO(data)
25+
outfo = BytesIO()
2726
if lexicon is not None:
2827
scanner = scanner_class(lexicon, info)
2928
else:
@@ -190,7 +189,7 @@ def HaveBlankLines(line):
190189
return SourceLines
191190

192191
state = SourceLines
193-
for line in StringIO(source):
192+
for line in BytesIO(source):
194193
state = state(line)
195194
comments.flushTo(lines)
196195
return lines.getValue()
@@ -218,7 +217,7 @@ def OutOfHeader(line):
218217
return OutOfHeader
219218

220219
state = LookingForHeader
221-
for line in StringIO(source):
220+
for line in BytesIO(source):
222221
state = state(line)
223222
return lines.getValue()
224223

numpy/linalg/lapack_lite/make_lite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
NOTE: This is generated code. Look in Misc/lapack_lite for information on
2222
remaking this file.
2323
*/
24-
#include "Numeric/f2c.h"
24+
#include "f2c.h"
2525
2626
#ifdef HAVE_CONFIG
2727
#include "config.h"

0 commit comments

Comments
 (0)
0