Skip to content

Commit b93d132

Browse files
authored
merge: merge pull request #2 from f1i3g3/refactoring
Exponentially + refactoring of architecture
2 parents dc78a64 + eeaf3b1 commit b93d132

File tree

107 files changed

+2571
-1037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2571
-1037
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,11 @@ cython_debug/
157157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
160+
.idea/
161161
/data1/
162+
163+
# Local folders and files
164+
execution_time/
165+
test_distribution/
166+
cache.json
167+
local_tests.py

example.py

Lines changed: 0 additions & 88 deletions
This file was deleted.

generators/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def code(self):
1212
return super()._convert_to_code(['beta', self.a, self.b])
1313

1414
def generate(self, size):
15-
return generate_beta(size=size, a=self.a, b=self.b)
15+
return generate_beta(size=size, a=self.a, b=self.b)

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[project]
2+
name = "stattest"
3+
version = "0.0.1"
4+
authors = [
5+
{ name="Example Author", email="author@example.com" },
6+
]
7+
description = "Stattest Project"
8+
readme = "README.md"
9+
requires-python = ">=3.8"
10+
classifiers = [
11+
"Programming Language :: Python :: 3",
12+
"License :: OSI Approved :: MIT License",
13+
"Operating System :: OS Independent",
14+
]
15+
16+
[project.urls]
17+
Homepage = "https://github.com/alex98247/statistic-test"
18+
Issues = "https://github.com/alex98247/statistic-test/issues"
19+
20+
# TODO: fill stub from official documentation

stattest/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Config = dict[str, Any]
44

55
USERPATH_GENERATORS = "generators"
6-
USERPATH_HYPOTHESIS = "hypothesis"
6+
USERPATH_HYPOTHESIS = "hypothesis"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from scipy.stats import expon
22

33

4-
def generate_expon(size, l=1):
5-
scale = 1 / l
4+
def generate_expon(size, lam=1): # refactor structure with inheritance
5+
scale = 1 / lam
66
return expon.rvs(size=size, scale=scale)
77

88

9-
def cdf_expon(rvs, l=1):
10-
scale = 1 / l
9+
def cdf_expon(rvs, lam=1):
10+
scale = 1 / lam
1111
return expon.cdf(rvs, scale=scale)

stattest/core/distribution/sample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import numpy as np
33

44

5-
def moment(a, moment=1, center=None):
6-
scipy_moment(a=a, moment=moment, center=center)
5+
def moment(a, mom=1, center=None):
6+
scipy_moment(a=a, moment=mom, center=center)
77

88

9-
def central_moment(a, moment=1):
10-
return scipy_moment(a=a, moment=moment, center=np.mean(a, axis=0))
9+
def central_moment(a, mom=1):
10+
return scipy_moment(a=a, moment=mom, center=np.mean(a, axis=0))

stattest/core/store.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ def get(self, key: str):
1818
"""
1919
Get cached value if exists, else return None.
2020
21-
:param key: cache key
21+
:param key: cache_services key
2222
"""
2323
raise NotImplementedError("Method is not implemented")
2424

2525
def put(self, key: str, value):
2626
"""
27-
Put object to cache.
27+
Put object to cache_services.
2828
29-
:param key: cache key
30-
:param value: cache value
29+
:param key: cache_services key
30+
:param value: cache_services value
3131
"""
3232
raise NotImplementedError("Method is not implemented")
3333

@@ -44,7 +44,7 @@ def get(self, key: str):
4444
"""
4545
Get cached value if exists, else return None.
4646
47-
:param key: cache key
47+
:param key: cache_services key
4848
"""
4949

5050
if key not in self.cache.keys():
@@ -64,10 +64,10 @@ def get_with_level(self, keys: [str]):
6464

6565
def put(self, key: str, value):
6666
"""
67-
Put object to cache.
67+
Put object to cache_services.
6868
69-
:param key: cache key
70-
:param value: cache value
69+
:param key: cache_services key
70+
:param value: cache_services value
7171
"""
7272

7373
self.cache[key] = value
@@ -90,7 +90,7 @@ def _create_key(self, keys: [str]):
9090
class JsonStoreService(InMemoryStoreService):
9191

9292
def __init__(self, filename='cache.json', separator='.'):
93-
super().__init__(separator)
93+
super().__init__(separator=separator)
9494
mem_cache = {}
9595
if os.path.isfile(filename):
9696
mem_cache = read_json(filename)
@@ -100,10 +100,10 @@ def __init__(self, filename='cache.json', separator='.'):
100100

101101
def put(self, key: str, value):
102102
"""
103-
Put object to cache.
103+
Put object to cache_services.
104104
105-
:param key: cache key
106-
:param value: cache value
105+
:param key: cache_services key
106+
:param value: cache_services value
107107
"""
108108
super().put(key, value)
109109
write_json(self.filename, self.cache)
@@ -132,7 +132,7 @@ def flush(self):
132132
class FastJsonStoreService(FastStoreService):
133133

134134
def __init__(self, filename='cache.json', separator='.'):
135-
super().__init__(separator)
135+
super().__init__(separator=separator)
136136
mem_cache = {}
137137
if os.path.isfile(filename):
138138
mem_cache = read_json(filename)

stattest/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ class OperationalException(PySatlException):
1111
Most of the time, this is caused by an invalid Configuration.
1212
"""
1313

14+
1415
class ConfigurationError(OperationalException):
1516
"""
1617
Configuration error. Usually caused by invalid configuration.
17-
"""
18+
"""

stattest/execution/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)