Skip to content
Merged
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
79 changes: 34 additions & 45 deletions pyproject.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оставлю здесь заметку на потом.

Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
[project]
[tool.poetry]
name = "pysatl-experiment"
version = "0.1.0"
description = "package for PySATL math statistics experiments"
authors = [
{name = "Ivan Pokhabov", email = "vanek3372@gmail.com"},
]
license = {text = "MIT"}
authors = ["Ivan Pokhabov <vanek3372@gmail.com>"]
license = "MIT"
readme = "README.md"
requires-python = ">=3.10,<3.13"
dependencies = [
"numpy>=1.25.1",
"scipy>=1.11.2",
"matplotlib>=3.8.0",
"tqdm>=4.66.2",
"fpdf2>=2.7.8",
"jinja2>=3.1.5",
"xhtml2pdf>=0.2.17",
"pandas>=2.2.1",
"sqlalchemy>=2.0.36",
"python-rapidjson==1.20",
"jsonschema==4.23.0",
"rich==13.9.4",
"click>=8.2.1",
"dacite==1.9.2",
"pysatl-criterion @ ./pysatl_criterion"
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
package-mode = true
packages = [{include = "pysatl_experiment"}]

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
numpy = ">=1.25.1"
scipy = ">=1.11.2"
matplotlib = ">=3.8.0"
tqdm = ">=4.66.2"
fpdf2 = ">=2.7.8"
jinja2 = ">=3.1.5"
xhtml2pdf = ">=0.2.17"
pandas = ">=2.2.1"
sqlalchemy = ">=2.0.36"
python-rapidjson = "==1.20"
jsonschema = "==4.23.0"
rich = "==13.9.4"
click = ">=8.2.1"
dacite = "==1.9.2"
pysatl-criterion = {path = "./pysatl_criterion"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Там точно @ не нужна?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не нужна

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Верю :)


[tool.poetry.group.dev.dependencies]
markdown = "3.8"
mkdocs = "1.6.1"
mkdocs-material = "9.6.14"
mdx-truly-sane-lists = "1.3"
pymdown-extensions = "10.15"
jinja2 = "3.1.6"
mike = "2.1.3"
isort = "6.0.1"
coveralls = "4.0.1"
Expand All @@ -52,6 +43,13 @@ pytest-mock = "3.14.1"
pre-commit = "4.2.0"
mypy = "^1.15.0"

[tool.poetry.scripts]
experiment = "pysatl_experiment.cli.cli.cli:cli"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
line_length = 120
profile = "black"
Expand All @@ -70,25 +68,16 @@ extend-ignore = [
"E241", "E272", "E221", "B007", "B904", "S603", "S607", "S608", "NPY002"
]

[tool.mypy]
ignore_missing_imports = true
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", "S104", "S311", "S105", "S106", "S110"
]

[tool.ruff.lint.mccabe]
max-complexity = 12

[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.flake8]
ignore = ["E121", "E123", "E126", "E24", "E203", "E704", "W503", "W504"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это почему исчезло?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 линтер и ruff линтер, делают одно и тоже. В PySATL'e используют ruff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я про сами коды варнингов (например, https://www.flake8rules.com/rules/E121.html).
Имхо, стоит их добавить в соответствующий раздел для ruff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так даже не было же в зависимостях flake8, это мертвый код изначально?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хотя он есть в pre-commit'e, но я не очень понимаю как это должно работать

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ладно, пока так оставим.
При необходимости добавлю отдельным коммитом, пускай ветка остаётся (и заметка здесь).

max-line-length = 120
max-complexity = 12
exclude = [".git", "__pycache__", ".eggs", "user_data", ".venv", ".env"]

[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", "S104", "S311", "S105", "S106", "S110"
]

[tool.poetry.scripts]
experiment = "pysatl_experiment.cli.cli.cli:cli"
[tool.mypy]
ignore_missing_imports = true
5 changes: 5 additions & 0 deletions pysatl_experiment/__main__.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pysatl_experiment.cli.cli.cli import cli


if __name__ == "__main__":
cli()
24 changes: 1 addition & 23 deletions pysatl_experiment/cli/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from pathlib import Path

from click import group, version_option

from pysatl_experiment.cli.commands.build_and_run.build_and_run import build_and_run
from pysatl_experiment.cli.commands.configure.alternatives.alternatives import alternatives
from pysatl_experiment.cli.commands.configure.configure import configure
Expand All @@ -19,25 +15,7 @@
from pysatl_experiment.cli.commands.configure.significance_levels.significance_levels import significance_levels
from pysatl_experiment.cli.commands.configure.storage_connection.storage_connection import storage_connection
from pysatl_experiment.cli.commands.create.create import create


@group()
@version_option()
def cli() -> None:
"""
PySATL-Experiment CLI.
"""

_create_experiments_dir()


def _create_experiments_dir() -> None:
"""
Create experiments directory.
"""
# pysatl-experiment/.experiments
folder_path = Path(__file__).resolve().parents[3] / ".experiments"
folder_path.mkdir(parents=False, exist_ok=True)
from pysatl_experiment.cli.shared import cli


cli.add_command(create)
Expand Down
2 changes: 1 addition & 1 deletion pysatl_experiment/cli/commands/configure/configure.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from click import ClickException, Context, argument, pass_context

from pysatl_experiment.cli.cli import cli
from pysatl_experiment.cli.commands.common.common import read_experiment_data
from pysatl_experiment.cli.shared import cli
from pysatl_experiment.validation.cli.commands.common.common import if_experiment_exists


Expand Down
22 changes: 22 additions & 0 deletions pysatl_experiment/cli/shared.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pathlib import Path

from click import group, version_option


@group()
@version_option()
def cli() -> None:
"""
PySATL-Experiment CLI.
"""

_create_experiments_dir()


def _create_experiments_dir() -> None:
"""
Create experiments directory.
"""
# pysatl-experiment/.experiments
folder_path = Path(__file__).resolve().parents[2] / ".experiments"
folder_path.mkdir(parents=False, exist_ok=True)