numshooter 0.1.0__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.
- numshooter-0.1.0/PKG-INFO +14 -0
- numshooter-0.1.0/pyproject.toml +34 -0
- numshooter-0.1.0/setup.cfg +4 -0
- numshooter-0.1.0/src/numshooter/__init__.py +1 -0
- numshooter-0.1.0/src/numshooter/basic_ops/__init__.py +43 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/__init__.py +6 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/mean.py +4 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/median.py +15 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/minmax.py +6 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/mode.py +14 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/std.py +11 -0
- numshooter-0.1.0/src/numshooter/basic_ops/statistics/variance.py +9 -0
- numshooter-0.1.0/src/numshooter.egg-info/PKG-INFO +14 -0
- numshooter-0.1.0/src/numshooter.egg-info/SOURCES.txt +15 -0
- numshooter-0.1.0/src/numshooter.egg-info/dependency_links.txt +1 -0
- numshooter-0.1.0/src/numshooter.egg-info/requires.txt +3 -0
- numshooter-0.1.0/src/numshooter.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: numshooter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: numshooter is a lightweight math engine built in Python
|
|
5
|
+
Author: Eduardo Amorim Pereira
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: math,statistics,algebra,performance,engine
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: pytest; extra == "dev"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "numshooter"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "numshooter is a lightweight math engine built in Python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Eduardo Amorim Pereira" }
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
keywords = ["math", "statistics", "algebra", "performance", "engine"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Operating System :: OS Independent"
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
dependencies = []
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
dev = [
|
|
27
|
+
"pytest"
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools]
|
|
31
|
+
package-dir = {"" = "src"}
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .basic_ops import *
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from .statistics import *
|
|
2
|
+
|
|
3
|
+
def add(*numbers):
|
|
4
|
+
if not numbers:
|
|
5
|
+
return 0
|
|
6
|
+
|
|
7
|
+
result = numbers[0]
|
|
8
|
+
for n in numbers[1:]:
|
|
9
|
+
result += n
|
|
10
|
+
return result
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def sub(*numbers):
|
|
14
|
+
if not numbers:
|
|
15
|
+
return 0
|
|
16
|
+
|
|
17
|
+
result = numbers[0]
|
|
18
|
+
for n in numbers[1:]:
|
|
19
|
+
result -= n
|
|
20
|
+
return result
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def mul(*numbers):
|
|
24
|
+
if not numbers:
|
|
25
|
+
return 0
|
|
26
|
+
|
|
27
|
+
result = numbers[0]
|
|
28
|
+
for n in numbers[1:]:
|
|
29
|
+
result *= n
|
|
30
|
+
return result
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def div(*numbers):
|
|
34
|
+
if not numbers:
|
|
35
|
+
return 0
|
|
36
|
+
|
|
37
|
+
result = numbers[0]
|
|
38
|
+
for n in numbers[1:]:
|
|
39
|
+
if n == 0:
|
|
40
|
+
raise ZeroDivisionError("division by zero")
|
|
41
|
+
result /= n
|
|
42
|
+
|
|
43
|
+
return result
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
def median(*numbers):
|
|
2
|
+
if not numbers:
|
|
3
|
+
return 0
|
|
4
|
+
|
|
5
|
+
sorted_nums = sorted(numbers)
|
|
6
|
+
n = len(sorted_nums)
|
|
7
|
+
mid = n // 2
|
|
8
|
+
|
|
9
|
+
if n % 2 == 1:
|
|
10
|
+
return sorted_nums[mid]
|
|
11
|
+
else:
|
|
12
|
+
return (sorted_nums[mid - 1] + sorted_nums[mid]) / 2
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
med = median
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
def mode(*numbers):
|
|
2
|
+
if not numbers:
|
|
3
|
+
return 0
|
|
4
|
+
|
|
5
|
+
freq = {}
|
|
6
|
+
|
|
7
|
+
for n in numbers:
|
|
8
|
+
freq[n] = freq.get(n, 0) + 1
|
|
9
|
+
|
|
10
|
+
max_freq = max(freq.values())
|
|
11
|
+
|
|
12
|
+
modes = [k for k, v in freq.items() if v == max_freq]
|
|
13
|
+
|
|
14
|
+
return modes if len(modes) > 1 else modes[0]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: numshooter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: numshooter is a lightweight math engine built in Python
|
|
5
|
+
Author: Eduardo Amorim Pereira
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: math,statistics,algebra,performance,engine
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: pytest; extra == "dev"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
src/numshooter/__init__.py
|
|
3
|
+
src/numshooter.egg-info/PKG-INFO
|
|
4
|
+
src/numshooter.egg-info/SOURCES.txt
|
|
5
|
+
src/numshooter.egg-info/dependency_links.txt
|
|
6
|
+
src/numshooter.egg-info/requires.txt
|
|
7
|
+
src/numshooter.egg-info/top_level.txt
|
|
8
|
+
src/numshooter/basic_ops/__init__.py
|
|
9
|
+
src/numshooter/basic_ops/statistics/__init__.py
|
|
10
|
+
src/numshooter/basic_ops/statistics/mean.py
|
|
11
|
+
src/numshooter/basic_ops/statistics/median.py
|
|
12
|
+
src/numshooter/basic_ops/statistics/minmax.py
|
|
13
|
+
src/numshooter/basic_ops/statistics/mode.py
|
|
14
|
+
src/numshooter/basic_ops/statistics/std.py
|
|
15
|
+
src/numshooter/basic_ops/statistics/variance.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
numshooter
|