Move folders

This commit is contained in:
Andras Schmelczer 2022-07-04 18:54:32 +02:00
parent ba2e252759
commit 3cf28379e8
89 changed files with 47 additions and 31 deletions

View file

@ -14,7 +14,7 @@ from uvicorn.supervisors.basereload import BaseReload
from watchdog.events import FileSystemEvent, PatternMatchingEventHandler
from watchdog.observers import Observer
from utilities import get_logger
from great_ai.utilities import get_logger
from .great_ai.constants import SERVER_NAME
from .great_ai.context import _is_in_production_mode

View file

@ -1,4 +1,4 @@
from large_file import LargeFileMongo, LargeFileS3
from great_ai.large_file import LargeFileMongo, LargeFileS3
from .persistence.mongodb_driver import MongodbDriver

View file

@ -6,8 +6,8 @@ from typing import Any, Dict, Optional, Type, cast
from pydantic import BaseModel
from large_file import LargeFileBase, LargeFileLocal
from utilities import get_logger
from great_ai.large_file import LargeFileBase, LargeFileLocal
from great_ai.utilities import get_logger
from .constants import (
DEFAULT_LARGE_FILE_CONFIG_PATHS,

View file

@ -16,7 +16,7 @@ from typing import (
from fastapi import APIRouter, FastAPI, status
from pydantic import BaseModel, create_model
from utilities import parallel_map
from great_ai.utilities import parallel_map
from ..constants import DASHBOARD_PATH
from ..context import get_context

View file

@ -8,7 +8,7 @@ from dash import Dash, dcc, html
from dash.dependencies import Input, Output
from flask import Flask
from utilities import unique
from great_ai.utilities import unique
from ....constants import DASHBOARD_PATH, ONLINE_TAG_NAME
from ....context import get_context

View file

@ -4,8 +4,13 @@ from argparse import Namespace
from pathlib import Path
from typing import Mapping, Type
from large_file import LargeFileBase, LargeFileLocal, LargeFileMongo, LargeFileS3
from utilities import get_logger
from great_ai.large_file import (
LargeFileBase,
LargeFileLocal,
LargeFileMongo,
LargeFileS3,
)
from great_ai.utilities import get_logger
from .parse_arguments import parse_arguments

View file

@ -7,7 +7,7 @@ from pathlib import Path
from types import TracebackType
from typing import IO, Any, List, Optional, Type, Union, cast
from utilities import ConfigFile, get_logger
from great_ai.utilities import ConfigFile, get_logger
from ..helper import human_readable_to_byte
from ..models import DataInstance

View file

@ -1,7 +1,7 @@
from pathlib import Path
from typing import Any, List, Optional
from utilities import get_logger
from great_ai.utilities import get_logger
from ..models import DataInstance
from .large_file_base import LargeFileBase

View file

@ -6,7 +6,7 @@ from typing import Any, List, Mapping
from gridfs import DEFAULT_CHUNK_SIZE, Database, GridFSBucket
from pymongo import MongoClient
from utilities import get_logger
from great_ai.utilities import get_logger
from ..helper import DownloadProgressBar, UploadProgressBar
from ..models import DataInstance

View file

@ -4,7 +4,7 @@ from typing import Any, List, Mapping, Optional
import boto3
from utilities import get_logger
from great_ai.utilities import get_logger
from ..helper import DownloadProgressBar, UploadProgressBar
from ..models import DataInstance

View file

@ -3,7 +3,7 @@ from datetime import datetime
from pathlib import Path
from typing import List, Optional, Sequence, Tuple, Union
from utilities import ConfigFile
from great_ai.utilities import ConfigFile
from ..views import Filter, SortBy, Trace

View file

@ -3,7 +3,7 @@ from typing import Any, Mapping, Optional, Type, TypeVar
from pydantic import BaseModel
from utilities import get_logger
from great_ai.utilities import get_logger
from ..views import Trace
from .call_remote_great_ai_async import call_remote_great_ai_async

View file

@ -1,10 +1,10 @@
from typing import Any, Callable, Iterable, List
from typing import Any, Callable, Iterable, List, TypeVar
T = TypeVar("T")
def unique(
values: Iterable[Any], *, key: Callable[[Any], Any] = lambda v: v
) -> List[Any]:
"""Only keep first occurrences while maintaining original order.
def unique(values: Iterable[T], *, key: Callable[[T], Any] = lambda v: v) -> List[T]:
"""Keep only the first occurrences while maintaining original order.
The equality check used for deduplication can be overridden using the `key` argument.
@ -15,6 +15,13 @@ def unique(
[{'a': 1, 'b': 2}]
>>> unique([{'a': 1, 'b': 2}, {'a': 1, 'b': 3}], key=lambda v: v['b'])
[{'a': 1, 'b': 2}, {'a': 1, 'b': 3}]
Args:
values: An iterable containing your values
key: Override the identity function of the equality check.
Returns:
A deduplicated list.
"""
key_values = {}

View file

@ -1,6 +1,6 @@
import unittest
from src.large_file.helper import human_readable_to_byte
from src.great_ai.large_file.helper import human_readable_to_byte
class TestHumanReadableToByte(unittest.TestCase):

View file

@ -8,7 +8,7 @@ import boto3
PATH = Path(__file__).parent.resolve()
from src.large_file import LargeFileS3
from src.great_ai.large_file import LargeFileS3
credentials = {
"aws_region_name": "your_region_like_eu-west-2",

View file

@ -2,7 +2,7 @@ import unittest
import pytest
from src.utilities import chunk
from src.great_ai.utilities import chunk
class TestChunk(unittest.TestCase):

View file

@ -1,6 +1,6 @@
import unittest
from src.utilities import clean
from src.great_ai.utilities import clean
class TestClean(unittest.TestCase):

View file

@ -4,7 +4,7 @@ from pathlib import Path
import pytest
from src.utilities import ConfigFile
from src.great_ai.utilities import ConfigFile
DATA_PATH = Path(__file__).parent.resolve() / "data"

View file

@ -5,7 +5,7 @@ import matplotlib
matplotlib.use("Agg") # don't show a window for each test
from src.utilities import evaluate_ranking
from src.great_ai.utilities import evaluate_ranking
class TestEvaluateRanking(unittest.TestCase):

View file

@ -1,6 +1,6 @@
import unittest
from src.utilities import get_sentences
from src.great_ai.utilities import get_sentences
class TestGetSentences(unittest.TestCase):

View file

@ -1,6 +1,10 @@
import unittest
from src.utilities import english_name_of_language, is_english, predict_language
from src.great_ai.utilities import (
english_name_of_language,
is_english,
predict_language,
)
class TestLanguage(unittest.TestCase):

View file

@ -1,6 +1,6 @@
import unittest
from src.utilities import match_names
from src.great_ai.utilities import match_names
class TestMatchNames(unittest.TestCase):

View file

@ -2,7 +2,7 @@ import unittest
import pytest
from src.utilities import WorkerException, parallel_map
from src.great_ai.utilities import WorkerException, parallel_map
COUNT = int(1e5) + 3

View file

@ -2,7 +2,7 @@ import unittest
import pytest
from src.utilities import WorkerException, threaded_parallel_map
from src.great_ai.utilities import WorkerException, threaded_parallel_map
COUNT = int(1e5) + 3

View file

@ -1,6 +1,6 @@
import unittest
from src.utilities import unique
from src.great_ai.utilities import unique
original = [
("a", 1),