cellarr 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.
- cellarr/__init__.py +16 -0
- cellarr/skeleton.py +149 -0
- cellarr-0.0.1.dist-info/LICENSE.txt +21 -0
- cellarr-0.0.1.dist-info/METADATA +48 -0
- cellarr-0.0.1.dist-info/RECORD +7 -0
- cellarr-0.0.1.dist-info/WHEEL +5 -0
- cellarr-0.0.1.dist-info/top_level.txt +1 -0
cellarr/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
if sys.version_info[:2] >= (3, 8):
|
|
4
|
+
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
|
|
6
|
+
else:
|
|
7
|
+
from importlib_metadata import PackageNotFoundError, version # pragma: no cover
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# Change here if project is renamed and does not equal the package name
|
|
11
|
+
dist_name = __name__
|
|
12
|
+
__version__ = version(dist_name)
|
|
13
|
+
except PackageNotFoundError: # pragma: no cover
|
|
14
|
+
__version__ = "unknown"
|
|
15
|
+
finally:
|
|
16
|
+
del version, PackageNotFoundError
|
cellarr/skeleton.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This is a skeleton file that can serve as a starting point for a Python
|
|
3
|
+
console script. To run this script uncomment the following lines in the
|
|
4
|
+
``[options.entry_points]`` section in ``setup.cfg``::
|
|
5
|
+
|
|
6
|
+
console_scripts =
|
|
7
|
+
fibonacci = cellarr.skeleton:run
|
|
8
|
+
|
|
9
|
+
Then run ``pip install .`` (or ``pip install -e .`` for editable mode)
|
|
10
|
+
which will install the command ``fibonacci`` inside your current environment.
|
|
11
|
+
|
|
12
|
+
Besides console scripts, the header (i.e. until ``_logger``...) of this file can
|
|
13
|
+
also be used as template for Python modules.
|
|
14
|
+
|
|
15
|
+
Note:
|
|
16
|
+
This file can be renamed depending on your needs or safely removed if not needed.
|
|
17
|
+
|
|
18
|
+
References:
|
|
19
|
+
- https://setuptools.pypa.io/en/latest/userguide/entry_point.html
|
|
20
|
+
- https://pip.pypa.io/en/stable/reference/pip_install
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import argparse
|
|
24
|
+
import logging
|
|
25
|
+
import sys
|
|
26
|
+
|
|
27
|
+
from cellarr import __version__
|
|
28
|
+
|
|
29
|
+
__author__ = "Jayaram Kancherla"
|
|
30
|
+
__copyright__ = "Jayaram Kancherla"
|
|
31
|
+
__license__ = "MIT"
|
|
32
|
+
|
|
33
|
+
_logger = logging.getLogger(__name__)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# ---- Python API ----
|
|
37
|
+
# The functions defined in this section can be imported by users in their
|
|
38
|
+
# Python scripts/interactive interpreter, e.g. via
|
|
39
|
+
# `from cellarr.skeleton import fib`,
|
|
40
|
+
# when using this Python module as a library.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def fib(n):
|
|
44
|
+
"""Fibonacci example function
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
n (int): integer
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
int: n-th Fibonacci number
|
|
51
|
+
"""
|
|
52
|
+
assert n > 0
|
|
53
|
+
a, b = 1, 1
|
|
54
|
+
for _i in range(n - 1):
|
|
55
|
+
a, b = b, a + b
|
|
56
|
+
return a
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# ---- CLI ----
|
|
60
|
+
# The functions defined in this section are wrappers around the main Python
|
|
61
|
+
# API allowing them to be called directly from the terminal as a CLI
|
|
62
|
+
# executable/script.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def parse_args(args):
|
|
66
|
+
"""Parse command line parameters
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
args (List[str]): command line parameters as list of strings
|
|
70
|
+
(for example ``["--help"]``).
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
:obj:`argparse.Namespace`: command line parameters namespace
|
|
74
|
+
"""
|
|
75
|
+
parser = argparse.ArgumentParser(description="Just a Fibonacci demonstration")
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"--version",
|
|
78
|
+
action="version",
|
|
79
|
+
version=f"cellarr {__version__}",
|
|
80
|
+
)
|
|
81
|
+
parser.add_argument(dest="n", help="n-th Fibonacci number", type=int, metavar="INT")
|
|
82
|
+
parser.add_argument(
|
|
83
|
+
"-v",
|
|
84
|
+
"--verbose",
|
|
85
|
+
dest="loglevel",
|
|
86
|
+
help="set loglevel to INFO",
|
|
87
|
+
action="store_const",
|
|
88
|
+
const=logging.INFO,
|
|
89
|
+
)
|
|
90
|
+
parser.add_argument(
|
|
91
|
+
"-vv",
|
|
92
|
+
"--very-verbose",
|
|
93
|
+
dest="loglevel",
|
|
94
|
+
help="set loglevel to DEBUG",
|
|
95
|
+
action="store_const",
|
|
96
|
+
const=logging.DEBUG,
|
|
97
|
+
)
|
|
98
|
+
return parser.parse_args(args)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def setup_logging(loglevel):
|
|
102
|
+
"""Setup basic logging
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
loglevel (int): minimum loglevel for emitting messages
|
|
106
|
+
"""
|
|
107
|
+
logformat = "[%(asctime)s] %(levelname)s:%(name)s:%(message)s"
|
|
108
|
+
logging.basicConfig(
|
|
109
|
+
level=loglevel, stream=sys.stdout, format=logformat, datefmt="%Y-%m-%d %H:%M:%S"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def main(args):
|
|
114
|
+
"""Wrapper allowing :func:`fib` to be called with string arguments in a CLI fashion
|
|
115
|
+
|
|
116
|
+
Instead of returning the value from :func:`fib`, it prints the result to the
|
|
117
|
+
``stdout`` in a nicely formatted message.
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
args (List[str]): command line parameters as list of strings
|
|
121
|
+
(for example ``["--verbose", "42"]``).
|
|
122
|
+
"""
|
|
123
|
+
args = parse_args(args)
|
|
124
|
+
setup_logging(args.loglevel)
|
|
125
|
+
_logger.debug("Starting crazy calculations...")
|
|
126
|
+
print(f"The {args.n}-th Fibonacci number is {fib(args.n)}")
|
|
127
|
+
_logger.info("Script ends here")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def run():
|
|
131
|
+
"""Calls :func:`main` passing the CLI arguments extracted from :obj:`sys.argv`
|
|
132
|
+
|
|
133
|
+
This function can be used as entry point to create console scripts with setuptools.
|
|
134
|
+
"""
|
|
135
|
+
main(sys.argv[1:])
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
if __name__ == "__main__":
|
|
139
|
+
# ^ This is a guard statement that will prevent the following code from
|
|
140
|
+
# being executed in the case someone imports this file instead of
|
|
141
|
+
# executing it as a script.
|
|
142
|
+
# https://docs.python.org/3/library/__main__.html
|
|
143
|
+
|
|
144
|
+
# After installing your project with pip, users can also run your Python
|
|
145
|
+
# modules as scripts via the ``-m`` flag, as defined in PEP 338::
|
|
146
|
+
#
|
|
147
|
+
# python -m cellarr.skeleton 42
|
|
148
|
+
#
|
|
149
|
+
run()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Jayaram Kancherla
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cellarr
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: TileDB-based array storage for single-cell data collections.
|
|
5
|
+
Home-page: https://github.com/BiocPy/cellarr
|
|
6
|
+
Author: Jayaram Kancherla
|
|
7
|
+
Author-email: jayaram.kancherla@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://github.com/BiocPy/cellarr
|
|
10
|
+
Platform: any
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
|
+
License-File: LICENSE.txt
|
|
16
|
+
Requires-Dist: importlib-metadata ; python_version < "3.8"
|
|
17
|
+
Provides-Extra: testing
|
|
18
|
+
Requires-Dist: setuptools ; extra == 'testing'
|
|
19
|
+
Requires-Dist: pytest ; extra == 'testing'
|
|
20
|
+
Requires-Dist: pytest-cov ; extra == 'testing'
|
|
21
|
+
|
|
22
|
+
<!-- These are examples of badges you might want to add to your README:
|
|
23
|
+
please update the URLs accordingly
|
|
24
|
+
|
|
25
|
+
[](https://cirrus-ci.com/github/<USER>/cellarr)
|
|
26
|
+
[](https://cellarr.readthedocs.io/en/stable/)
|
|
27
|
+
[](https://coveralls.io/r/<USER>/cellarr)
|
|
28
|
+
[](https://pypi.org/project/cellarr/)
|
|
29
|
+
[](https://anaconda.org/conda-forge/cellarr)
|
|
30
|
+
[](https://pepy.tech/project/cellarr)
|
|
31
|
+
[](https://twitter.com/cellarr)
|
|
32
|
+
-->
|
|
33
|
+
|
|
34
|
+
[](https://pyscaffold.org/)
|
|
35
|
+
|
|
36
|
+
# cellarr
|
|
37
|
+
|
|
38
|
+
> Add a short description here!
|
|
39
|
+
|
|
40
|
+
A longer description of your project goes here...
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<!-- pyscaffold-notes -->
|
|
44
|
+
|
|
45
|
+
## Note
|
|
46
|
+
|
|
47
|
+
This project has been set up using PyScaffold 4.5. For details and usage
|
|
48
|
+
information on PyScaffold see https://pyscaffold.org/.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cellarr/__init__.py,sha256=pH5i4Fj1tbXLqLtTVIdoojiplZssQn0nnud8-HXodRE,577
|
|
2
|
+
cellarr/skeleton.py,sha256=etm2brd3Zl4PrjeS1-u2Huy0aBxdAXKJrtTg_n-dmfc,4222
|
|
3
|
+
cellarr-0.0.1.dist-info/LICENSE.txt,sha256=kXGI4eKM3dFP79vCaYersRg8MA4GYpZ9oEiGwdIGGA8,1084
|
|
4
|
+
cellarr-0.0.1.dist-info/METADATA,sha256=lg9_BpxDOrSzemPDtB3HsGBQmsLz-DgdhmObMfq4M1A,2059
|
|
5
|
+
cellarr-0.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
6
|
+
cellarr-0.0.1.dist-info/top_level.txt,sha256=vPB9dw4REE68L6y0ca-sS_gUMsPG-YOSJDzZ6ZJrrFY,8
|
|
7
|
+
cellarr-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cellarr
|