Functions
|
Returns the start (inclusive) and end (exclusive) indices for a sorted array using a key function. |
|
Slice the iterable using inclusive bisection. |
|
Group a list by some key. |
|
wrapper for logging method run times for a class. |
|
wrapper for logging method run times for a class. |
|
Determine whether a blast result consumes the entire subject. |
|
Sort an iterable, returning both the sorted array and the sorted keys. |
Utilities (dasi.utils
)¶
This module provide various utility functions.
Networkx utilities¶
Specialized networkx algorithms for path and cycle finding.
|
|
-
dasi.utils.
bisect_between
(a, low, high)[source]¶ Returns the start (inclusive) and end (exclusive) indices for a sorted array using a key function.
- Parameters
a (
Iterable
) – sorted array (does not check)low (
Any
) – low keyhigh (
Any
) – high key
- Return type
Tuple
[int
,int
]- Returns
tuple of start (inclusive) and end (exclusive) indices
-
dasi.utils.
bisect_slice_between
(a, keys, low, high)[source]¶ Slice the iterable using inclusive bisection. Assumes both the iterable and keys are sorted. Bisect at specified low and high.
- Parameters
a (
Iterable
) – pre-sorted iterable to slicekeys (
Iterable
) – pre-sorted keys to bisectlow (
Any
) – low keyhigh (
Any
) – high key
- Return type
Iterable
- Returns
sliced iterable
-
dasi.utils.
log_metadata
(key=None, class_attribute='_method_trace', additional_metadata=None)[source]¶ wrapper for logging method run times for a class.
-
dasi.utils.
log_times
(key=None, class_attribute='_method_trace')[source]¶ wrapper for logging method run times for a class.