Skip to content

Commit c296f1a

Browse files
authored
Fix a bunch of module comments and function visibility (#2154)
1 parent 3201f28 commit c296f1a

File tree

24 files changed

+44
-49
lines changed

24 files changed

+44
-49
lines changed

packages/graphrag-cache/graphrag_cache/json_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing 'JsonPipelineCache' model."""
4+
"""A module containing 'JsonCache' model."""
55

66
import json
77
from typing import Any

packages/graphrag/graphrag/callbacks/workflow_callbacks_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing the WorkflowCallbacks registry."""
4+
"""A module containing 'WorkflowCallbacksManager' model."""
55

66
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
77
from graphrag.index.typing.pipeline_run_result import PipelineRunResult

packages/graphrag/graphrag/index/input/csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing load method definition."""
4+
"""A module containing 'CSVFileReader' model."""
55

66
import logging
77
from io import BytesIO

packages/graphrag/graphrag/index/input/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing create_input method definition."""
4+
"""A module containing 'InputReaderFactory' model."""
55

66
import logging
77

packages/graphrag/graphrag/index/input/input_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing 'PipelineCache' model."""
4+
"""A module containing 'InputReader' model."""
55

66
from __future__ import annotations
77

packages/graphrag/graphrag/index/input/json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing load method definition."""
4+
"""A module containing 'JSONFileReader' model."""
55

66
import json
77
import logging

packages/graphrag/graphrag/index/input/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing load method definition."""
4+
"""A module containing 'TextFileReader' model."""
55

66
import logging
77
from pathlib import Path

packages/graphrag/graphrag/index/operations/chunk_text/chunk_text.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing _get_num_total, chunk, run_strategy and load_strategy methods definitions."""
4+
"""A module containing chunk_text method definitions."""
55

66
from typing import Any, cast
77

@@ -54,7 +54,7 @@ def chunk_text(
5454
strategy: sentence
5555
```
5656
"""
57-
strategy_exec = load_strategy(strategy)
57+
strategy_exec = _load_strategy(strategy)
5858

5959
num_total = _get_num_total(input, column)
6060
tick = progress_ticker(callbacks.progress, num_total)
@@ -67,7 +67,7 @@ def chunk_text(
6767
input.apply(
6868
cast(
6969
"Any",
70-
lambda x: run_strategy(
70+
lambda x: _run_strategy(
7171
strategy_exec,
7272
x[column],
7373
config,
@@ -79,7 +79,7 @@ def chunk_text(
7979
)
8080

8181

82-
def run_strategy(
82+
def _run_strategy(
8383
strategy_exec: ChunkStrategy,
8484
input: ChunkInput,
8585
config: ChunkingConfig,
@@ -111,7 +111,7 @@ def run_strategy(
111111
return results
112112

113113

114-
def load_strategy(strategy: ChunkStrategyType) -> ChunkStrategy:
114+
def _load_strategy(strategy: ChunkStrategyType) -> ChunkStrategy:
115115
"""Load strategy method definition."""
116116
match strategy:
117117
case ChunkStrategyType.tokens:

packages/graphrag/graphrag/index/operations/chunk_text/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing chunk strategies."""
4+
"""A module containing run_tokens and run_sentences methods."""
55

66
from collections.abc import Iterable
77

packages/graphrag/graphrag/index/operations/cluster_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2024 Microsoft Corporation.
22
# Licensed under the MIT License
33

4-
"""A module containing cluster_graph, apply_clustering methods definition."""
4+
"""A module containing cluster_graph method definition."""
55

66
import logging
77

0 commit comments

Comments
 (0)