Caryocar
Caryocar is a Python package for building Species-Collector Networks (SCNs) and Collector CoWorking Networks(CWNs) models from species occurrence data, as introduced in my MSc thesis. SCNs and CWNs extend the social network analytics and can be used for understanding the social structure behind biological collections. This package is built on top of NetworkX.
Supporting documents
- New perspectives on analyzing data from biological collections based on social network analytics [MSc thesis].
- On the social structure behind biological collections [Preprint].
- Package documentation coming soon...
Example Usage
Create a Species-Collector Network (SCN) from a list of collectors and species:
>>> cols=[ ['col1','col2','col3'],
['col1','col2'],
['col2','col3'],
['col4','col5'],
['col4'],
['col5','col4'] ]
>>> spp=['sp1','sp2','sp3','sp2','sp3','sp2']
>>> scn = SpeciesCollectorsNetwork( species=spp, collectors=cols )
>>> scn.nodes(data=True)
{ 'sp1': {'bipartite': 1, 'count': 1},
'col1': {'bipartite': 0, 'count': 2},
'col2': {'bipartite': 0, 'count': 3},
'col3': {'bipartite': 0, 'count': 2},
'sp2': {'bipartite': 1, 'count': 3},
'sp3': {'bipartite': 1, 'count': 2},
'col4': {'bipartite': 0, 'count': 3},
'col5': {'bipartite': 0, 'count': 2} }
>>> scn.edges(data=True)
[ ('sp1', 'col1', {'count': 1}),
('sp1', 'col2', {'count': 1}),
('sp1', 'col3', {'count': 1}),
('col1', 'sp2', {'count': 1}),
('col2', 'sp2', {'count': 1}),
('col2', 'sp3', {'count': 1}),
('col3', 'sp3', {'count': 1}),
('sp2', 'col4', {'count': 2}),
('sp2', 'col5', {'count': 2}),
('sp3', 'col4', {'count': 1}) ]
Create a Collector CoWorking Network (CWN) from a list of collector cliques:
>>> collectors = [ ['a','b','c'], ['d','e'], ['a','c'] ]
>>> cwn = CoworkingNetwork(cliques=collectors)
>>> cwn.nodes(data=True)
{ 'a': {'count': 2},
'b': {'count': 1},
'c': {'count': 2},
'd': {'count': 1},
'e': {'count': 1} }
>>> cwn.edges(data=True)
[ ('a', 'b', {'count': 1, 'taxons': None, 'weight_hyperbolic': 0.5}),
('a', 'c', {'count': 2, 'taxons': None, 'weight_hyperbolic': 1.5}),
('b', 'c', {'count': 1, 'taxons': None, 'weight_hyperbolic': 0.5}),
('d', 'e', {'count': 1, 'taxons': None, 'weight_hyperbolic': 1.0}) ]
Install
This package is still experimental, and should ideally be run from a conda virtual environment, which is specified in the environment.yml file. In order to create the virtual environment clone this repository, make sure you have conda installed and use one of the following commands, from the root of the repository:
$ conda env create -f environment.yml
Then you should activate it with the following command:
-
On Linux:
$ source activate caryocar
-
On Windows:
$ activate caryocar
Metadata
Release files for caryocar 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| caryocar-0.0.1.tar.gz | 15.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| caryocar-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.5 kB
Release files / caryocar-0.0.1.tar.gz
| Download URL | caryocar-0.0.1.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a826837ef70f2a7c83443ca048271f2ae1b53f39f9613f28febcb11bff420dae
|
|
BLAKE2b-256 checksum How to use checksums |
86690cea33e01ddbe656c1064855c7af9bafccdcdec7106cab8066f0053413f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
|
Release files / caryocar-0.0.1-py3-none-any.whl
| Download URL | caryocar-0.0.1-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e410a89432b39697443d2dfbd20ecb12af6fe68b993e76bd88d3221e727335fa
|
|
BLAKE2b-256 checksum How to use checksums |
d99173bb84c4706c1c0a1c6007c3c925cb88b002e15aaf0a952aaf870745b407
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
|
Security for caryocar 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.