biotapy 0.0.1__py3-none-any.whl
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.
- biotapy/__init__.py +5 -0
- biotapy/_core/__init__.py +6 -0
- biotapy/_core/_optional.py +13 -0
- biotapy/_core/_rng.py +13 -0
- biotapy-0.0.1.dist-info/METADATA +117 -0
- biotapy-0.0.1.dist-info/RECORD +8 -0
- biotapy-0.0.1.dist-info/WHEEL +4 -0
- biotapy-0.0.1.dist-info/licenses/LICENSE +29 -0
biotapy/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Lazy imports for optional extras (decisions/optional-heavy-dependencies)."""
|
|
2
|
+
|
|
3
|
+
import importlib
|
|
4
|
+
from types import ModuleType
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def import_optional(name: str, *, extra: str) -> ModuleType:
|
|
8
|
+
"""Import ``name`` or raise an ImportError that names the extra to install."""
|
|
9
|
+
try:
|
|
10
|
+
return importlib.import_module(name)
|
|
11
|
+
except ImportError as err:
|
|
12
|
+
msg = f"{name} is required here. Install it with: pip install 'biotapy[{extra}]'"
|
|
13
|
+
raise ImportError(msg) from err
|
biotapy/_core/_rng.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Single entry point for randomness (rules.md R3.4)."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def as_generator(seed: int | np.random.Generator | None) -> np.random.Generator:
|
|
7
|
+
"""Return a NumPy Generator for ``seed`` without touching global state."""
|
|
8
|
+
if isinstance(seed, np.random.Generator):
|
|
9
|
+
return seed
|
|
10
|
+
if seed is None or isinstance(seed, int | np.integer):
|
|
11
|
+
return np.random.default_rng(seed)
|
|
12
|
+
msg = f"seed must be an int, a numpy Generator or None, got {type(seed).__name__}"
|
|
13
|
+
raise TypeError(msg)
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: biotapy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: mia-style microbiome toolkit for Python on AnnData/TreeData
|
|
5
|
+
Project-URL: Documentation, https://biotapy.readthedocs.io/
|
|
6
|
+
Project-URL: Homepage, https://github.com/pedrocr83/biotapy
|
|
7
|
+
Project-URL: Source, https://github.com/pedrocr83/biotapy
|
|
8
|
+
Author: Pedro Ribeiro
|
|
9
|
+
Maintainer-email: Pedro Ribeiro <pedrocasalribeiro@gmail.com>
|
|
10
|
+
License: BSD 3-Clause License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026, Pedro Ribeiro
|
|
13
|
+
All rights reserved.
|
|
14
|
+
|
|
15
|
+
Redistribution and use in source and binary forms, with or without
|
|
16
|
+
modification, are permitted provided that the following conditions are met:
|
|
17
|
+
|
|
18
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
19
|
+
list of conditions and the following disclaimer.
|
|
20
|
+
|
|
21
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
22
|
+
this list of conditions and the following disclaimer in the documentation
|
|
23
|
+
and/or other materials provided with the distribution.
|
|
24
|
+
|
|
25
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
26
|
+
contributors may be used to endorse or promote products derived from
|
|
27
|
+
this software without specific prior written permission.
|
|
28
|
+
|
|
29
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
30
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
31
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
32
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
33
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
34
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
35
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
36
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
37
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
38
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
44
|
+
Requires-Python: >=3.12
|
|
45
|
+
Requires-Dist: anndata
|
|
46
|
+
Requires-Dist: numpy
|
|
47
|
+
Requires-Dist: session-info2
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
# biotapy
|
|
51
|
+
|
|
52
|
+
[![Tests][badge-tests]][tests]
|
|
53
|
+
[![Documentation][badge-docs]][documentation]
|
|
54
|
+
|
|
55
|
+
[badge-tests]: https://img.shields.io/github/actions/workflow/status/pedrocr83/biotapy/test.yaml?branch=master
|
|
56
|
+
[badge-docs]: https://app.readthedocs.org/projects/biotapy/badge/
|
|
57
|
+
|
|
58
|
+
mia-style microbiome toolkit for Python on AnnData/TreeData
|
|
59
|
+
|
|
60
|
+
## Getting started
|
|
61
|
+
|
|
62
|
+
Please refer to the [documentation][],
|
|
63
|
+
in particular, the [API documentation][].
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
You need to have Python 3.12 or newer installed on your system.
|
|
68
|
+
If you don't have Python installed, we recommend installing [uv][].
|
|
69
|
+
|
|
70
|
+
We recommend managing dependencies in project-specific virtual environments to avoid dependency conflicts.
|
|
71
|
+
This is most convenient using package managers such as [uv][].
|
|
72
|
+
Choose from the options below to install biotapy:
|
|
73
|
+
|
|
74
|
+
<!--
|
|
75
|
+
1. Add the latest release of `biotapy` from [PyPI][] to your `uv` project:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
uv add biotapy
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
1. Install the latest release into a [standard virtual environment][venv]:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
(after activating your venv)
|
|
85
|
+
pip install biotapy
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
-->
|
|
89
|
+
|
|
90
|
+
1. Install the latest development version:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install git+https://github.com/pedrocr83/biotapy.git # (or `uv add`)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Release notes
|
|
97
|
+
|
|
98
|
+
See the [changelog][].
|
|
99
|
+
|
|
100
|
+
## Contact
|
|
101
|
+
|
|
102
|
+
For questions and help requests, you can reach out in the [scverse discourse][].
|
|
103
|
+
If you found a bug, please use the [issue tracker][].
|
|
104
|
+
|
|
105
|
+
## Citation
|
|
106
|
+
|
|
107
|
+
> t.b.a
|
|
108
|
+
|
|
109
|
+
[uv]: https://github.com/astral-sh/uv
|
|
110
|
+
[scverse discourse]: https://discourse.scverse.org/
|
|
111
|
+
[issue tracker]: https://github.com/pedrocr83/biotapy/issues
|
|
112
|
+
[tests]: https://github.com/pedrocr83/biotapy/actions/workflows/test.yaml
|
|
113
|
+
[documentation]: https://biotapy.readthedocs.io
|
|
114
|
+
[changelog]: https://biotapy.readthedocs.io/page/changelog.html
|
|
115
|
+
[api documentation]: https://biotapy.readthedocs.io/page/api.html
|
|
116
|
+
[pypi]: https://pypi.org/project/biotapy
|
|
117
|
+
[venv]: https://docs.python.org/3/tutorial/venv.html
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
biotapy/__init__.py,sha256=sv3v_rY596sGY91lgpmiocHj9ytl59jLbMlZA-uiiM8,100
|
|
2
|
+
biotapy/_core/__init__.py,sha256=FjkURXkFRoPdm_VBAJaRWiQvfgooN4dVOUnUZnoJZ0c,200
|
|
3
|
+
biotapy/_core/_optional.py,sha256=q8hyi_cMCDBV818a-A-wrsymRMZXGPJfely_AunV0p4,488
|
|
4
|
+
biotapy/_core/_rng.py,sha256=w2uDraKZqpVbmN7vl-7VY_AzKvPn1occA_WoNjlvdBA,519
|
|
5
|
+
biotapy-0.0.1.dist-info/METADATA,sha256=72lgzqUwhiXaTVuIWUSQfbZ4Lvbkip2l6sOMWTzR0Ys,4428
|
|
6
|
+
biotapy-0.0.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
7
|
+
biotapy-0.0.1.dist-info/licenses/LICENSE,sha256=F2WVKna2SRJ0248orGJc81MguhH_TZ8FCS1-HESgetk,1521
|
|
8
|
+
biotapy-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Pedro Ribeiro
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|