8000 Make rational into a subpackage of npytypes · numpy/numpy-dtypes@193abeb · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 25, 2022. It is now read-only.

Commit 193abeb

Browse files
committed
Make rational into a subpackage of npytypes
1 parent 72409d2 commit 193abeb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

npytypes/quaternion/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from info import __doc__
1+
import numpy as np
22

3-
__all__ = ['quaternion']
3+
from .numpy_quaternion import quaternion
4+
from .info import __doc__
45

5-
import numpy
6-
from numpy_quaternion import quaternion
6+
__all__ = ['quaternion']
77

8-
if numpy.__dict__.get('quaternion') is not None:
8+
if np.__dict__.get('quaternion') is not None:
99
raise RuntimeError('The NumPy package already has a quaternion type')
1010

11-
numpy.quaternion = quaternion
12-
numpy.typeDict['quaternion'] = numpy.dtype(quaternion)
11+
np.quaternion = quaternion
12+
np.typeDict['quaternion'] = np.dtype(quaternion)

npytypes/rational/rational.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ rational_matrix_multiply(char **args, npy_intp *dimensions, npy_intp *steps)
974974
npy_intp os_p = steps[5];
975975

976976
/* core dimensions counters */
977-
npy_intp m, n, p;
977+
npy_intp m, p;
978978

979979
/* calculate dot product for each row/column vector pair */
980980
for (m = 0; m < dm; m++) {

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
ext_modules = []
55

6-
ext = Extension('npytypes.rational',
6+
ext = Extension('npytypes.rational.rational',
77
sources=['npytypes/rational/rational.c'],
88
include_dirs=[np.get_include()])
99
ext_modules.append(ext)
@@ -20,6 +20,6 @@
2020
description='NumPy type extensions',
2121
packages=['npytypes',
2222
'npytypes.quaternion',
23-
# 'npytypes.rational'
23+
'npytypes.rational'
2424
],
2525
ext_modules=ext_modules)

0 commit comments

Comments
 (0)
0