Skip to content

Commit

Permalink
Merge pull request explosion#1 from henningpeters/master
Browse files Browse the repository at this point in the history
fancyvec -> sense2vec
  • Loading branch information
honnibal committed Feb 1, 2016
2 parents a75afb3 + 3b4323a commit d16d858
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 107 deletions.
Binary file removed fancyvec/tests/.test_vectors.py.swp
Binary file not shown.
Binary file not shown.
Empty file added sense2vec/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions fancyvec/about.py → sense2vec/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py

__name__ = 'fancyvec'
__version__ = '0.1'
__name__ = 'sense2vec'
__version__ = '0.1.0'
__summary__ = 'Fancy word2vec'
__uri__ = 'https://spacy.io'
__author__ = 'Matthew Honnibal'
Expand Down
8 changes: 8 additions & 0 deletions sense2vec/cblas_shim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifdef __cplusplus
extern "C"
{
#endif
#include <cblas.h>
#ifdef __cplusplus
}
#endif
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import numpy

from fancyvec.vectors import Vectors
from sense2vec.vectors import Vectors


def test_init():
Expand Down
2 changes: 1 addition & 1 deletion fancyvec/vectors.pyx → sense2vec/vectors.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ cdef void linear_similarity(int* indices, float* scores, float* tmp,
i += 1


cdef extern from "cblas.h":
cdef extern from "cblas_shim.h":
float cblas_sdot(int N, float *x, int incX, float *y, int incY ) nogil
float cblas_snrm2(int N, float *x, int incX) nogil

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
96 changes: 0 additions & 96 deletions serve_vectors.py

This file was deleted.

17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@


PACKAGES = [
'fancyvec'
'sense2vec'
]

MOD_NAMES = ['fancyvec.vectors']
MOD_NAMES = ['sense2vec.vectors']


if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[0:2] < (3, 4):
Expand All @@ -28,10 +28,13 @@
# By subclassing build_extensions we have the actual compiler that will be used which is really known only after finalize_options
# http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used
compile_options = {'msvc' : ['/Ox', '/EHsc'],
'other' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function', '-fopenmp',
'-fno-stack-protector']}
'other' : ['-O3', '-Wno-unused-function',
'-fopenmp', '-fno-stack-protector']}
link_options = {'msvc' : [],
'other' : ['-lcblas', '-fopenmp', '-fno-stack-protector']}
'other' : ['-Wl,--no-undefined',
'-fopenmp', '-fno-stack-protector',
'-L/usr/lib64/atlas', # needed for redhat
'-lcblas']}

if sys.platform.startswith('darwin'):
compile_options['other'].append('-mmacosx-version-min=10.8')
Expand Down Expand Up @@ -130,7 +133,7 @@ def setup_package():

with chdir(root):
about = {}
with open(os.path.join(root, "fancyvec", "about.py")) as f:
with open(os.path.join(root, "sense2vec", "about.py")) as f:
exec(f.read(), about)

include_dirs = [
Expand All @@ -145,7 +148,7 @@ def setup_package():
language='c++', include_dirs=include_dirs))

if not is_source_release(root):
generate_cython(root, 'fancyvec')
generate_cython(root, 'sense2vec')
prepare_includes(root)

setup(
Expand Down

0 comments on commit d16d858

Please sign in to comment.