Skip to content
Open
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
2 changes: 1 addition & 1 deletion examples/episodic_stage5_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async def test_5_6_pgvector_upsert():
)

try:
with open(pgvector_path, "r", encoding="utf-8") as f:
with open(pgvector_path, encoding="utf-8") as f:
source = f.read()
except FileNotFoundError:
print(" ⚠️ PGVectorAdapter.py 文件未找到,跳过测试")
Expand Down
2 changes: 1 addition & 1 deletion m_flow/debug/trace_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def list_recent_traces(base_dir: str, limit: int = 20) -> List[Dict[str, Any]]:
def load_events(path: str) -> List[Dict[str, Any]]:
"""Load trace events."""
events = []
with open(path, "r", encoding="utf-8") as f:
with open(path, encoding="utf-8") as f:
for line in f:
try:
events.append(json.loads(line))
Expand Down
2 changes: 1 addition & 1 deletion m_flow/eval/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def save(self, path: str) -> None:
@classmethod
def load(cls, path: str) -> "EvalConfig":
"""Load configuration from file"""
with open(path, "r", encoding="utf-8") as f:
with open(path, encoding="utf-8") as f:
data = json.load(f)

return cls(
Expand Down
2 changes: 1 addition & 1 deletion m_flow/eval/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def load(self) -> List[EvalCase]:
if not os.path.exists(self.dataset_path):
raise FileNotFoundError(f"Dataset not found: {self.dataset_path}")

with open(self.dataset_path, "r", encoding="utf-8") as f:
with open(self.dataset_path, encoding="utf-8") as f:
for line_num, line in enumerate(f, 1):
line = line.strip()
if not line:
Expand Down
2 changes: 1 addition & 1 deletion m_flow/eval/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def save_markdown(self, path: str) -> None:
@classmethod
def load(cls, path: str) -> "EvalReport":
"""Load report from JSON."""
with open(path, "r", encoding="utf-8") as f:
with open(path, encoding="utf-8") as f:
data = json.load(f)

from .metrics import TypeMetrics, EvalMetricsResult
Expand Down
2 changes: 1 addition & 1 deletion m_flow/llm/prompts/read_query_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_query_prompt(
target = path.join(base, prompt_file_name)

try:
with open(target, "r", encoding="utf-8") as f:
with open(target, encoding="utf-8") as f:
return f.read()
except FileNotFoundError:
_log.error(f"Prompt not found: {target}")
Expand Down
2 changes: 1 addition & 1 deletion m_flow/shared/loaders/core/csv_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def load(

# Parse CSV and format rows
formatted_rows: list[str] = []
with open(file_path, "r", encoding=encoding, newline="") as text_handle:
with open(file_path, encoding=encoding, newline="") as text_handle:
reader = csv.DictReader(text_handle)
for row_index, row_data in enumerate(reader, start=1):
formatted_rows.append(_format_row(row_index, row_data))
Expand Down
2 changes: 1 addition & 1 deletion m_flow/shared/loaders/core/text_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def load(self, file_path: str, encoding: str = "utf-8", **kwargs):

dest_name = f"text_{meta['content_hash']}.txt"

with open(file_path, "r", encoding=encoding) as fh:
with open(file_path, encoding=encoding) as fh:
body = fh.read()

cfg = get_storage_config()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def build_connected_graph() -> None:
def load_ground_truth() -> dict[str, Any]:
"""Load expected metrics from ground truth JSON."""
gt_file = Path(__file__).parent / "ground_truth_metrics.json"
with open(gt_file, "r", encoding="utf-8") as f:
with open(gt_file, encoding="utf-8") as f:
return json.load(f)


Expand Down
Loading