proadv 2.0.2__tar.gz → 2.1.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.
Files changed (56) hide show
  1. {proadv-2.0.2 → proadv-2.1.2}/PKG-INFO +27 -17
  2. {proadv-2.0.2 → proadv-2.1.2}/README.md +20 -10
  3. proadv-2.1.2/proadv/__init__.py +1 -0
  4. proadv-2.1.2/proadv/filtration/__init__.py +1 -0
  5. proadv-2.1.2/proadv/filtration/detection/__init__.py +1 -0
  6. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/acceleration.py +1 -1
  7. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/bivariatekernel.py +10 -0
  8. proadv-2.1.2/proadv/filtration/replacement/__init__.py +1 -0
  9. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/replacement/replacements.py +4 -8
  10. proadv-2.1.2/proadv/kernel/__init__.py +1 -0
  11. {proadv-2.0.2 → proadv-2.1.2}/proadv/kernel/bivariate.py +2 -2
  12. proadv-2.1.2/proadv/statistics/__init__.py +2 -0
  13. {proadv-2.0.2 → proadv-2.1.2}/proadv/statistics/descriptive.py +10 -13
  14. proadv-2.1.2/proadv/statistics/distributions/__init__.py +1 -0
  15. proadv-2.1.2/proadv/statistics/distributions/normal.py +528 -0
  16. {proadv-2.0.2 → proadv-2.1.2}/proadv/statistics/moment.py +2 -2
  17. proadv-2.1.2/proadv/statistics/optimize/__init__.py +1 -0
  18. proadv-2.1.2/proadv/statistics/optimize/optimize.py +401 -0
  19. {proadv-2.0.2 → proadv-2.1.2}/proadv/statistics/series.py +62 -7
  20. proadv-2.1.2/proadv/statistics/signal/__init__.py +1 -0
  21. proadv-2.1.2/proadv/statistics/signal/butter.py +668 -0
  22. proadv-2.1.2/proadv/statistics/signal/fluid.py +66 -0
  23. proadv-2.1.2/proadv/statistics/signal/spectrum.py +29 -0
  24. proadv-2.1.2/proadv/statistics/signal/synthetic.py +58 -0
  25. proadv-2.1.2/proadv/tests/statistics/descriptive/test_exponential_moving_average.py +12 -0
  26. proadv-2.1.2/proadv/tests/statistics/descriptive/test_moving_average.py +32 -0
  27. {proadv-2.0.2 → proadv-2.1.2}/proadv.egg-info/PKG-INFO +27 -17
  28. {proadv-2.0.2 → proadv-2.1.2}/proadv.egg-info/SOURCES.txt +10 -1
  29. {proadv-2.0.2 → proadv-2.1.2}/setup.py +7 -7
  30. proadv-2.0.2/proadv/filtration/replacement/__init__.py +0 -0
  31. proadv-2.0.2/proadv/kernel/__init__.py +0 -0
  32. proadv-2.0.2/proadv/statistics/__init__.py +0 -0
  33. proadv-2.0.2/proadv/statistics/distributions/__init__.py +0 -1
  34. proadv-2.0.2/proadv/statistics/distributions/normal.py +0 -126
  35. proadv-2.0.2/proadv/tests/__init__.py +0 -0
  36. proadv-2.0.2/proadv/tests/statistics/__init__.py +0 -0
  37. proadv-2.0.2/proadv/tests/statistics/descriptive/__init__.py +0 -0
  38. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/correlation.py +0 -0
  39. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/phasespace.py +0 -0
  40. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/poincare.py +0 -0
  41. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/pollution.py +0 -0
  42. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/spherical.py +0 -0
  43. {proadv-2.0.2 → proadv-2.1.2}/proadv/filtration/detection/trivariatekernel.py +0 -0
  44. {proadv-2.0.2 → proadv-2.1.2}/proadv/statistics/spread.py +0 -0
  45. {proadv-2.0.2/proadv → proadv-2.1.2/proadv/tests}/__init__.py +0 -0
  46. {proadv-2.0.2/proadv/filtration → proadv-2.1.2/proadv/tests/statistics}/__init__.py +0 -0
  47. {proadv-2.0.2/proadv/filtration/detection → proadv-2.1.2/proadv/tests/statistics/descriptive}/__init__.py +0 -0
  48. {proadv-2.0.2 → proadv-2.1.2}/proadv/tests/statistics/descriptive/test_max.py +0 -0
  49. {proadv-2.0.2 → proadv-2.1.2}/proadv/tests/statistics/descriptive/test_mean.py +0 -0
  50. {proadv-2.0.2 → proadv-2.1.2}/proadv/tests/statistics/descriptive/test_median.py +0 -0
  51. {proadv-2.0.2 → proadv-2.1.2}/proadv/tests/statistics/descriptive/test_min.py +0 -0
  52. {proadv-2.0.2 → proadv-2.1.2}/proadv/tests/statistics/descriptive/test_mode.py +0 -0
  53. {proadv-2.0.2 → proadv-2.1.2}/proadv.egg-info/dependency_links.txt +0 -0
  54. {proadv-2.0.2 → proadv-2.1.2}/proadv.egg-info/requires.txt +0 -0
  55. {proadv-2.0.2 → proadv-2.1.2}/proadv.egg-info/top_level.txt +0 -0
  56. {proadv-2.0.2 → proadv-2.1.2}/setup.cfg +0 -0
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: proadv
3
- Version: 2.0.2
3
+ Version: 2.1.2
4
4
  Summary: Process Acoustic Doppler Velocimeter data with advanced despiking and analysis tools
5
5
  Home-page: https://github.com/farzadasgari/proadv
6
6
  Author: Farzad Asgari
7
7
  Author-email: std_farzad.asgari@alumni.khu.ac.ir
8
- Project-URL: Bug Tracker, https://github.com/farzadasgari/proadv/issues
9
- Project-URL: Documentation, https://github.com/farzadasgari/proadv/tree/main/docs
8
+ Project-URL: Download URL, https://pypi.org/project/proadv/
10
9
  Project-URL: Source Code, https://github.com/farzadasgari/proadv
10
+ Project-URL: Documentation, https://proadv.readthedocs.io/en/latest/
11
11
  Keywords: ProADV,python,signal processing,data processing,acoustic Doppler velocimeter,ADV,Denoising,Despiking
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Science/Research
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.9
21
17
  Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
22
  Description-Content-Type: text/markdown
23
23
  Requires-Dist: numpy>=1.0
24
24
  Requires-Dist: scipy>=1.0
@@ -30,9 +30,8 @@ Requires-Dist: fastkde
30
30
  [![GitHub forks](https://img.shields.io/github/forks/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/network)
31
31
  [![GitHub issues](https://img.shields.io/github/issues/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/issues)
32
32
  [![GitHub license](https://img.shields.io/github/license/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/blob/main/LICENSE)
33
- [![PyPI version](https://badge.fury.io/py/proadv.svg)](https://badge.fury.io/py/proadv)
34
- [![conda](https://img.shields.io/conda/vn/conda-forge/proadv.svg)](https://anaconda.org/conda-forge/proadv)
35
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv)](https://pypi.org/project/proadv/)
33
+ [![PyPI version](https://img.shields.io/pypi/v/proadv.svg)](https://pypi.org/project/proadv/)
34
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv.svg)](https://pypi.org/project/proadv/)
36
35
  [![GitHub contributors](https://img.shields.io/github/contributors/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/graphs/contributors)
37
36
  [![GitHub pull requests](https://img.shields.io/github/issues-pr/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls)
38
37
  [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls?q=is%3Apr+is%3Aclosed)
@@ -60,6 +59,14 @@ Requires-Dist: fastkde
60
59
  * **LI (Linear Interpolation):** Uses linear interpolation between surrounding points to estimate the missing value.
61
60
  * **12PP (12 Points Cubic Polynomial):** Employs a 12-point cubic polynomial to fit a smoother curve and replace spikes.
62
61
 
62
+
63
+ <div>
64
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/trivariate-kernel.png" alt="trivariate-kernel" style="width:300px;"/>
65
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/spectrum.png" alt="trivariate-kernel" style="width:300px;"/>
66
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/phase-space.png" alt="trivariate-kernel" style="width:300px;"/>
67
+ </div>
68
+
69
+
63
70
  * **Statistical Analysis:** ProADV equips you with essential statistical tools to characterize your ADV data:
64
71
  * **Minimum, Maximum:** Provides the range of measured velocities.
65
72
  * **Mean, Median, Mode:** Calculates central tendency measures.
@@ -68,6 +75,7 @@ Requires-Dist: fastkde
68
75
  * **Advanced Analysis:** In addition to cleaning and basic statistics, ProADV offers advanced functionalities for deeper insights:
69
76
  * **Moving Average:** Smooths out data fluctuations for better visualization and trend analysis. Provided in simple moving average, exponential moving average, and weighted moving average methods.
70
77
  * **SSA (Singular Spectrum Analysis):** Extracts underlying patterns and trends from time series data.
78
+ * **Kalman Filter:** Implements the Kalman filter algorithm for state estimation and prediction in time series data.
71
79
  * **PR (Pollution Rate) Calculation:** Estimates the level of noise or pollution within the data.
72
80
  * **Spectral Analysis:**
73
81
  * **PSD (Power Spectral Density):** Analyzes the distribution of energy across different frequencies within the data.
@@ -75,21 +83,21 @@ Requires-Dist: fastkde
75
83
  * **Normality Test:** Evaluates whether your data follows a normal distribution.
76
84
  * **Normalization:** Scales data to a common range for further analysis or visualization.
77
85
 
86
+ <div>
87
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/singular-spectrum.png" alt="singular-spectrum" style="width:300px;"/>
88
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/kalman.png" alt="kalman-filter" style="width:300px;"/>
89
+ </div>
90
+
78
91
  ### Installation
79
92
 
80
- There are three convenient ways to install ProADV:
93
+ There are two convenient ways to install ProADV:
81
94
 
82
95
  1. **Using pip (recommended):**
83
96
  ```bash
84
97
  pip install proadv
85
98
  ```
86
99
 
87
- 2. **Using conda-forge:**
88
- ```bash
89
- conda install -c conda-forge proadv
90
- ```
91
-
92
- 3. **From source code:**
100
+ 2. **From source code:**
93
101
 
94
102
  a. Clone the repository:
95
103
  ```bash
@@ -125,6 +133,7 @@ For further information and in-depth understanding of the algorithms employed in
125
133
 
126
134
  ### Acknowledgment
127
135
  - This project was developed under the supervision of **[Dr. Seyed Hossein Mohaeri](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)** and **[Dr. Mojtaba Mehraein](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)**.
136
+ - We extend our deepest gratitude to **[Dr. Bimlesh Kumar](https://www.researchgate.net/profile/Bimlesh-Kumar)** and **[Dr. Luis Cea](https://www.researchgate.net/profile/Luis-Cea)** for their invaluable guidance and unwavering support throughout our journey.
128
137
  - Special thanks to [Parvaneh Yaghoubi](https://github.com/parvanehyaghoubi), [Hossein Abazari](https://github.com/HossA12), [Narges Yaghoubi](https://github.com/nargesyaghoubi), [Mojtaba Karimi](https://github.com/mojikarimi), and [Hiva Yarandi](https://github.com/Hivayrn) for their valuable contributions to this project.
129
138
 
130
139
 
@@ -133,6 +142,7 @@ For any inquiries, please contact:
133
142
  - std_farzad.asgari@alumni.khu.ac.ir
134
143
  - khufarzadasgari@gmail.com
135
144
 
145
+
136
146
  ### Links
137
147
 
138
148
  ##### Farzad Asgari
@@ -4,9 +4,8 @@
4
4
  [![GitHub forks](https://img.shields.io/github/forks/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/network)
5
5
  [![GitHub issues](https://img.shields.io/github/issues/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/issues)
6
6
  [![GitHub license](https://img.shields.io/github/license/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/blob/main/LICENSE)
7
- [![PyPI version](https://badge.fury.io/py/proadv.svg)](https://badge.fury.io/py/proadv)
8
- [![conda](https://img.shields.io/conda/vn/conda-forge/proadv.svg)](https://anaconda.org/conda-forge/proadv)
9
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv)](https://pypi.org/project/proadv/)
7
+ [![PyPI version](https://img.shields.io/pypi/v/proadv.svg)](https://pypi.org/project/proadv/)
8
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv.svg)](https://pypi.org/project/proadv/)
10
9
  [![GitHub contributors](https://img.shields.io/github/contributors/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/graphs/contributors)
11
10
  [![GitHub pull requests](https://img.shields.io/github/issues-pr/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls)
12
11
  [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls?q=is%3Apr+is%3Aclosed)
@@ -34,6 +33,14 @@
34
33
  * **LI (Linear Interpolation):** Uses linear interpolation between surrounding points to estimate the missing value.
35
34
  * **12PP (12 Points Cubic Polynomial):** Employs a 12-point cubic polynomial to fit a smoother curve and replace spikes.
36
35
 
36
+
37
+ <div>
38
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/trivariate-kernel.png" alt="trivariate-kernel" style="width:300px;"/>
39
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/spectrum.png" alt="trivariate-kernel" style="width:300px;"/>
40
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/phase-space.png" alt="trivariate-kernel" style="width:300px;"/>
41
+ </div>
42
+
43
+
37
44
  * **Statistical Analysis:** ProADV equips you with essential statistical tools to characterize your ADV data:
38
45
  * **Minimum, Maximum:** Provides the range of measured velocities.
39
46
  * **Mean, Median, Mode:** Calculates central tendency measures.
@@ -42,6 +49,7 @@
42
49
  * **Advanced Analysis:** In addition to cleaning and basic statistics, ProADV offers advanced functionalities for deeper insights:
43
50
  * **Moving Average:** Smooths out data fluctuations for better visualization and trend analysis. Provided in simple moving average, exponential moving average, and weighted moving average methods.
44
51
  * **SSA (Singular Spectrum Analysis):** Extracts underlying patterns and trends from time series data.
52
+ * **Kalman Filter:** Implements the Kalman filter algorithm for state estimation and prediction in time series data.
45
53
  * **PR (Pollution Rate) Calculation:** Estimates the level of noise or pollution within the data.
46
54
  * **Spectral Analysis:**
47
55
  * **PSD (Power Spectral Density):** Analyzes the distribution of energy across different frequencies within the data.
@@ -49,21 +57,21 @@
49
57
  * **Normality Test:** Evaluates whether your data follows a normal distribution.
50
58
  * **Normalization:** Scales data to a common range for further analysis or visualization.
51
59
 
60
+ <div>
61
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/singular-spectrum.png" alt="singular-spectrum" style="width:300px;"/>
62
+ <img src="https://raw.githubusercontent.com/farzadasgari/proadv/main/examples/plots/kalman.png" alt="kalman-filter" style="width:300px;"/>
63
+ </div>
64
+
52
65
  ### Installation
53
66
 
54
- There are three convenient ways to install ProADV:
67
+ There are two convenient ways to install ProADV:
55
68
 
56
69
  1. **Using pip (recommended):**
57
70
  ```bash
58
71
  pip install proadv
59
72
  ```
60
73
 
61
- 2. **Using conda-forge:**
62
- ```bash
63
- conda install -c conda-forge proadv
64
- ```
65
-
66
- 3. **From source code:**
74
+ 2. **From source code:**
67
75
 
68
76
  a. Clone the repository:
69
77
  ```bash
@@ -99,6 +107,7 @@ For further information and in-depth understanding of the algorithms employed in
99
107
 
100
108
  ### Acknowledgment
101
109
  - This project was developed under the supervision of **[Dr. Seyed Hossein Mohaeri](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)** and **[Dr. Mojtaba Mehraein](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)**.
110
+ - We extend our deepest gratitude to **[Dr. Bimlesh Kumar](https://www.researchgate.net/profile/Bimlesh-Kumar)** and **[Dr. Luis Cea](https://www.researchgate.net/profile/Luis-Cea)** for their invaluable guidance and unwavering support throughout our journey.
102
111
  - Special thanks to [Parvaneh Yaghoubi](https://github.com/parvanehyaghoubi), [Hossein Abazari](https://github.com/HossA12), [Narges Yaghoubi](https://github.com/nargesyaghoubi), [Mojtaba Karimi](https://github.com/mojikarimi), and [Hiva Yarandi](https://github.com/Hivayrn) for their valuable contributions to this project.
103
112
 
104
113
 
@@ -107,6 +116,7 @@ For any inquiries, please contact:
107
116
  - std_farzad.asgari@alumni.khu.ac.ir
108
117
  - khufarzadasgari@gmail.com
109
118
 
119
+
110
120
  ### Links
111
121
 
112
122
  ##### Farzad Asgari
@@ -0,0 +1 @@
1
+ from . import statistics, kernel, filtration
@@ -0,0 +1 @@
1
+ from . import detection, replacement
@@ -0,0 +1 @@
1
+ from . import poincare, pollution, spherical, phasespace, correlation, acceleration, bivariatekernel, trivariatekernel
@@ -6,7 +6,7 @@ def acceleration_thresholding(velocities, frequency, tag, gravity=980, k_gravity
6
6
  """
7
7
  Detects acceleration events based on velocity data.
8
8
 
9
- This function calculates acceleration events based on velocity data, considering thresholds
9
+ Calculate acceleration events based on velocity data, considering thresholds
10
10
  for acceleration magnitude and velocity deviation from mean.
11
11
 
12
12
  Parameters
@@ -51,3 +51,13 @@ def _cutoff(density_profile, velocity_profile, c1_threshold, c2_threshold, force
51
51
  upper_cutoff_velocity = velocity_profile[upper_cutoff_index]
52
52
 
53
53
  return lower_cutoff_velocity, upper_cutoff_velocity
54
+
55
+
56
+ def _derivative(data):
57
+ data_size = data.size
58
+ derivative = np.zeros(data_size)
59
+ for i in range(1, data_size - 1):
60
+ backward = data[i] - data[i - 1]
61
+ forward = data[i + 1] - data[i]
62
+ derivative[i] = forward if abs(backward) > abs(forward) else backward
63
+ return derivative
@@ -0,0 +1 @@
1
+ from . import replacements
@@ -66,22 +66,18 @@ def linear_interpolation(velocities, spike_indices, decimals=4):
66
66
 
67
67
  Parameters
68
68
  ------
69
- velocities : (array_like)
70
- An array-like object containing velocity values. It should be a one-dimensional
69
+ velocities (array_like): An array-like object containing velocity values. It should be a one-dimensional
71
70
  array of numerical data representing velocities.
72
- spike_indices : (array_like)
73
- An array-like object containing the indices of detected spike events. It should
71
+ spike_indices (array_like): An array-like object containing the indices of detected spike events. It should
74
72
  be a one-dimensional array of integers where each integer represents the index
75
73
  in 'velocities' that corresponds to a spike.
76
- decimals : int, optional
77
- The number of decimal places to round the interpolated values to. This allows
74
+ decimals (int, optional): The number of decimal places to round the interpolated values to. This allows
78
75
  the output data to be presented with a consistent level of precision. The default
79
76
  value is 4, but this can be adjusted as needed.
80
77
 
81
78
  Returns
82
79
  ------
83
- modified_data (array_like):
84
- An array containing the modified velocity data with spikes replaced by
80
+ modified_data (array_like): An array containing the modified velocity data with spikes replaced by
85
81
  interpolated values. The shape and type of the array are the same as the
86
82
  input 'velocities' array.
87
83
 
@@ -0,0 +1 @@
1
+ from . import bivariate
@@ -366,14 +366,14 @@ def bivariate_kernel(data, hx, hy, grid):
366
366
  Compute the bivariate kernel density estimation.
367
367
 
368
368
  Parameters
369
- ----------
369
+ ------
370
370
  data (array_like): Input data array.
371
371
  hx (float): Bandwidth along the x-axis.
372
372
  hy (float): Bandwidth along the y-axis.
373
373
  grid (int): Number of bins along each dimension for histogram computation.
374
374
 
375
375
  Returns
376
- -------
376
+ ------
377
377
  density_mx (array_like): Bivariate kernel density estimation.
378
378
  x_mx (array_like): Meshgrid of x values.
379
379
  y_mx (array_like): Meshgrid of y values.
@@ -0,0 +1,2 @@
1
+ from . import descriptive, spread, series, moment
2
+ from . import signal, optimize, distributions
@@ -51,16 +51,15 @@ def min(data):
51
51
  """
52
52
 
53
53
  for i in data:
54
- if isinstance(i, str): # isinstance returns True if the specified object is of the specified type, otherwise False.
54
+ if isinstance(i,
55
+ str): # isinstance returns True if the specified object is of the specified type, otherwise False
55
56
  raise TypeError("String cannot be placed as an element of an array")
56
57
  if np.isnan(data).any():
57
58
  raise ValueError("The array contains NaN values. The min function cannot be applied to arrays with NaN values.")
58
- if data.ndim != 1: # Optional check for 1D array
59
- raise ValueError("Data array must be a 1D array.")
60
- if np.size(data) == 0: # The array cannot be empty
59
+ if np.size(data) == 0: # The array cannot be empty
61
60
  raise ValueError("cannot calculate minimum with empty array")
62
-
63
- minimum = np.min(data) # Calculate the minimum
61
+
62
+ minimum = np.min(data) # Calculate the minimum
64
63
  return minimum
65
64
 
66
65
 
@@ -116,22 +115,20 @@ def max(data):
116
115
  >>> maximum
117
116
  9
118
117
  """
119
-
118
+
120
119
  for i in data:
121
- if isinstance(i, str): # isinstance returns True if the specified object is of the specified type, otherwise False.
120
+ if isinstance(i,
121
+ str): # isinstance returns True if the specified object is of the specified type, otherwise False.
122
122
  raise TypeError("String cannot be placed as an element of an array")
123
123
 
124
124
  if np.isnan(data).any():
125
125
  raise ValueError("The array contains NaN values. The max function cannot be applied to arrays with NaN values.")
126
-
127
- if data.ndim != 1: # Optional check for 1D array
128
- raise ValueError("Data array must be a 1D array.")
129
-
126
+
130
127
  if np.size(data) == 0:
131
128
  # The array cannot be empty
132
129
  raise ValueError("cannot calculate maximum with empty array")
133
130
  maximum = np.max(data) # Calculate the maximum
134
-
131
+
135
132
  return maximum
136
133
 
137
134
 
@@ -0,0 +1 @@
1
+ from . import normal