superintervals 0.2.7__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: superintervals
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Rapid interval intersections
5
5
  Author: Kez Cleal
6
6
  Author-email: Kez Cleal <clealk@cardiff.ac.uk>
@@ -162,12 +162,16 @@ Install using `pip install superintervals`
162
162
  ```
163
163
  from superintervals import IntervalSet
164
164
 
165
- iset = IntervalSet(with_data=True)
165
+ iset = IntervalSet()
166
166
 
167
- # Add interval start, end, identifier. Integer values are supported
167
+ # Add interval start, end, value
168
168
  iset.add(10, 20, 0)
169
169
  iset.add(19, 18, 1)
170
- iset.add(8, 11, 2)
170
+ iset.add(8, 11, "hello")
171
+
172
+ # If you only need integers as values use the add_int_value method instead e.g:
173
+ # iset.add_int_value(10, 20, 1)
174
+ # Note, mixing add and add_int_value is not allowed (just use one or the other)
171
175
 
172
176
  # Index method must be called before queries
173
177
  iset.index()
@@ -179,7 +183,7 @@ iset.count_overlaps(8, 20)
179
183
  # >>> 3
180
184
 
181
185
  iset.find_overlaps(8, 20)
182
- # >>> [1, 0, 2]
186
+ # >>> [1, 0, "hello"]
183
187
 
184
188
  iset.set_search_interval(8, 20)
185
189
  for itv in iset:
@@ -187,8 +191,11 @@ for itv in iset:
187
191
 
188
192
  # >>> (19, 18, 1)
189
193
  # >>> (10, 20, 0)
190
- # >>> (8, 11, 2)
194
+ # >>> (8, 11, "hello")
191
195
 
196
+ # Print interval at index
197
+ iset.at(0)
198
+ # >>> (8, 11, "hello")
192
199
  ```
193
200
 
194
201
  ## Cpp
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
 
9
9
  [project]
10
10
  name = "superintervals"
11
- version = "0.2.7"
11
+ version = "0.2.9"
12
12
  description = "Rapid interval intersections"
13
13
  dependencies = ['Cython']
14
14
  authors = [{name = "Kez Cleal", email = "clealk@cardiff.ac.uk"}]