Skip to content

Add time estimation worker #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.

58 changes: 58 additions & 0 deletions config_examples/weibull_benchmark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"generator_configuration": {
"generators": [
{
"name": "ExponentialGenerator",
"params": {
"lam": 0.5
}
}
],
"sizes": [
50,
100,
500,
1000
],
"count": 10000,
"threads": 1,
"listeners": []
},
"test_configuration": {
"tests": [
{
"name": "KolmogorovSmirnovWeibullGofStatistic"
},
{
"name": "CrammerVonMisesWeibullGofStatistic"
},
{
"name": "AndersonDarlingWeibullGofStatistic"
}
],
"threads": 1,
"worker": {
"name": "BenchmarkWorker",
"params": {}
},
"listeners": []
},
"report_configuration": {
"report_builder": {
"name": "ChartBenchmarkMeanReportBuilder"
},
"listeners": []
},
"rvs_store": {
"name": "RvsDbStore",
"params": {
"db_url": "sqlite:///weibull_benchmark.sqlite"
}
},
"result_store": {
"name": "ResultDbStore",
"params": {
"db_url": "sqlite:///weibull_benchmark.sqlite"
}
}
}
79 changes: 79 additions & 0 deletions config_examples/weibull_experiment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"generator_configuration": {
"generators": [
{
"name": "ExponentialGenerator",
"params": {
"lam": 0.5
}
},
{
"name": "LaplaceRVSGenerator",
"params": {
"t": 0,
"s": 1
}
}
],
"sizes": [
50,
100,
200,
1000
],
"count": 1000,
"threads": 1,
"listeners": [
{
"name": "TimeEstimationListener"
}
]
},
"test_configuration": {
"tests": [
{
"name": "KolmogorovSmirnovWeibullGofStatistic"
}
],
"threads": 1,
"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"
}
}
}
Loading