Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cba8b78
build: added .dockerignore
f1i3g3 Feb 20, 2025
cb84336
build: added Dockerfile
f1i3g3 Feb 20, 2025
f5e966f
build: added .dockerignore
f1i3g3 Feb 20, 2025
49a1419
build: added Dockerfile
f1i3g3 Feb 20, 2025
b28a4f2
build: added weibull experiment json configuration
f1i3g3 Feb 26, 2025
2fa4b1a
structure: merge branch 'deploy' of https://github.com/PySATL/pysatl-…
f1i3g3 Feb 26, 2025
f8c9059
fix: quick json fix
f1i3g3 Feb 26, 2025
7d3284f
fix: added report listeners in json
f1i3g3 Feb 26, 2025
f242d9b
feature: added first version of configuration parser
f1i3g3 Feb 26, 2025
1a9c888
fix: some quick linter fixes
f1i3g3 Feb 26, 2025
f8d2acd
fix: updated Dockerfile
f1i3g3 Feb 27, 2025
45dbc15
deploy: add one more TODO
f1i3g3 Feb 27, 2025
3160290
Add tests for resolvers
alex98247 Feb 28, 2025
3f0cb3f
Add tests for resolvers
alex98247 Feb 28, 2025
f9fcef2
feature: configuration parser refactored
f1i3g3 Feb 28, 2025
d69208c
structure: merge branch 'deploy' of https://github.com/PySATL/pysatl-…
f1i3g3 Feb 28, 2025
9b104ce
feature: added improved version of json config parser (with updated c…
f1i3g3 Mar 6, 2025
ee1de56
test: added unit tests for json config parser
f1i3g3 Mar 6, 2025
705d488
fix: renamed tests
f1i3g3 Mar 6, 2025
87bc9a0
fix: small changes
f1i3g3 Mar 6, 2025
3e78b25
fix: added default_threads
f1i3g3 Mar 6, 2025
9a22b56
fix: improved parer structure
f1i3g3 Mar 6, 2025
72522e2
fix: renamed config
f1i3g3 Mar 6, 2025
5d94c94
fix: small change in threads
f1i3g3 Mar 6, 2025
24643cf
fix: change entry point in Dockerfile
f1i3g3 Mar 6, 2025
51db537
build: added .dockerignore
f1i3g3 Feb 20, 2025
6186a62
build: added Dockerfile
f1i3g3 Feb 20, 2025
77218e0
build: added weibull experiment json configuration
f1i3g3 Feb 26, 2025
f202996
fix: quick json fix
f1i3g3 Feb 26, 2025
960496a
fix: added report listeners in json
f1i3g3 Feb 26, 2025
dfda79a
feature: added first version of configuration parser
f1i3g3 Feb 26, 2025
0b6765f
fix: some quick linter fixes
f1i3g3 Feb 26, 2025
4142530
fix: updated Dockerfile
f1i3g3 Feb 27, 2025
14a2e12
deploy: add one more TODO
f1i3g3 Feb 27, 2025
b22dc1c
Add tests for resolvers
alex98247 Feb 28, 2025
00b0574
feature: configuration parser refactored
f1i3g3 Feb 28, 2025
629a5da
feature: added improved version of json config parser (with updated c…
f1i3g3 Mar 6, 2025
6899ca3
test: added unit tests for json config parser
f1i3g3 Mar 6, 2025
23456d9
fix: renamed tests
f1i3g3 Mar 6, 2025
649d703
fix: small changes
f1i3g3 Mar 6, 2025
a5f756f
fix: added default_threads
f1i3g3 Mar 6, 2025
3591713
fix: improved parer structure
f1i3g3 Mar 6, 2025
ad0c84f
fix: renamed config
f1i3g3 Mar 6, 2025
31132c0
fix: small change in threads
f1i3g3 Mar 6, 2025
ba04189
fix: change entry point in Dockerfile
f1i3g3 Mar 6, 2025
4322f9b
structure: merge branch 'deploy' of https://github.com/PySATL/pysatl-…
f1i3g3 Mar 9, 2025
d70ee12
fix: small fixes
f1i3g3 Mar 10, 2025
46dc252
Fix ruff
alex98247 Mar 12, 2025
29f0f96
Fix ruff
alex98247 Mar 12, 2025
023e79c
Fix load config
alex98247 Mar 12, 2025
7840398
Fix load Docker
alex98247 Mar 12, 2025
75078a9
fix: small fix to updated Dockerfile
f1i3g3 Mar 12, 2025
80c3419
fix: small fixes
f1i3g3 Mar 12, 2025
8afc685
structure: moved experiments to appropriate folder
f1i3g3 Mar 16, 2025
0c98c0e
structure: minor changes
f1i3g3 Mar 18, 2025
b92199f
test: updated config example
f1i3g3 Mar 18, 2025
5621e91
fix: added missing file
f1i3g3 Mar 18, 2025
a7e3a44
structure: synchronize with main
f1i3g3 Mar 18, 2025
9201714
fix: quick ruff fix
f1i3g3 Mar 18, 2025
c216e2c
fix: quick renaming
f1i3g3 Mar 18, 2025
66b2765
fix: fixes & renaming
f1i3g3 Mar 18, 2025
d135ceb
fix: resolver fixes
f1i3g3 Mar 18, 2025
fb5bb1f
fix: removed TODOs
f1i3g3 Mar 18, 2025
d7e3a88
fix: removed TODOs
f1i3g3 Mar 18, 2025
7766e1e
fix: ConfigurationParser fix
f1i3g3 Mar 18, 2025
b11e514
fix: formatting
f1i3g3 Mar 18, 2025
62066d4
fix: some improvements
f1i3g3 Mar 18, 2025
289c7ef
fix: ruff formating
f1i3g3 Mar 18, 2025
9141e7b
fix: quick fix
f1i3g3 Mar 18, 2025
a24ec9b
fix: quick fix to resolvers
f1i3g3 Mar 18, 2025
e823f21
test: added configuration parser test
f1i3g3 Mar 18, 2025
7b17ec5
structure: resolving merge conflict
f1i3g3 Mar 27, 2025
ec45e5a
structure: added missing files
f1i3g3 Mar 27, 2025
a22b19d
fix: ruff formatting
f1i3g3 Mar 27, 2025
e9d1643
fix: quick fix
f1i3g3 Mar 27, 2025
6e3a5d4
fix: updated files to external criterion package
f1i3g3 Mar 27, 2025
f1e9e6c
fix: ruff formating
f1i3g3 Mar 27, 2025
a9d2bd3
fix: trying to make docker work
f1i3g3 Mar 29, 2025
a34dd11
feat: added Parsable interface
f1i3g3 Mar 30, 2025
0a07236
style: removed TODO
f1i3g3 Mar 30, 2025
b2ecc57
fix: small fix of statistic name in configuration example
f1i3g3 Mar 30, 2025
c72e8fc
fix: Parsable fix
f1i3g3 Mar 30, 2025
1b17681
format: ruff formatting
f1i3g3 Mar 30, 2025
9188961
fix: minor config fix
f1i3g3 Mar 30, 2025
ee0345a
test: revert to old version
f1i3g3 Mar 30, 2025
9282828
fix: made exceptions more informative
f1i3g3 Mar 30, 2025
38beb94
fix: path fix
f1i3g3 Mar 30, 2025
b84165c
fix: another path fix
f1i3g3 Mar 30, 2025
152ffce
fix: changes in config
f1i3g3 Mar 30, 2025
8b58bc8
fix: Dockerfile correction
f1i3g3 Apr 1, 2025
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
88 changes: 88 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Git
.git
.gitignore
.gitattributes

# CI
.codeclimate.yml
.travis.yml
.taskcluster.yml

# Docker
docker-compose.yml
Dockerfile
.docker
.dockerignore

# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
**/.ropeproject

# Vim swap files
**/*.swp

# VS Code
.vscode/
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.12.9-slim-bookworm AS base

WORKDIR /app

ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONFAULTHANDLER=1
ENV PATH=/home/pysatluser/.local/bin:$PATH
ENV POETRY_HOME=/opt/poetry

RUN apt-get update && apt-get install -y curl && \
curl -sSL https://install.python-poetry.org | python - && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create true

# Копируем файлы зависимостей
COPY pyproject.toml ./

# Устанавливаем зависимости
RUN poetry install --no-interaction --no-ansi

# Копируем остальные файлы
COPY . .

ENTRYPOINT ["poetry", "run", "python", "-m", "stattest.main"]
# Default to experiment mode
CMD [ "experiment", "--config", "../../config_examples/config_example.json" ]
76 changes: 76 additions & 0 deletions config_examples/config_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"generator_configuration": {
"generators": [
{
"name": "ExponentialGenerator",
"params": {
"lam": 0.5
}
}
],
"sizes": [100, 200],
"count": 1000,
"threads": 1,
"skip_if_exists": true,
"clear_before": false,
"skip_step": false,
"show_progress": false,
"listeners": [
{
"name": "TimeEstimationListener"
}
]
},
"test_configuration": {
"tests": [
{
"name": "KolmogorovSmirnovWeibullGofStatistic"
}
],
"threads": 8,
"worker":
{
"name": "PowerCalculationWorker",
"params": {
"alpha": 0.05,
"monte_carlo_count": 100000,
"cv_store": {
"name": "CriticalValueDbStore",
"params": {
"db_url": "sqlite:///weibull_experiment.sqlite"
}
},
"hypothesis": {
"name": "WeibullHypothesis"
}
}
},
"listeners": [
{
"name": "TimeEstimationListener"
}
]
},
"report_configuration": {
"report_builder": {
"name": "PdfPowerReportBuilder"
},
"listeners": []
},
"rvs_store":
{
"name": "RvsDbStore",
"params":
{
"db_url": "sqlite:///weibull_experiment.sqlite"
}
},
"result_store":
{
"name": "ResultDbStore",
"params":
{
"db_url": "sqlite:///weibull_experiment.sqlite"
}
}
}
45 changes: 0 additions & 45 deletions config_examples/config_example_full.json

This file was deleted.

72 changes: 72 additions & 0 deletions config_examples/weibull_experiment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"generator_configuration": {
"generators": [
{
"name": "ExponentialGenerator",
"params": {
"lam": 0.5
}
}
],
"sizes": [100, 200],
"count": 1000,
"threads": 1,
"listeners": [
{
"name": "TimeEstimationListener"
}
]
},
"test_configuration": {
"tests": [
{
"name": "KSWeibullTest"
}
],
"threads": 8,
"worker":
{
"name": "PowerCalculationWorker",
"params": {
"alpha": 0.05,
"monte_carlo_count": 100000,
"cv_store": {
"name": "CriticalValueDbStore",
"params": {
"db_url": "sqlite:///weibull_experiment.sqlite"
}
},
"hypothesis": {
"name": "WeibullHypothesis"
}
}
},
"listeners": [
{
"name": "TimeEstimationListener"
}
]
},
"report_configuration": {
"report_builder": {
"name": "PdfPowerReportBuilder"
},
"listeners": []
},
"rvs_store":
{
"name": "RvsDbStore",
"params":
{
"db_url": "sqlite:///weibull_experiment.sqlite"
}
},
"result_store":
{
"name": "ResultDbStore",
"params":
{
"db_url": "sqlite:///weibull_experiment.sqlite"
}
}
}
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
services:
stattest:
build:
context: .
# dockerfile: "./docker/Dockerfile.custom"
restart: unless-stopped
container_name: pysatl-experiment
volumes:
- "./user_data:/stattest/user_data"
# Default command used when running `docker compose up`
command: >
experiment
--logfile /stattest/user_data/logs/pysatl_experiment.log
--config /stattest/user_data/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from stattest.experiment import Experiment
from stattest.experiment.configuration.configuration import (
AlternativeConfiguration,
ExperimentConfiguration,
GeneratorConfiguration,
ReportConfiguration,
TestConfiguration,
)
Expand All @@ -23,7 +23,7 @@
)
from stattest.experiment.hypothesis import NormalHypothesis
from stattest.experiment.listener.listeners import TimeEstimationListener
from stattest.experiment.report.model import PdfPowerReportBuilder
from stattest.experiment.report.builders import PdfPowerReportBuilder
from stattest.experiment.test.worker import PowerCalculationWorker
from stattest.persistence.db_store import CriticalValueDbStore, ResultDbStore, RvsDbStore

Expand Down Expand Up @@ -67,7 +67,7 @@
KolmogorovSmirnovNormalityGofStatistic(),
]

alternatives_configuration = AlternativeConfiguration(
alternatives_configuration = GeneratorConfiguration(
alternatives, sizes, count=1_000, threads=generation_threads, listeners=listeners
)

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions generators/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from stattest.experiment.generator import AbstractRVSGenerator


class BBBRVSGenerator(AbstractRVSGenerator):
def __init__(self, a, b, **kwargs):
class GeneratorTest(AbstractRVSGenerator):
def __init__(self, a=1, b=2, **kwargs):
super().__init__(**kwargs)
self.a = a
self.b = b

def code(self):
return super()._convert_to_code(["beta", self.a, self.b])
return super()._convert_to_code(["generator_test", self.a, self.b])

def generate(self, size):
return generate_beta(size=size, a=self.a, b=self.b)
Loading