Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
020e90b
build: updated ruff and mkdocs to NumPy docstring style
f1i3g3 May 13, 2026
b274063
docs: made improvements for build_and_run command
f1i3g3 May 19, 2026
6333e21
docs: improved cli module documentation
f1i3g3 May 19, 2026
6983e4c
docs: improved cli shared functionality documentation
f1i3g3 May 19, 2026
f982de2
docs: improved documentation for common cli utilities
f1i3g3 May 26, 2026
7f184ed
docs: improved documentation for configure command
f1i3g3 May 26, 2026
650d08b
docs: improved documentation for other commands
f1i3g3 May 28, 2026
cb81c0e
docs: improved documentation for configuration
f1i3g3 May 28, 2026
5f59904
docs: improved documentation & code for parallel workers
f1i3g3 May 28, 2026
062465f
chore: removed unused file
f1i3g3 May 28, 2026
40a9b7d
chore: removed unused file
f1i3g3 May 28, 2026
38ac68a
docs: improved documentation & code for experiment submodule
f1i3g3 May 28, 2026
c04d8c2
chore: updated pyproject.toml
f1i3g3 May 28, 2026
9d127ad
documentation: made improvements to persistence documentation
f1i3g3 May 31, 2026
220dd86
documentation: more improvements to persistence documentation
f1i3g3 May 31, 2026
208aab3
documentation: added documentation for common files
f1i3g3 May 31, 2026
7cef6f9
docs: made improvements to persistence documentation
f1i3g3 May 31, 2026
fdedfa9
docs: more improvements to persistence documentation
f1i3g3 May 31, 2026
f572a44
docs: added documentation for common files
f1i3g3 May 31, 2026
a37a58c
docs: improved factories documentation
f1i3g3 Jun 1, 2026
47663a3
docs: improved __main__ documentation
f1i3g3 Jun 1, 2026
d3d630d
docs: improved loggers documentation
f1i3g3 Jun 1, 2026
12bf337
fix: quick ci.yaml fix
f1i3g3 Jun 1, 2026
ef8e1df
docs: improved persistence module documentation
f1i3g3 Jun 1, 2026
2253e01
Merge branch 'documentation' of https://github.com/PySATL/pysatl-expe…
f1i3g3 Jun 1, 2026
d76b264
docs: improved report module documentation
f1i3g3 Jun 1, 2026
f2c3d78
docs: improved validation module documentation
f1i3g3 Jun 1, 2026
b787499
docs: improved worker module documentation
f1i3g3 Jun 1, 2026
23b8e8f
docs: improved tests documentation
f1i3g3 Jun 1, 2026
edf7744
chore: resolving merge conflict
f1i3g3 Jun 2, 2026
f0ed45d
fix(tests): renamed some tests files
f1i3g3 Jun 2, 2026
7edc2cd
chore: removed TODOs from pyproject.toml
f1i3g3 Jun 3, 2026
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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Install system dependencies
run: |
sudo apt-get update
Expand All @@ -45,7 +42,7 @@ jobs:
run: poetry run ruff check pysatl_experiment tests --output-format=github

- name: Check formatting with Ruff
run: poetry run ruff format pysatl_experiment tests --check
run: poetry run ruff format --check pysatl_experiment tests

- name: Run tests
run: poetry run pytest --random-order tests
Expand Down
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ repos:

- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.7.4'
rev: 'v0.11.12'
hooks:
- id: ruff
- id: ruff-format
# Documentation
- id: ruff
name: ruff-docstrings
args: [ --select, D, --fix ]
log_file: ruff-docstrings.log

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down
7 changes: 6 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ plugins:
enabled: true
- mike:
deploy_prefix: 'en'
canonical_version: 'stable'
canonical_version: 'stable'
- mkdocstrings:
handlers:
python:
options:
docstring_style: numpy
16 changes: 11 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ruff = "0.11.12"
pytest-mock = "3.14.1"
pre-commit = "4.2.0"
mypy = "^1.15.0"
mkdocstrings-python = "^2.0.3"

[tool.poetry.scripts]
experiment = "pysatl_experiment.cli.cli.cli:cli"
Expand All @@ -70,17 +71,22 @@ line-length = 120
extend-exclude = [".env", ".venv"]

[tool.ruff.lint]
extend-select = [
"C90", "B", "F", "E", "W", "UP", "I", "A", "TID", "YTT", "S", "PTH", "ASYNC", "NPY"
select = [
"C90", "B", "F", "E", "W", "UP", "I", "A", "TID", "YTT", "S", "PTH", "ASYNC", "NPY", "D",
]
extend-ignore = [
"E241", "E272", "E221", "B007", "B904", "S603", "S607", "S608", "NPY002"
ignore = [
"E241", "E272", "E221", "B007", "B904", "S603", "S607", "S608", "NPY002",
"D107", "D203", "D212", "D213", "D401", "D404",
]

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

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.mccabe]
max-complexity = 12
Expand Down
6 changes: 6 additions & 0 deletions pysatl_experiment/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
CLI entrypoint module.

Runs the command-line interface for the pysatl_experiment application.
"""

from pysatl_experiment.cli.cli.cli import cli


Expand Down
2 changes: 2 additions & 0 deletions pysatl_experiment/cli/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Registration of CLI commands."""

from pysatl_experiment.cli.commands.build_and_run.build_and_run import build_and_run
from pysatl_experiment.cli.commands.configure.configure import configure
from pysatl_experiment.cli.commands.create.create import create
Expand Down
51 changes: 40 additions & 11 deletions pysatl_experiment/cli/commands/build_and_run/build_and_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""CLI command for building and executing experiments."""

from typing import Any, cast

from click import BadParameter, argument, command

from pysatl_experiment.cli.commands.common.common import normalize_experiment_name, read_experiment_data
Expand All @@ -12,17 +16,28 @@
from pysatl_experiment.validation.cli.commands.common.common import if_experiment_exists


# TODO: refactor names!


@command()
@argument("name")
def build_and_run(name: str) -> None:
"""
Build and run an experiment with the given name.
Build and execute an experiment.

:param name: name of the experiment.
Parameters
----------
name : str
Experiment name. The ``.json`` extension is optional.

Raises
------
click.BadParameter
If the experiment does not exist.
"""
name = normalize_experiment_name(name)
experiment_exists = if_experiment_exists(name)
if not experiment_exists:

if not if_experiment_exists(name):
raise BadParameter(f"Experiment with name {name} does not exist.")

experiment_data_dict = read_experiment_data(name)
Expand All @@ -35,21 +50,35 @@ def build_and_run(name: str) -> None:

def _build_experiment(experiment_data: ExperimentData) -> ExperimentSteps:
"""
Build experiment from validated ExperimentData object.
Create experiment steps from validated configuration.

Parameters
----------
experiment_data : ExperimentData
Validated experiment configuration.

:param experiment_data: validated experiment data.
:return: experiment steps.
Returns
-------
ExperimentSteps
Experiment steps ready for execution.
"""
experiment_type_to_factory = {
ExperimentType.POWER: PowerExperimentFactory,
ExperimentType.CRITICAL_VALUE: CriticalValueExperimentFactory,
ExperimentType.TIME_COMPLEXITY: TimeComplexityExperimentFactory,
}

experiment_type_str = experiment_data.config.experiment_type.value
experiment_type = experiment_data.config.experiment_type

experiment_factory = experiment_type_to_factory[experiment_type_str]
experiment_factory = experiment_type_to_factory.get(experiment_type)

experiment_steps = experiment_factory(experiment_data).create_experiment_steps()
if experiment_factory is None:
raise BadParameter(f"Unsupported experiment type: {experiment_type}.")

return experiment_steps
validated_experiment_data = cast(
Any,
experiment_data,
)
return experiment_factory(
validated_experiment_data,
).create_experiment_steps()
Loading