Skip to content

Commit

Permalink
refactor: Make document chunking pep8 compliant (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurarpit authored May 9, 2024
1 parent e5bf20d commit 17ea0fb
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List
from abc import ABC, abstractmethod
from ..common.SourceDocument import SourceDocument
from .ChunkingStrategy import ChunkingSettings
from .chunking_strategy import ChunkingSettings


class DocumentChunkingBase(ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from .DocumentChunkingBase import DocumentChunkingBase
from .document_chunking_base import DocumentChunkingBase
from langchain.text_splitter import TokenTextSplitter
from .ChunkingStrategy import ChunkingSettings
from .chunking_strategy import ChunkingSettings
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from .DocumentChunkingBase import DocumentChunkingBase
from .document_chunking_base import DocumentChunkingBase
from langchain.text_splitter import MarkdownTextSplitter
from .ChunkingStrategy import ChunkingSettings
from .chunking_strategy import ChunkingSettings
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from .DocumentChunkingBase import DocumentChunkingBase
from .document_chunking_base import DocumentChunkingBase
from langchain.text_splitter import MarkdownTextSplitter
from .ChunkingStrategy import ChunkingSettings
from .chunking_strategy import ChunkingSettings
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List
from .DocumentChunkingBase import DocumentChunkingBase
from .ChunkingStrategy import ChunkingSettings
from .document_chunking_base import DocumentChunkingBase
from .chunking_strategy import ChunkingSettings
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .ChunkingStrategy import ChunkingStrategy
from .Layout import LayoutDocumentChunking
from .Page import PageDocumentChunking
from .FixedSizeOverlap import FixedSizeOverlapDocumentChunking
from .Paragraph import ParagraphDocumentChunking
from .chunking_strategy import ChunkingStrategy
from .layout import LayoutDocumentChunking
from .page import PageDocumentChunking
from .fixed_size_overlap import FixedSizeOverlapDocumentChunking
from .paragraph import ParagraphDocumentChunking


def get_document_chunker(chunking_strategy: str):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List
from langchain.docstore.document import Document

from ..document_chunking.ChunkingStrategy import ChunkingSettings, ChunkingStrategy
from ..document_chunking.Strategies import get_document_chunker
from ..document_chunking.chunking_strategy import ChunkingSettings, ChunkingStrategy
from ..document_chunking.strategies import get_document_chunker

__all__ = ["ChunkingStrategy"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from string import Template

from ..AzureBlobStorageClient import AzureBlobStorageClient
from ...document_chunking.ChunkingStrategy import ChunkingStrategy, ChunkingSettings
from ...document_chunking.chunking_strategy import ChunkingStrategy, ChunkingSettings
from ...document_loading import LoadingSettings, LoadingStrategy
from .EmbeddingConfig import EmbeddingConfig
from ...orchestrator.OrchestrationStrategy import OrchestrationStrategy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from backend.batch.utilities.helpers.embedders.IntegratedVectorizationEmbedder import (
IntegratedVectorizationEmbedder,
)
from backend.batch.utilities.document_chunking.ChunkingStrategy import ChunkingSettings
from backend.batch.utilities.document_chunking.chunking_strategy import ChunkingSettings
from backend.batch.utilities.document_loading import LoadingSettings
from backend.batch.utilities.document_loading.Strategies import LoadingStrategy

Expand Down
2 changes: 1 addition & 1 deletion code/tests/utilities/helpers/test_ConfigHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from unittest.mock import patch, MagicMock
from backend.batch.utilities.helpers.config.ConfigHelper import ConfigHelper, Config
from backend.batch.utilities.helpers.config.EmbeddingConfig import EmbeddingConfig
from backend.batch.utilities.document_chunking.ChunkingStrategy import ChunkingSettings
from backend.batch.utilities.document_chunking.chunking_strategy import ChunkingSettings
from backend.batch.utilities.document_loading import LoadingSettings


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from backend.batch.utilities.common.SourceDocument import SourceDocument
from backend.batch.utilities.helpers.DocumentChunkingHelper import DocumentChunking
from backend.batch.utilities.document_chunking.ChunkingStrategy import (
from backend.batch.utilities.document_chunking.chunking_strategy import (
ChunkingStrategy,
ChunkingSettings,
)
Expand Down
2 changes: 1 addition & 1 deletion code/tests/utilities/helpers/test_PushEmbedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from unittest.mock import MagicMock, call, patch
from backend.batch.utilities.helpers.embedders.PushEmbedder import PushEmbedder
from backend.batch.utilities.document_chunking.ChunkingStrategy import ChunkingSettings
from backend.batch.utilities.document_chunking.chunking_strategy import ChunkingSettings
from backend.batch.utilities.document_loading import LoadingSettings
from backend.batch.utilities.document_loading.Strategies import LoadingStrategy
from backend.batch.utilities.common.SourceDocument import SourceDocument
Expand Down

0 comments on commit 17ea0fb

Please sign in to comment.