Skip to content

Commit 2a435d0

Browse files
committed
Fix ruff errors
1 parent a9366e6 commit 2a435d0

File tree

3 files changed

+57
-51
lines changed

3 files changed

+57
-51
lines changed

pysatl_experiment/persistence/power/alchemy/alchemy.py

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,41 @@
1414

1515
class AlchemyPower(ModelBase):
1616
"""
17-
SQLAlchemy ORM model representing precomputed statistical power results
18-
for a specific experiment, criterion, alternative hypothesis, and
19-
Monte-Carlo simulation setup.
20-
21-
Each row contains a unique combination of:
22-
- criterion type and its parameters,
23-
- sample size,
24-
- alternative hypothesis and its parameters,
25-
- Monte-Carlo simulation count,
26-
- significance level.
27-
28-
The uniqueness of these combinations is enforced by
29-
the ``uq_power_unique`` constraint.
30-
31-
Attributes:
32-
id (int): Primary key of the record.
33-
experiment_id (int): Identifier of the experiment this power result
34-
belongs to.
35-
criterion_code (str): Code of the statistical criterion used
36-
(e.g., test type).
37-
criterion_parameters (str): JSON-encoded or serialized parameters
38-
of the criterion.
39-
sample_size (int): Sample size for which the power value was
40-
computed.
41-
alternative_code (str): Code of the alternative hypothesis used
42-
in the simulation.
43-
alternative_parameters (str): JSON-encoded or serialized parameters
44-
of the alternative hypothesis.
45-
monte_carlo_count (int): Number of Monte-Carlo simulations performed.
46-
significance_level (float): Significance level (alpha) used
47-
for the test.
48-
results_criteria (str): Serialized result of the power computation,
49-
typically containing power values or related statistics.
50-
"""
17+
SQLAlchemy ORM model representing precomputed statistical power results
18+
for a specific experiment, criterion, alternative hypothesis, and
19+
Monte-Carlo simulation setup.
20+
21+
Each row contains a unique combination of:
22+
- criterion type and its parameters,
23+
- sample size,
24+
- alternative hypothesis and its parameters,
25+
- Monte-Carlo simulation count,
26+
- significance level.
27+
28+
The uniqueness of these combinations is enforced by
29+
the ``uq_power_unique`` constraint.
30+
31+
Attributes:
32+
id (int): Primary key of the record.
33+
experiment_id (int): Identifier of the experiment this power result
34+
belongs to.
35+
criterion_code (str): Code of the statistical criterion used
36+
(e.g., test type).
37+
criterion_parameters (str): JSON-encoded or serialized parameters
38+
of the criterion.
39+
sample_size (int): Sample size for which the power value was
40+
computed.
41+
alternative_code (str): Code of the alternative hypothesis used
42+
in the simulation.
43+
alternative_parameters (str): JSON-encoded or serialized parameters
44+
of the alternative hypothesis.
45+
monte_carlo_count (int): Number of Monte-Carlo simulations performed.
46+
significance_level (float): Significance level (alpha) used
47+
for the test.
48+
results_criteria (str): Serialized result of the power computation,
49+
typically containing power values or related statistics.
50+
"""
51+
5152
__tablename__ = "power"
5253

5354
id: Mapped[int] = mapped_column(Integer, primary_key=True) # type: ignore
@@ -77,23 +78,24 @@ class AlchemyPower(ModelBase):
7778

7879
class AlchemyPowerStorage(AbstractDbStore, IPowerStorage):
7980
"""
80-
SQLAlchemy-backed storage implementation for persisting and retrieving
81-
statistical power calculation results.
82-
83-
This class manages CRUD operations for :class:`AlchemyPower` entities,
84-
providing a database-backed implementation of the ``IPowerStorage`` interface.
85-
It stores and queries power computation results based on combinations of
86-
criterion settings, sample size, alternative hypothesis parameters,
87-
Monte-Carlo configuration, and significance level.
88-
89-
The storage must be explicitly initialized by calling :meth:`init` before any
90-
database operations can be performed.
91-
92-
Attributes:
93-
session (SessionType): A SQLAlchemy session shared across all instances.
94-
_initialized (bool): Internal flag indicating whether the storage
95-
was properly initialized via :meth:`init`.
96-
"""
81+
SQLAlchemy-backed storage implementation for persisting and retrieving
82+
statistical power calculation results.
83+
84+
This class manages CRUD operations for :class:`AlchemyPower` entities,
85+
providing a database-backed implementation of the ``IPowerStorage`` interface.
86+
It stores and queries power computation results based on combinations of
87+
criterion settings, sample size, alternative hypothesis parameters,
88+
Monte-Carlo configuration, and significance level.
89+
90+
The storage must be explicitly initialized by calling :meth:`init` before any
91+
database operations can be performed.
92+
93+
Attributes:
94+
session (SessionType): A SQLAlchemy session shared across all instances.
95+
_initialized (bool): Internal flag indicating whether the storage
96+
was properly initialized via :meth:`init`.
97+
"""
98+
9799
session: ClassVar[SessionType]
98100

99101
def __init__(self, db_url: str):

pysatl_experiment/persistence/random_values/alchemy/alchemy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class AlchemyRandomValues(ModelBase):
4545
data (str): Serialized representation of the generated random values
4646
(e.g., JSON array).
4747
"""
48+
4849
__tablename__ = "random_values"
4950

5051
id: Mapped[int] = mapped_column(Integer, primary_key=True) # type: ignore
@@ -93,6 +94,7 @@ class AlchemyRandomValuesStorage(AbstractDbStore, IRandomValuesStorage):
9394
``AbstractDbStore`` class.
9495
_initialized (bool): Indicates whether the storage is ready for use.
9596
"""
97+
9698
session: ClassVar[SessionType]
9799

98100
def __init__(self, db_url: str):

pysatl_experiment/persistence/time_complexity/alchemy/alchemy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class AlchemyTimeComplexity(ModelBase):
5555
- sample_size
5656
- monte_carlo_count
5757
"""
58+
5859
__tablename__ = "time_complexity"
5960

6061
id: Mapped[int] = mapped_column(Integer, primary_key=True) # type: ignore
@@ -125,6 +126,7 @@ class AlchemyTimeComplexityStorage(AbstractDbStore, ITimeComplexityStorage):
125126
The storage transparently serializes and deserializes complex objects
126127
(criterion parameters and timing results) using JSON.
127128
"""
129+
128130
session: ClassVar[SessionType]
129131

130132
def __init__(self, db_url: str):

0 commit comments

Comments
 (0)