Skip to content

Commit 2f033f0

Browse files
author
Dmytro Parfeniuk
committed
Code quality and tests
1 parent 2aa7ffa commit 2f033f0

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ ignore = [
127127
"TCH002",
128128
"PLW1514", # allow Path.open without encoding
129129
"RET505", # allow `else` blocks
130-
"RET506" # allow `else` blocks
130+
"RET506", # allow `else` blocks
131+
"C901" # allow small if/else complexity
131132

132133
]
133134
select = [

src/guidellm/executor/profile_generator.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ def profile_generation_modes(self) -> List[ProfileGenerationMode]:
162162
if self._mode in ["constant", "poisson"]:
163163
return [self._mode] * len(self._rates)
164164

165-
# WIP
166-
# if self._mode in ["concurrent"]:
167-
# if self._rates is None:
168-
# raise ValueError("rate ")
169-
170-
# return [self._mode] * int(self._rates[0])
171-
172165
raise ValueError(f"Invalid mode: {self._mode}")
173166

174167
def next(self, current_report: TextGenerationBenchmarkReport) -> Optional[Profile]:

src/guidellm/scheduler/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ def _completed(_task: asyncio.Task) -> None:
316316
if self.mode == "consistent":
317317
if self.rate is None:
318318
raise ValueError(
319-
"The rate must be specified in order to provide concurrent execution"
319+
"The `rate` must be specified in order to provide "
320+
"the concurrent execution"
320321
)
321322
for index, request in enumerate(self.generator):
322323
while (index + 1 - completed) >= settings.max_concurrency:

tests/unit/scheduler/test_load_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ def test_load_generator_mode():
1414
"constant",
1515
"poisson",
1616
"throughput",
17+
"consistent",
1718
}
1819

1920

2021
@pytest.mark.smoke()
2122
@pytest.mark.parametrize(
2223
("mode", "rate"),
2324
[
25+
("synchronous", None),
2426
("constant", 10),
2527
("poisson", 5),
2628
("throughput", None),
27-
("synchronous", None),
29+
("consistent", 2),
2830
],
2931
)
3032
def test_load_generator_instantiation(mode, rate):

0 commit comments

Comments
 (0)