objscale 0.2.1__tar.gz → 0.2.2__tar.gz
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.
- {objscale-0.2.1 → objscale-0.2.2}/PKG-INFO +1 -1
- {objscale-0.2.1 → objscale-0.2.2}/objscale/__init__.py +3 -1
- {objscale-0.2.1 → objscale-0.2.2}/objscale/_utils.py +23 -1
- {objscale-0.2.1 → objscale-0.2.2}/objscale.egg-info/PKG-INFO +1 -1
- {objscale-0.2.1 → objscale-0.2.2}/pyproject.toml +1 -1
- {objscale-0.2.1 → objscale-0.2.2}/LICENSE +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/README.md +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale/_fractal_dimensions.py +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale/_object_analysis.py +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale/_size_distributions.py +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale.egg-info/SOURCES.txt +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale.egg-info/dependency_links.txt +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale.egg-info/requires.txt +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/objscale.egg-info/top_level.txt +0 -0
- {objscale-0.2.1 → objscale-0.2.2}/setup.cfg +0 -0
|
@@ -31,6 +31,7 @@ from ._object_analysis import (
|
|
|
31
31
|
from ._utils import (
|
|
32
32
|
linear_regression,
|
|
33
33
|
encase_in_value,
|
|
34
|
+
set_num_threads,
|
|
34
35
|
)
|
|
35
36
|
|
|
36
37
|
__all__ = [
|
|
@@ -56,9 +57,10 @@ __all__ = [
|
|
|
56
57
|
'clear_border_adjacent',
|
|
57
58
|
'linear_regression',
|
|
58
59
|
'encase_in_value',
|
|
60
|
+
'set_num_threads',
|
|
59
61
|
]
|
|
60
62
|
|
|
61
|
-
__version__ = "0.2.
|
|
63
|
+
__version__ = "0.2.2"
|
|
62
64
|
__author__ = "Thomas DeWitt"
|
|
63
65
|
__email__ = "thomas.dewitt@utah.edu"
|
|
64
66
|
__description__ = "Object-based analysis functions for fractal dimensions and size distributions"
|
|
@@ -3,8 +3,30 @@ from __future__ import annotations
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
from numpy.typing import NDArray
|
|
5
5
|
from warnings import warn
|
|
6
|
+
import numba
|
|
6
7
|
|
|
7
|
-
__all__ = ['linear_regression', 'encase_in_value']
|
|
8
|
+
__all__ = ['linear_regression', 'encase_in_value', 'set_num_threads']
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def set_num_threads(n: int) -> None:
|
|
12
|
+
"""
|
|
13
|
+
Set the number of threads used for parallel computations.
|
|
14
|
+
|
|
15
|
+
Controls the number of threads Numba uses for parallel operations
|
|
16
|
+
such as correlation integral calculation and structure property analysis.
|
|
17
|
+
|
|
18
|
+
Parameters
|
|
19
|
+
----------
|
|
20
|
+
n : int
|
|
21
|
+
Number of threads to use. Must be between 1 and the number of
|
|
22
|
+
logical CPU cores available.
|
|
23
|
+
|
|
24
|
+
Raises
|
|
25
|
+
------
|
|
26
|
+
ValueError
|
|
27
|
+
If n is less than 1 or greater than the available CPU count.
|
|
28
|
+
"""
|
|
29
|
+
numba.set_num_threads(n)
|
|
8
30
|
|
|
9
31
|
|
|
10
32
|
def linear_regression(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|