Skip to content

Commit

Permalink
MAINT: A bit of clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
WarrenWeckesser committed Oct 1, 2023
1 parent 04c81fc commit 8cd7c77
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = [

[project]
name = 'ufunclab'
version = '0.0.8.dev6'
version = '0.0.8.dev7'
description = 'NumPy ufuncs and utilities.'
readme = 'README.md'
requires-python = '>=3.9'
Expand Down
5 changes: 0 additions & 5 deletions tools/cxxgen/generate_concrete_cfuncs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import os
from os import path

from generate_utils import (typechar_to_ctype, typesig_to_ext,
Expand Down Expand Up @@ -39,9 +37,6 @@ def generate_concrete_cfuncs(cxxgenpath, header, funcs, destdir):
# 'foo_concrete.cxx'.
cxxheader, cxxfilename = header_to_concrete_filenames(header)

# gendir = path.join(cxxgenpath, 'generated')
# if not path.exists(gendir):
# os.mkdir(gendir)
cxxheader_fullpath = path.join(destdir, cxxheader)
cxxfilename_fullpath = path.join(destdir, cxxfilename)

Expand Down
8 changes: 3 additions & 5 deletions tools/cxxgen/generate_ufunc_extmod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from os import path
from textwrap import dedent
from generate_utils import (typechar_to_ctype, typesig_to_ext,
Expand All @@ -18,7 +17,8 @@ def cap(s):

def print_extmod_start(extmod, file):
modulename = extmod.modulename
ufunc_names = ', '.join([f.ufuncname for f in sum(extmod.funcs.values(), [])])
ufunc_names = ', '.join([f.ufuncname
for f in sum(extmod.funcs.values(), [])])
tmpl = \
f"""
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -146,6 +146,7 @@ def print_ufunc_create(func, file):
"""


def generate_ufunc_extmod(cxxgenpath, extmod, destdir):
"""
The C implementation of the extension module is written
Expand All @@ -155,9 +156,6 @@ def generate_ufunc_extmod(cxxgenpath, extmod, destdir):
modulename = extmod.modulename
extmod_filename = modulename + '.cxx'

#gendir = path.join(cxxgenpath, 'generated')
#if not path.exists(gendir):
# os.mkdir(gendir)
extmod_fullpath = path.join(destdir, extmod_filename)
if path.exists(extmod_fullpath):
raise RuntimeError(f"file '{extmod_fullpath} already exists.")
Expand Down
2 changes: 1 addition & 1 deletion ufunclab/tests/test_vdot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_single(dtype):
a = np.array([1, 2, 3, 0, 4, 4, 4], dtype=dtype)
b = np.array([2, 1, 4, 3, 1, 1, 2], dtype=dtype)
d = vdot(a, b)
assert type(d) == dtype
assert isinstance(d, dtype)
assert d == 32.0


Expand Down

0 comments on commit 8cd7c77

Please sign in to comment.