phasorpy 0.1__cp311-cp311-macosx_11_0_arm64.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.
- phasorpy/__init__.py +10 -0
- phasorpy/__main__.py +7 -0
- phasorpy/_phasorpy.cpython-311-darwin.so +0 -0
- phasorpy/_phasorpy.pyx +1811 -0
- phasorpy/_typing.py +77 -0
- phasorpy/_utils.py +441 -0
- phasorpy/cli.py +87 -0
- phasorpy/color.py +581 -0
- phasorpy/components.py +313 -0
- phasorpy/conftest.py +36 -0
- phasorpy/cursors.py +502 -0
- phasorpy/datasets.py +433 -0
- phasorpy/io.py +1671 -0
- phasorpy/phasor.py +3135 -0
- phasorpy/plot.py +2074 -0
- phasorpy/py.typed +0 -0
- phasorpy/utils.py +68 -0
- phasorpy/version.py +71 -0
- phasorpy-0.1.dist-info/LICENSE.txt +21 -0
- phasorpy-0.1.dist-info/METADATA +78 -0
- phasorpy-0.1.dist-info/RECORD +24 -0
- phasorpy-0.1.dist-info/WHEEL +5 -0
- phasorpy-0.1.dist-info/entry_points.txt +2 -0
- phasorpy-0.1.dist-info/top_level.txt +1 -0
phasorpy/py.typed
ADDED
File without changes
|
phasorpy/utils.py
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
"""Utility functions.
|
2
|
+
|
3
|
+
The ``phasorpy.utils`` module provides auxiliary and convenience functions
|
4
|
+
that do not naturally fit into other modules.
|
5
|
+
|
6
|
+
"""
|
7
|
+
|
8
|
+
from __future__ import annotations
|
9
|
+
|
10
|
+
__all__ = ['number_threads']
|
11
|
+
|
12
|
+
import os
|
13
|
+
|
14
|
+
|
15
|
+
def number_threads(
|
16
|
+
num_threads: int | None = None,
|
17
|
+
max_threads: int | None = None,
|
18
|
+
/,
|
19
|
+
) -> int:
|
20
|
+
"""Return number of threads for parallel computations on CPU cores.
|
21
|
+
|
22
|
+
This function is used to parse ``num_threads`` parameters.
|
23
|
+
|
24
|
+
Parameters
|
25
|
+
----------
|
26
|
+
num_threads : int, optional
|
27
|
+
Number of threads to use for parallel computations on CPU cores.
|
28
|
+
If None (default), return 1, disabling multi-threading.
|
29
|
+
If greater than zero, return value up to `max_threads` if set.
|
30
|
+
If zero, return the value of the ``PHASORPY_NUM_THREADS`` environment
|
31
|
+
variable if set, else half the CPU cores up to `max_threads` or 32.
|
32
|
+
max_threads : int, optional
|
33
|
+
Maximum number of threads to return.
|
34
|
+
|
35
|
+
Examples
|
36
|
+
--------
|
37
|
+
>>> number_threads()
|
38
|
+
1
|
39
|
+
>>> number_threads(0) # doctest: +SKIP
|
40
|
+
8
|
41
|
+
|
42
|
+
"""
|
43
|
+
if num_threads is None or num_threads < 0:
|
44
|
+
# disable multi-threading by default
|
45
|
+
return 1
|
46
|
+
if num_threads == 0:
|
47
|
+
# return default number of threads
|
48
|
+
if max_threads is None:
|
49
|
+
max_threads = 32
|
50
|
+
else:
|
51
|
+
max_threads = max(max_threads, 1)
|
52
|
+
if 'PHASORPY_NUM_THREADS' in os.environ:
|
53
|
+
return min(
|
54
|
+
max_threads, max(1, int(os.environ['PHASORPY_NUM_THREADS']))
|
55
|
+
)
|
56
|
+
cpu_count: int | None
|
57
|
+
if hasattr(os, 'sched_getaffinity'):
|
58
|
+
cpu_count = len(os.sched_getaffinity(0))
|
59
|
+
else:
|
60
|
+
# sched_getaffinity not available on Windows
|
61
|
+
cpu_count = os.cpu_count()
|
62
|
+
if cpu_count is None:
|
63
|
+
return 1
|
64
|
+
return min(max_threads, max(1, cpu_count // 2))
|
65
|
+
# return num_threads up to max_threads
|
66
|
+
if max_threads is None:
|
67
|
+
return num_threads
|
68
|
+
return min(num_threads, max(max_threads, 1))
|
phasorpy/version.py
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
"""Version information."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
__version__ = '0.1'
|
6
|
+
|
7
|
+
|
8
|
+
def versions(
|
9
|
+
*, sep: str = '\n', dash: str = '-', verbose: bool = False
|
10
|
+
) -> str:
|
11
|
+
"""Return versions of installed packages that phasorpy depends on.
|
12
|
+
|
13
|
+
Parameters
|
14
|
+
----------
|
15
|
+
sep : str, optional
|
16
|
+
Separator between version items. The default is a newline character.
|
17
|
+
dash : str, optional
|
18
|
+
Separator between module name and version.
|
19
|
+
verbose : bool, optional
|
20
|
+
Include paths to Python interpreter and modules.
|
21
|
+
|
22
|
+
Example
|
23
|
+
-------
|
24
|
+
>>> print(versions())
|
25
|
+
Python-3...
|
26
|
+
phasorpy-0...
|
27
|
+
numpy-...
|
28
|
+
...
|
29
|
+
|
30
|
+
"""
|
31
|
+
import os
|
32
|
+
import sys
|
33
|
+
|
34
|
+
if verbose:
|
35
|
+
version_strings = [f'Python{dash}{sys.version} ({sys.executable})']
|
36
|
+
else:
|
37
|
+
version_strings = [f'Python{dash}{sys.version.split()[0]}']
|
38
|
+
|
39
|
+
for module in (
|
40
|
+
'phasorpy',
|
41
|
+
'numpy',
|
42
|
+
'tifffile',
|
43
|
+
'imagecodecs',
|
44
|
+
'lfdfiles',
|
45
|
+
'sdtfile',
|
46
|
+
'ptufile',
|
47
|
+
'matplotlib',
|
48
|
+
'scipy',
|
49
|
+
'skimage',
|
50
|
+
'sklearn',
|
51
|
+
'pandas',
|
52
|
+
'xarray',
|
53
|
+
'click',
|
54
|
+
'pooch',
|
55
|
+
):
|
56
|
+
try:
|
57
|
+
__import__(module)
|
58
|
+
except ModuleNotFoundError:
|
59
|
+
version_strings.append(f'{module.lower()}{dash}n/a')
|
60
|
+
continue
|
61
|
+
lib = sys.modules[module]
|
62
|
+
ver = f"{module.lower()}{dash}{getattr(lib, '__version__', 'unknown')}"
|
63
|
+
if verbose:
|
64
|
+
try:
|
65
|
+
path = getattr(lib, '__file__')
|
66
|
+
except NameError:
|
67
|
+
pass
|
68
|
+
else:
|
69
|
+
ver += f' ({os.path.dirname(path)})'
|
70
|
+
version_strings.append(ver)
|
71
|
+
return sep.join(version_strings)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022-2024 PhasorPy Contributors
|
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,78 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: phasorpy
|
3
|
+
Version: 0.1
|
4
|
+
Summary: Analysis of fluorescence lifetime and hyperspectral images using the phasor approach
|
5
|
+
Author: PhasorPy Contributors
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://www.phasorpy.org
|
8
|
+
Project-URL: Documentation, https://www.phasorpy.org/docs/stable/
|
9
|
+
Project-URL: Download, https://pypi.org/project/phasorpy/#files
|
10
|
+
Project-URL: Source code, https://github.com/phasorpy/phasorpy
|
11
|
+
Project-URL: Issue tracker, https://github.com/phasorpy/phasorpy/issues
|
12
|
+
Project-URL: Release notes, https://www.phasorpy.org/docs/stable/release
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
14
|
+
Classifier: Intended Audience :: Developers
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
17
|
+
Classifier: Programming Language :: Python
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
19
|
+
Classifier: Operating System :: OS Independent
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
26
|
+
Requires-Python: >=3.10
|
27
|
+
Description-Content-Type: text/markdown
|
28
|
+
License-File: LICENSE.txt
|
29
|
+
Requires-Dist: numpy >=1.24.0
|
30
|
+
Requires-Dist: matplotlib >=3.7.0
|
31
|
+
Requires-Dist: scipy >=1.11.0
|
32
|
+
Requires-Dist: click
|
33
|
+
Requires-Dist: pooch
|
34
|
+
Requires-Dist: tqdm
|
35
|
+
Requires-Dist: xarray >=2023.4.0
|
36
|
+
Requires-Dist: tifffile >=2024.8.30
|
37
|
+
Provides-Extra: all
|
38
|
+
Requires-Dist: lfdfiles >=2024.5.24 ; extra == 'all'
|
39
|
+
Requires-Dist: sdtfile >=2024.5.24 ; extra == 'all'
|
40
|
+
Requires-Dist: ptufile >=2024.9.14 ; extra == 'all'
|
41
|
+
Provides-Extra: docs
|
42
|
+
Requires-Dist: sphinx ; extra == 'docs'
|
43
|
+
Requires-Dist: sphinx-issues ; extra == 'docs'
|
44
|
+
Requires-Dist: sphinx-gallery ; extra == 'docs'
|
45
|
+
Requires-Dist: sphinx-copybutton ; extra == 'docs'
|
46
|
+
Requires-Dist: sphinx-click ; extra == 'docs'
|
47
|
+
Requires-Dist: pydata-sphinx-theme ; extra == 'docs'
|
48
|
+
Requires-Dist: numpydoc ; extra == 'docs'
|
49
|
+
Provides-Extra: test
|
50
|
+
Requires-Dist: pytest ; extra == 'test'
|
51
|
+
Requires-Dist: pytest-cov ; extra == 'test'
|
52
|
+
Requires-Dist: pytest-runner ; extra == 'test'
|
53
|
+
Requires-Dist: pytest-doctestplus ; extra == 'test'
|
54
|
+
Requires-Dist: coverage ; extra == 'test'
|
55
|
+
|
56
|
+
# PhasorPy
|
57
|
+
|
58
|
+
PhasorPy is an open-source Python library for the analysis of fluorescence
|
59
|
+
lifetime and hyperspectral images using the phasor approach.
|
60
|
+
|
61
|
+
- [Homepage](https://www.phasorpy.org)
|
62
|
+
- [Documentation](https://www.phasorpy.org/docs/stable/)
|
63
|
+
- [Source code](https://github.com/phasorpy/phasorpy)
|
64
|
+
- [Download releases](https://pypi.org/project/phasorpy/#files)
|
65
|
+
- [Data files](https://zenodo.org/communities/phasorpy/)
|
66
|
+
- [Issues and questions](https://github.com/phasorpy/phasorpy/issues)
|
67
|
+
|
68
|
+
PhasorPy is a community-maintained project.
|
69
|
+
[Contributions](https://www.phasorpy.org/docs/stable/contributing/)
|
70
|
+
in the form of bug reports, bug fixes, feature implementations, documentation,
|
71
|
+
datasets, and enhancement proposals are welcome.
|
72
|
+
|
73
|
+
This software project is supported in part by the
|
74
|
+
[Essential Open Source Software for Science (EOSS)](https://chanzuckerberg.com/eoss/)
|
75
|
+
program at
|
76
|
+
[Chan Zuckerberg Initiative](https://chanzuckerberg.com/).
|
77
|
+
|
78
|
+
[](https://czi.co/EOSS)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
phasorpy-0.1.dist-info/RECORD,,
|
2
|
+
phasorpy-0.1.dist-info/WHEEL,sha256=PF0Mgwtv_oDs_mWYUtLpGhYaIa8jOhCqBxSqdxy2gqE,109
|
3
|
+
phasorpy-0.1.dist-info/entry_points.txt,sha256=VRhsl3qGiIKwtMraKapmduchTMbdReUi1AoVTe9f3ss,47
|
4
|
+
phasorpy-0.1.dist-info/top_level.txt,sha256=4Y0uYzya5R2loleAxZ6s2n53_FysUbgFTfFaU0i9rbo,9
|
5
|
+
phasorpy-0.1.dist-info/LICENSE.txt,sha256=t94yqgj_PhdZMknTjvDb8jQK3_Yg_GE8Pzg5VOikVRE,1083
|
6
|
+
phasorpy-0.1.dist-info/METADATA,sha256=o-X-ohzk7SBnDtA13WrgLKDCTQnzbQcdvZPCh7UfskI,3401
|
7
|
+
phasorpy/_phasorpy.cpython-311-darwin.so,sha256=RGiLsvck5g6XRsW3ImyaNjNCrtE2PC8ffYbHat-dXmE,471436
|
8
|
+
phasorpy/conftest.py,sha256=2oXUB0Al5GG3N4I4EB7O1Ymfy61Kv7hkDYf12rcH2Ic,913
|
9
|
+
phasorpy/plot.py,sha256=JgbzBVHF9rOiDqMvtuaL8EWpf30_8MUc0UmkmBXU-sQ,67736
|
10
|
+
phasorpy/color.py,sha256=PAcxkRExdI_Ohnfg3WhxV4wZ22MnusqY6VzH4XXvJFM,16732
|
11
|
+
phasorpy/version.py,sha256=HlF1ckrSwZIV1DYoDabppm8QB-537ULjCowC_r3mWHw,1729
|
12
|
+
phasorpy/_typing.py,sha256=bEh59izC7V94Zo5Dua0_LKGhJwet_at7PFTVWlV4HpY,1247
|
13
|
+
phasorpy/_phasorpy.pyx,sha256=rnYgO6P857ZXZEGhE9oiDLD_yQKZwo3yDRcEM1CMdr0,48981
|
14
|
+
phasorpy/cursors.py,sha256=v-lJ_cTD8NtEdvs_BJgXnI7Ewb0xuBPFcJArmNQGWwQ,15044
|
15
|
+
phasorpy/io.py,sha256=w04DWnEktOTqMOpseA8LC4cFhhKdlC2nXyeb0fogHLI,52579
|
16
|
+
phasorpy/datasets.py,sha256=q4fEGPSC5dy_74Kfv_UuKqlSMl3H25DQ4rJyNZ4oTuQ,14460
|
17
|
+
phasorpy/phasor.py,sha256=xCpIl9l5maIM5iRw8gYOGmOQUnwOUe422ItHC3C5qMw,99084
|
18
|
+
phasorpy/__init__.py,sha256=EIhsWWFnJdAnohtH60ZWyaSQowdCh_N_6ZWJ4wnzjxY,244
|
19
|
+
phasorpy/cli.py,sha256=L1UmH2QR3L4F_ZknGc4xOZrDpqc0ofbYM8VHj0YDqzE,1890
|
20
|
+
phasorpy/utils.py,sha256=PMYOQA7Hk6KtOngfIuU3kXh1dO7ACKZZcf0PU1rEZMU,2046
|
21
|
+
phasorpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
+
phasorpy/components.py,sha256=hrin5zoWJUKtEms4vgAlAjbYU1Yj8mZmmJwCsQkmcOg,10102
|
23
|
+
phasorpy/__main__.py,sha256=vkjfLooAnV7rSJwF_PEIM329cJI1Oh-Y5SYjFpqmuF4,142
|
24
|
+
phasorpy/_utils.py,sha256=pKhf3sz3IUVyHwFU_5GnegvnQxQAwaMhsgD2RtQT6Ys,12122
|
@@ -0,0 +1 @@
|
|
1
|
+
phasorpy
|