stestagg / bitfield Goto Github PK
View Code? Open in Web Editor NEWPython fast integer set implementation
Python fast integer set implementation
I tried to install the library, but got this error:
Error compiling Cython file:
------------------------------------------------------------
...
while len(self.pages) > 0 and self.pages[-1].count == 0:
self.pages.pop()
cpdef add(self, usize_t number):
"""Add a positive integer to the bitfield"""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:463:35: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
the_page.add(page_index)
cpdef remove(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield
If the integer does not exist in the field, raise a KeyError"""
cdef usize_t page_no = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:472:38: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError()
cpdef discard(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield if it is a member.
If the element is not a member, do nothing."""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:486:35: Cannot assign type 'double' to 'usize_t'
I tried to install the library, and got this error in the terminal:
Error compiling Cython file:
------------------------------------------------------------
...
while len(self.pages) > 0 and self.pages[-1].count == 0:
self.pages.pop()
cpdef add(self, usize_t number):
"""Add a positive integer to the bitfield"""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:463:35: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
the_page.add(page_index)
cpdef remove(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield
If the integer does not exist in the field, raise a KeyError"""
cdef usize_t page_no = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:472:38: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError()
cpdef discard(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield if it is a member.
If the element is not a member, do nothing."""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:486:35: Cannot assign type 'double' to 'usize_t'
Hey,
I would like to try out the package/add it as a requirement to my own package but it appears to be failing with pip install
Here is the error i get:
cimpl\field.c(301) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
C:\Python27\Scripts\pip-script.py run on 07/16/13 14:26:04
Downloading/unpacking bitfield
Getting page https://pypi.python.org/simple/bitfield/
URLs to search for versions for bitfield:
https://pypi.python.org/simple/bitfield/
Analyzing links from page https://pypi.python.org/simple/bitfield/
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.2.tar.gz#md5=441129691d48dbe977a144d1b7e5931f (from https://pypi.python.org/simple/bitfield/), version: 1.2
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.3.tar.gz#md5=3854e5b80907231639a96b8c68fbde6a (from https://pypi.python.org/simple/bitfield/), version: 1.3
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.32.tar.gz#md5=7ddb172aba63417859b506816e6ee08a (from https://pypi.python.org/simple/bitfield/), version: 1.32
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.0.tar.gz#md5=789d54350ed758a6c96210e4299d04fd (from https://pypi.python.org/simple/bitfield/), version: 1.0
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.31.tar.gz#md5=a80d6c7ca4ec7e134944d22c46599b89 (from https://pypi.python.org/simple/bitfield/), version: 1.31
Found link https://pypi.python.org/packages/source/b/bitfield/bitfield-1.1.tar.gz#md5=0abc203174331426eaee349c1a759192 (from https://pypi.python.org/simple/bitfield/), version: 1.1
Using version 1.32 (newest of versions: 1.32, 1.31, 1.3, 1.2, 1.1, 1.0)
Downloading from URL https://pypi.python.org/packages/source/b/bitfield/bitfield-1.32.tar.gz#md5=7ddb172aba63417859b506816e6ee08a (from https://pypi.python.org/simple/bitfield/)
Running setup.py egg_info for package bitfield
running egg_info
creating pip-egg-info\bitfield.egg-info
writing pip-egg-info\bitfield.egg-info\PKG-INFO
writing top-level names to pip-egg-info\bitfield.egg-info\top_level.txt
writing dependency_links to pip-egg-info\bitfield.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\bitfield.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\bitfield.egg-info\SOURCES.txt'
writing manifest file 'pip-egg-info\bitfield.egg-info\SOURCES.txt'
Source in c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield has version 1.32, which satisfies requirement bitfield
Installing collected packages: bitfield
Running setup.py install for bitfield
Running command C:\Python27\python.exe -c "import setuptools;file='c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield\setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\krockman\appdata\local\temp\pip-0ahjlk-record\install-record.txt --single-version-externally-managed
running install
running build
running build_ext
skipping 'cimpl\field.c' Cython extension (up-to-date)
building 'bitfield' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\cimpl
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tccimpl\field.c /Fobuild\temp.win-amd64-2.7\Release\cimpl\field.obj -g
cl : Command line warning D9002 : ignoring unknown option '-g'
field.c
cimpl\field.c(301) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
Complete output from command C:\Python27\python.exe -c "import setuptools;file='c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield\setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\krockman\appdata\local\temp\pip-0ahjlk-record\install-record.txt --single-version-externally-managed:
running install
running build
running build_ext
skipping 'cimpl\field.c' Cython extension (up-to-date)
building 'bitfield' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\cimpl
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tccimpl\field.c /Fobuild\temp.win-amd64-2.7\Release\cimpl\field.obj -g
cl : Command line warning D9002 : ignoring unknown option '-g'
field.c
cimpl\field.c(301) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
Command C:\Python27\python.exe -c "import setuptools;file='c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield\setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\krockman\appdata\local\temp\pip-0ahjlk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield
Exception information:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 139, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 271, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "C:\Python27\lib\site-packages\pip\req.py", line 1185, in install
requirement.install(install_options, global_options, _args, *_kwargs)
File "C:\Python27\lib\site-packages\pip\req.py", line 592, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:\Python27\lib\site-packages\pip\util.py", line 662, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Python27\python.exe -c "import setuptools;file='c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield\setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\krockman\appdata\local\temp\pip-0ahjlk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\krockman\appdata\local\temp\pip-build-krockman\bitfield
I tried to compile the library, and got this error:
Error compiling Cython file:
------------------------------------------------------------
...
while len(self.pages) > 0 and self.pages[-1].count == 0:
self.pages.pop()
cpdef add(self, usize_t number):
"""Add a positive integer to the bitfield"""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:463:35: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
the_page.add(page_index)
cpdef remove(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield
If the integer does not exist in the field, raise a KeyError"""
cdef usize_t page_no = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:472:38: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError()
cpdef discard(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield if it is a member.
If the element is not a member, do nothing."""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:486:35: Cannot assign type 'double' to 'usize_t'
I tried to compile the library, but got this error:
Error compiling Cython file:
------------------------------------------------------------
...
while len(self.pages) > 0 and self.pages[-1].count == 0:
self.pages.pop()
cpdef add(self, usize_t number):
"""Add a positive integer to the bitfield"""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:463:35: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
the_page.add(page_index)
cpdef remove(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield
If the integer does not exist in the field, raise a KeyError"""
cdef usize_t page_no = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:472:38: Cannot assign type 'double' to 'usize_t'
Error compiling Cython file:
------------------------------------------------------------
...
raise KeyError()
cpdef discard(Bitfield self, usize_t number):
"""Remove a positive integer from the bitfield if it is a member.
If the element is not a member, do nothing."""
cdef usize_t page = number / PAGE_FULL_COUNT
^
------------------------------------------------------------
cimpl/field.pyx:486:35: Cannot assign type 'double' to 'usize_t'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.