This is an automated email from the ASF dual-hosted git repository.
jmalkin pushed a commit to branch python_theta
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git
The following commit(s) were added to refs/heads/python_theta by this push:
new a494d97 add basic readme for python usage
a494d97 is described below
commit a494d97765dd3d1d73921116e6b101e67ce48a55
Author: jmalkin <[email protected]>
AuthorDate: Wed Jul 3 00:47:17 2019 -0700
add basic readme for python usage
---
python/README.md | 32 ++++++++++++++++++++++++++++++++
python/src/kll_wrapper.cpp | 4 ++--
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/python/README.md b/python/README.md
new file mode 100644
index 0000000..042c9e5
--- /dev/null
+++ b/python/README.md
@@ -0,0 +1,32 @@
+# Python Wrapper for Datasketches
+
+## Usage
+
+Having followed installation instructions in the root directory, loading the
Datasketches library in Python is simple: `from datasketches import *`.
+
+## Available Sketch Classes
+
+- KLL
+ - `kll_ints_sketch`
+ - `kll_floats_sketch`
+- Frequent Items
+ - `frequent_strings_sketch`
+ - Error types are `frequent_items_error_type.{NO_FALSE_NEGATIVES |
NO_FALSE_POSITIVES}`
+- Theta
+ - `update_theta_sketch`
+ - `compact_theta_sketch` (cannot be instantiated directly)
+ - `theta_union`
+ - `theta_intersection`
+ - `theta_a_not_b`
+- HLL
+ - `hll_sketch`
+ - `hll_union`
+- CPC
+ - `cpc_sketch`
+ - `cpc_union`
+
+## Known Differences from C++
+
+The Python API largely mirrors the C++ API, with a few minor exceptions: The
primary known differences are that Python on modern platforms does not support
unsigned integer values or numeric values with fewer than 64 bits. As a result,
you may not be able to produce identical sketches from within Python as you can
with Java and C++. Loading those sketches after they have been serialized from
another language will work as expected.
+
+We have also removed reliance on a builder class for theta sketches as Python
allows named arguments to the constructor, not strictly positional arguments.
diff --git a/python/src/kll_wrapper.cpp b/python/src/kll_wrapper.cpp
index 4263bd5..a7be131 100644
--- a/python/src/kll_wrapper.cpp
+++ b/python/src/kll_wrapper.cpp
@@ -140,6 +140,6 @@ void bind_kll_sketch(py::module &m, const char* name) {
}
void init_kll(py::module &m) {
- bind_kll_sketch<int>(m, "kll_int_sketch");
- bind_kll_sketch<float>(m, "kll_float_sketch");
+ bind_kll_sketch<int>(m, "kll_ints_sketch");
+ bind_kll_sketch<float>(m, "kll_floats_sketch");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]