Releases: gstonge/SamplableSet
Releases · gstonge/SamplableSet
C++11 compatibility
- Now compatible with C++11.
- When sampling an empty set, it raises a
KeyError
instead or returning a
None
. This also affects the behavior of sampling without replacement when
n_samples
is larger than the set size. - Other forbidden operations raises an error as well instead of returning a
None
.
Fix methods for SamplableSet with unspecified type
Fixed
- The
__str__
method now works with SamplableSet of unspecified underlying
type. - All C++ methods (e.g.
size
) raise an error message until the type is
specified/inferred.
Bugfix for the copy constructor
Added
- Bound check-up now gives a more complete output message.
Fixed
- The copy constructor was missing minimal and maximal weight attributes.
Bound check-up in C++, new empty method
Added
- Bound check-up for the weight of elements in C++ (insertion, set weight).
- New
empty
method to test if the set is empty.
Changed
- Bound checking (exception throw) is now mainly done in C++.
Fixed
- In python, if one checks the weight of an element not in the set, it
now returnsNone
.
Simpler initialization and c++ static library availability
Added
- New tuple 2 and 3-tuple of
int
andstr
as availablecpp_type
. - A samplable set can be instanciated empty without specifying the
cpp_type
.
It will be inferred at the first insertion.
Changed
- Structure of C++ source files to allow the compilation of a static library.
Fixed
Test for out of bound weight.
Shared RNG
Changed
- Class name in C++
- RNG is now a static member of C++
BaseSamplableSet
class. This means all
objects created (irrespective of the C++ type of the set) share the same RNG.
Removed
- Obsolete C++ type (Edge, DoubleInt, etc.). Only
int
andstr
cpp types
remain. - Initialization of the seed for the RNG at construction. Since the RNG now
belong to the class, it exits without any object created, and it is
initialized with current time.
Added
A new static member function for the class SamplableSet to seed the RNG.
Seeding the generator influences all ensuing (or existing) sets objects.
Sampling without replacement
- Sampling without replacement
- Sets are seeded with current time instead of a fixed value by default
- Bugfix compilation on Mac
Bug and warning fix
- Compilation warnings fixed by reordering initialization of members in C++
- Bug fix for C++ object only. There was an error in the assignement operator implementation. This wouldn't cause issue for python only usage, but could lead to memory issues when using the C++ object directly.
Feature : iterator for SamplableSet objects
- New template declaration function to facilitate the addition of new types in the c++ binder file
- New default SamplableSet with strings
- Implemented C++ methods to iterate over all the elements of a set
- Implemented Python generator/iterator methods
- SamplableSet objects are now iterable
- Implemented a bunch of test (uses pytest)
Post-merging with jsleb333 pythonic wrapper
First true release, with a complete python wrapper.