Skip to content

Commit

Permalink
Run isort on ndarray code
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed May 2, 2024
1 parent 1c5834e commit 24eb2f0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
11 changes: 6 additions & 5 deletions ndarray/gen_elemwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


import numpy
import pygpu_ndarray as gpu_ndarray
import StringIO

import pygpu_ndarray as gpu_ndarray
_CL_MODE = hasattr(gpu_ndarray, "set_opencl_context")


Expand All @@ -20,6 +20,7 @@
from pyopencl.tools import dtype_to_ctype
# import pyopencl._mymako as mako
from pyopencl._cluda import CLUDA_PREAMBLE

# TODO: use mako to get rid of the %if
CLUDA_PREAMBLE = CLUDA_PREAMBLE[:455]
CLUDA_PREAMBLE += """
Expand Down Expand Up @@ -51,12 +52,12 @@
#define GDIM_2 gridDim.z
"""

from theano import Apply
from theano import scalar
from theano.tensor import TensorType
import logging

import theano
from theano import Apply, scalar
from theano.tensor import TensorType

import logging
_logger_name = 'compyte.gen_elemwise'
_logger = logging.getLogger(_logger_name)
_logger.setLevel(logging.INFO)
Expand Down
12 changes: 6 additions & 6 deletions ndarray/gen_reduction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy
import StringIO


_CL_MODE = False # "pyopencl" in __name__


Expand All @@ -12,6 +11,7 @@
from pyopencl.tools import dtype_to_ctype
# import pyopencl._mymako as mako
from pyopencl._cluda import CLUDA_PREAMBLE

# TODO: use mako to get rid of the %if
CLUDA_PREAMBLE = CLUDA_PREAMBLE[:455]
CLUDA_PREAMBLE += """
Expand Down Expand Up @@ -43,13 +43,13 @@
#define GDIM_2 gridDim.z
"""

from theano import Apply
from theano import scalar
from theano.tensor import TensorType
from theano.sandbox.cuda import CudaNdarrayType
import logging

import theano
from theano import Apply, scalar
from theano.sandbox.cuda import CudaNdarrayType
from theano.tensor import TensorType

import logging
_logger_name = 'compyte.gen_reduction'
_logger = logging.getLogger(_logger_name)
_logger.setLevel(logging.INFO)
Expand Down
5 changes: 3 additions & 2 deletions ndarray/setup_opencl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os

from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
from distutils.core import Extension, setup
from distutils.dep_util import newer

import numpy as np


Expand Down Expand Up @@ -82,6 +82,7 @@ def build_extensions(self):
self.build_extension(ext)

import sys

if sys.platform == 'darwin':
libcl_args = {'extra_link_args': ['-framework', 'OpenCL']}
else:
Expand Down
9 changes: 5 additions & 4 deletions ndarray/test_gpu_elemwise.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# TODO: test other dtype
from functools import reduce

import numpy
import pygpu_ndarray as gpu_ndarray
import theano

import pygpu_ndarray as gpu_ndarray
from .gen_elemwise import MyGpuNdArray, elemwise_collapses
from .test_gpu_ndarray import (dtypes_all, enable_double,
gen_gpu_nd_array, product)
from functools import reduce
from .test_gpu_ndarray import (dtypes_all, enable_double, gen_gpu_nd_array,
product)


def rand(shape, dtype):
Expand Down
1 change: 0 additions & 1 deletion ndarray/test_gpu_ndarray.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import copy

import numpy

import pygpu_ndarray as gpu_ndarray

enable_double = True
Expand Down

0 comments on commit 24eb2f0

Please sign in to comment.