A simple library for executing BLAST searches with ncbi-blast+
Project description
multiset-key-dict
This small library implements a mapping-like object whose keys are taken to be unordered multisets (Counters, bags), regardless of the type of the actual indexes used.
Example
Create a MultisetKeyDict and insert an element for the set {1, 3, 5}.
from multiset_key_dict import MultisetKeyDict
mskd = MultisetKeyDict()
mskd[[1, 3, 5]] = 19
Access the element just added.
# In a different order.
print(mskd[[3, 5, 1]]) # 19
# With a different type of collection.
print(mskd[{3, 5, 1}]) # 19
__iter__ iterates over items in the MultisetKeyDict, viewed as frozensets
(i.e., not accounting for multiplicity).
# Add more data.
mskd[[1]] = 9
mskd[[5, 6]] = 12
print(list(mskd)) # [(frozenset({1, 3, 5}), 19), (frozenset({1}), 9), (frozenset({5, 6}), 12)]
To iterate over key-value pairs where the keys are the FrozenMultiset objects
that act as the true keys in the structure, use multiset_iter or items
methods instead.
msked[[1, 1]] = 90
print(list(mskd))
# [(frozenset({1, 3, 5}), 19), (frozenset({1}), 9), (frozenset({5, 6}), 12),
# (frozenset({1}), 90)]
print(list(mskd.multiset_iter()))
# [(FrozenMultiset({(3, 1), (1, 1), (5, 1)}), 19),
# (FrozenMultiset({(1, 1)}), 9),
# (FrozenMultiset({(6, 1), (5, 1)}), 12),
# (FrozenMultiset({(1, 2)}), 90)]
To get the keys as frozenset objects, use set_keys. To get the keys as
FrozenMultiset objects, use multiset_keys or keys.
It's sometimes useful to get the set of elements of the keys. For that, you
can use the key_elements method.
print(mskd.key_elements()) # frozenset({1, 3, 5, 6})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiset_key_dict-0.2.1.tar.gz.
File metadata
- Download URL: multiset_key_dict-0.2.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f76b886a93f28f63891d5ae6fa201abfe6b7946b42d0fec607a95d7735bd479
|
|
| MD5 |
db3d8c7209d03b843d6200a3a0c97ff3
|
|
| BLAKE2b-256 |
87d2bb7aadb2344749a05433a52cc6954c267ea7038b8fdc115cc171a6fa485e
|
Provenance
The following attestation bundles were made for multiset_key_dict-0.2.1.tar.gz:
Publisher:
package.yml on actapia/multiset-key-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multiset_key_dict-0.2.1.tar.gz -
Subject digest:
7f76b886a93f28f63891d5ae6fa201abfe6b7946b42d0fec607a95d7735bd479 - Sigstore transparency entry: 194616129
- Sigstore integration time:
-
Permalink:
actapia/multiset-key-dict@0228397ce12926adb81c9557767b728f59c74b95 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/actapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@0228397ce12926adb81c9557767b728f59c74b95 -
Trigger Event:
release
-
Statement type:
File details
Details for the file multiset_key_dict-0.2.1-py3-none-any.whl.
File metadata
- Download URL: multiset_key_dict-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91ddbf147886dd8628cade9e8d6265cd5e845df571a99af3c14e9c3edbada5c6
|
|
| MD5 |
88cbab79842524fa10e03885650fd6b2
|
|
| BLAKE2b-256 |
cf0da158ee23907d831dfc1f240266b7a14c04db8f2804e10a8943bcdc981eea
|
Provenance
The following attestation bundles were made for multiset_key_dict-0.2.1-py3-none-any.whl:
Publisher:
package.yml on actapia/multiset-key-dict
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multiset_key_dict-0.2.1-py3-none-any.whl -
Subject digest:
91ddbf147886dd8628cade9e8d6265cd5e845df571a99af3c14e9c3edbada5c6 - Sigstore transparency entry: 194616132
- Sigstore integration time:
-
Permalink:
actapia/multiset-key-dict@0228397ce12926adb81c9557767b728f59c74b95 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/actapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@0228397ce12926adb81c9557767b728f59c74b95 -
Trigger Event:
release
-
Statement type: