mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 05:45:37 +08:00
lazy: repair fallout from store-infra resolve
The resolve brought over the pydantic ToolIndex and the incremental/twin populate tests without adapting lazy-only surface: benchmarks.py still called the deleted to_dict/from_dict, and the test config stubs lacked the data-manager conf and biotools attributes the lazy populate path reads. Convert benchmarks to model_dump/model_validate and consolidate the two identical test stubs into one _populate_config helper carrying the full attribute set. Claude-Session: https://claude.ai/code/session_018L7ZmCv2ubKA3JNeSL8Pkr
This commit is contained in:
@@ -268,23 +268,23 @@ class ToolSourceBenchmarks:
|
||||
)
|
||||
|
||||
def benchmark_index_serialization(self, iterations: int = 50) -> BenchmarkResult:
|
||||
"""Benchmark index to_dict serialization."""
|
||||
"""Benchmark index serialization to JSON-ready dicts."""
|
||||
index = self._build_sample_index(1000)
|
||||
|
||||
return benchmark_function(
|
||||
"index_serialization",
|
||||
lambda: index.to_dict(),
|
||||
lambda: index.model_dump(mode="json"),
|
||||
iterations,
|
||||
)
|
||||
|
||||
def benchmark_index_deserialization(self, iterations: int = 50) -> BenchmarkResult:
|
||||
"""Benchmark index from_dict deserialization."""
|
||||
"""Benchmark index deserialization from JSON-ready dicts."""
|
||||
index = self._build_sample_index(1000)
|
||||
data = index.to_dict()
|
||||
data = index.model_dump(mode="json")
|
||||
|
||||
return benchmark_function(
|
||||
"index_deserialization",
|
||||
lambda: ToolIndex.from_dict(data),
|
||||
lambda: ToolIndex.model_validate(data),
|
||||
iterations,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user