Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
45dd279
Implement exponentiality tests environment and EP test
l-golofastov May 2, 2024
91933e8
Add KS test for exponentiality
l-golofastov May 4, 2024
1083ee9
Fix passing an argument
l-golofastov May 4, 2024
43007a4
Add more tests
l-golofastov May 4, 2024
4b1bd09
Make the cache shared in thread-safe mode
l-golofastov May 4, 2024
0eac2eb
Make cache work in new conditions
l-golofastov May 4, 2024
db64418
Add more exponentiality tests
l-golofastov May 4, 2024
8a16ef8
Renames and cosmetics
l-golofastov May 4, 2024
8996130
Add exponential tests powers calculation
l-golofastov May 25, 2024
3b845bc
Add time calculation service
l-golofastov May 25, 2024
c4f0327
Cosmetics
l-golofastov May 25, 2024
c3c131e
feat: update .gitignore
f1i3g3 Jul 29, 2024
3a5add4
feat: changed file structure
f1i3g3 Jul 29, 2024
ffa2305
feat: completely moved draft to this repository
f1i3g3 Jul 29, 2024
c61a5d3
feat: prepared repo for two-packages structure
f1i3g3 Jul 29, 2024
446d62c
fix: update instances
f1i3g3 Jul 29, 2024
0f6a51a
fix: time_cache updated
f1i3g3 Jul 31, 2024
fd81e4e
feat: criterion_checker removed due to project structure changes
f1i3g3 Jul 31, 2024
6dd410c
fix: update code() methods + fix warnings for normality tests
f1i3g3 Jul 31, 2024
4d5f8da
fix: improved GoF structure
f1i3g3 Jul 31, 2024
cc1aca8
fix: fix local cache.json name
f1i3g3 Jul 31, 2024
53f48d9
feat: some features:
f1i3g3 Jul 31, 2024
c1226e2
fix: added time_test.py
f1i3g3 Jul 31, 2024
eea622e
fix: removed prints
f1i3g3 Jul 31, 2024
13d17f2
fix: removed some TODOs
f1i3g3 Jul 31, 2024
af8e8ed
fix: updated usages
f1i3g3 Jul 31, 2024
42afe23
feat: pyproject.toml stub uploaded
f1i3g3 Jul 31, 2024
6a8e5c9
fix: added @override where needed
f1i3g3 Jul 31, 2024
086fd03
feat: some changes in project structure:
f1i3g3 Aug 2, 2024
df2240a
fix: quick generator fix
f1i3g3 Aug 2, 2024
7148b63
refactor: changed normality test structure
f1i3g3 Oct 22, 2024
d4554ae
fix: added abstract normality test case
f1i3g3 Oct 22, 2024
9e0a8a1
feat: added exponentiality tests stubs
f1i3g3 Nov 8, 2024
d7050e7
merge: merge branch 'architecture' into refactoring
f1i3g3 Nov 10, 2024
f2f387d
refactor: removed time_cache for redundancy
f1i3g3 Nov 16, 2024
ed6e1e5
refactor: deleted generator wrappers for redundancy
f1i3g3 Nov 16, 2024
2479154
refactor: synchronized with current architecture (added new files, mi…
f1i3g3 Nov 16, 2024
a50d5a3
refactor: synchronized with current architecture (moved extended pack…
f1i3g3 Nov 16, 2024
0ff2271
refactor: synchronized with current architecture (moved standard pack…
f1i3g3 Nov 16, 2024
e005d88
refactor: changes in statistics for current architecture (also weibul…
f1i3g3 Nov 16, 2024
4875001
refactor: changes in tests for current architecture (with weibull sup…
f1i3g3 Nov 16, 2024
eeaf3b1
refactor: added missed file
f1i3g3 Nov 16, 2024
b93d132
merge: merge pull request #2 from f1i3g3/refactoring
f1i3g3 Nov 16, 2024
29d475a
Merge branch 'refs/heads/main' into architecture
alex98247 Nov 23, 2024
36724d5
Fix merge
alex98247 Nov 23, 2024
3b4fbb1
Fix merge
alex98247 Nov 23, 2024
7bdb574
fix: typos correction
f1i3g3 Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,11 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
/data1/

# Local folders and files
execution_time/
test_distribution/
cache.json
local_tests.py
45 changes: 0 additions & 45 deletions critical_value.py

This file was deleted.

88 changes: 0 additions & 88 deletions example.py

This file was deleted.

2 changes: 1 addition & 1 deletion generators/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def code(self):
return super()._convert_to_code(['beta', self.a, self.b])

def generate(self, size):
return generate_beta(size=size, a=self.a, b=self.b)
return generate_beta(size=size, a=self.a, b=self.b)
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "stattest"
version = "0.0.1"
authors = [
{ name="Example Author", email="author@example.com" },
]
description = "Stattest Project"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/alex98247/statistic-test"
Issues = "https://github.com/alex98247/statistic-test/issues"

# TODO: fill stub from official documentation
2 changes: 1 addition & 1 deletion stattest/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Config = dict[str, Any]

USERPATH_GENERATORS = "generators"
USERPATH_HYPOTHESIS = "hypothesis"
USERPATH_HYPOTHESIS = "hypothesis"
8 changes: 4 additions & 4 deletions stattest/core/distribution/expon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from scipy.stats import expon


def generate_expon(size, l=1):
scale = 1 / l
def generate_expon(size, lam=1): # TODO: refactor structure with inheritance??
scale = 1 / lam
return expon.rvs(size=size, scale=scale)


def cdf_expon(rvs, l=1):
scale = 1 / l
def cdf_expon(rvs, lam=1):
scale = 1 / lam
return expon.cdf(rvs, scale=scale)
8 changes: 4 additions & 4 deletions stattest/core/distribution/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import numpy as np


def moment(a, moment=1, center=None):
scipy_moment(a=a, moment=moment, center=center)
def moment(a, mom=1, center=None):
scipy_moment(a=a, moment=mom, center=center)


def central_moment(a, moment=1):
return scipy_moment(a=a, moment=moment, center=np.mean(a, axis=0))
def central_moment(a, mom=1):
return scipy_moment(a=a, moment=mom, center=np.mean(a, axis=0))
3 changes: 2 additions & 1 deletion stattest/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class OperationalException(PySatlException):
Most of the time, this is caused by an invalid Configuration.
"""


class ConfigurationError(OperationalException):
"""
Configuration error. Usually caused by invalid configuration.
"""
"""
4 changes: 2 additions & 2 deletions stattest/experiment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from stattest.experiment.experiment import Experiment
from stattest.experiment.configuration.configuration import ExperimentConfiguration, ReportConfiguration, ReportBuilder, \
AlternativeConfiguration
from stattest.experiment.configuration.configuration import (ExperimentConfiguration, ReportConfiguration,
ReportBuilder, AlternativeConfiguration)
6 changes: 3 additions & 3 deletions stattest/experiment/configuration/config_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def _extend_validator(validator_class):
"""
Extended validator for the Freqtrade configuration JSON Schema.
Currently it only handles defaults for subschemas.
Currently, it only handles defaults for subschemas.
"""
validate_properties = validator_class.VALIDATORS["properties"]

Expand All @@ -29,7 +29,7 @@ def set_defaults(validator, properties, instance, schema):
FreqtradeValidator = _extend_validator(Draft4Validator)


def validate_config_schema(conf: dict[str, Any], preliminary: bool = False) -> dict[str, Any]:
def validate_config_schema(conf: dict[str, Any], preliminagiry: bool = False) -> dict[str, Any]:
"""
Validate the configuration follow the Config Schema
:param conf: Config in JSON format
Expand All @@ -47,7 +47,7 @@ def validate_config_schema(conf: dict[str, Any], preliminary: bool = False) -> d
def validate_config_consistency(conf: dict[str, Any], *, preliminary: bool = False) -> None:
"""
Validate the configuration consistency.
Should be ran after loading both configuration and strategy,
Should be run after loading both configuration and strategy,
since strategies can set certain configuration settings too.
:param conf: Config in JSON format
:return: Returns None if everything is ok, otherwise throw an ConfigurationError
Expand Down
2 changes: 1 addition & 1 deletion stattest/experiment/configuration/load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def load_from_files(
return load_config_file(filename)
file = Path(filename)
if base_path:
# Prepend basepath to allow for relative assignments
# Prepend base path to allow for relative assignments
file = base_path / file

config_tmp = load_config_file(str(file))
Expand Down
3 changes: 1 addition & 2 deletions stattest/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from stattest.experiment.test.test_step import execute_test_step



class Experiment:
def __init__(self, configuration: ExperimentConfiguration or str):
self.__configuration = configuration
Expand All @@ -25,4 +24,4 @@ def execute(self):
execute_test_step(self.__configuration.test_configuration, rvs_store)

# Generate reports
execute_report_step(self.__configuration.report_configuration)
execute_report_step(self.__configuration.report_configuration)
2 changes: 1 addition & 1 deletion stattest/experiment/generator/generator_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from multiprocessing import freeze_support, RLock

import numpy as np
from tqdm import tqdm, trange
from tqdm import tqdm

from stattest.experiment.configuration.configuration import AlternativeConfiguration
from stattest.experiment.generator import AbstractRVSGenerator
Expand Down
8 changes: 4 additions & 4 deletions stattest/experiment/report/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
from matplotlib import pyplot as plt

from stattest.experiment import ReportBuilder
from stattest.experiment.test.worker import PowerWorkerResult, BenchmarkWorkerResult
from stattest.experiment.test.worker import PowerWorkerResult
from stattest.persistence.models import IBenchmarkResultStore
from stattest.persistence.sql_lite_store.power_result_store import PowerResultSqLiteStore


"""
class ChartBenchmarkMeanReportBuilder(ReportBuilder):
def __init__(self):
self.data = {}
Expand Down Expand Up @@ -45,6 +44,7 @@ def build(self):
@staticmethod
def __build_path(result: BenchmarkWorkerResult):
return '_'.join([result.test_code, str(result.size)])
"""


class ChartPowerReportBuilder(ReportBuilder):
Expand Down Expand Up @@ -93,7 +93,7 @@ def build(self):


class PowerResultReader:
def __init__(self, power_result_store: PowerResultSqLiteStore, batch_size=100):
def __init__(self, power_result_store, batch_size=100):
self.power_result_store = power_result_store
self.batch_size = batch_size
self.offset = 0
Expand Down
2 changes: 1 addition & 1 deletion stattest/persistence/file_store/critical_value_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing_extensions import override

from stattest.persistence import ICriticalValueStore
from stattest.persistence.file_store.store import FastJsonStoreService, write_json, read_json
from stattest.persistence.file_store.store import write_json, read_json


class CriticalValueFileStore(ICriticalValueStore):
Expand Down
Loading