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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: objscale
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Object-based analysis functions for fractal dimensions and size distributions
5
5
  Author-email: Thomas DeWitt <thomas.dewitt@utah.edu>
6
6
  License: MIT
@@ -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.1"
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(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: objscale
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Object-based analysis functions for fractal dimensions and size distributions
5
5
  Author-email: Thomas DeWitt <thomas.dewitt@utah.edu>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "objscale"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "Object-based analysis functions for fractal dimensions and size distributions"
9
9
  readme = "README.md"
10
10
  authors = [
File without changes
File without changes
File without changes