Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Dec 4, 2023
1 parent dbf50a5 commit a6a7ae4
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 26 deletions.
3 changes: 2 additions & 1 deletion pephub/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
from pepdbagent import PEPDatabaseAgent
from pepdbagent.const import DEFAULT_TAG
from pepdbagent.exceptions import ProjectNotFoundError
from pepdbagent.models import AnnotationModel, Namespace
from qdrant_client import QdrantClient
from qdrant_client.http.exceptions import ResponseHandlingException
from sentence_transformers import SentenceTransformer

from .routers.models import AnnotationModel, Namespace, ForkRequest
from .routers.models import ForkRequest
from .const import (
DEFAULT_POSTGRES_HOST,
DEFAULT_POSTGRES_PASSWORD,
Expand Down
5 changes: 2 additions & 3 deletions pephub/helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
from datetime import date
from typing import List, Union, Tuple
from fastapi import Response, Depends, UploadFile
from fastapi import Response, UploadFile
from fastapi.exceptions import HTTPException
from ubiquerg import VersionInHelpParser

Expand Down Expand Up @@ -54,7 +53,7 @@ def add_subparser(cmd, description):
"--config",
required=False,
dest="config",
help=f"A path to the pepserver config file",
help="A path to the pepserver config file",
)

sps["serve"].add_argument(
Expand Down
2 changes: 1 addition & 1 deletion pephub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
_LOGGER_PEPPY = logging.getLogger("peppy")
coloredlogs.install(
logger=_LOGGER_PEPPY,
level=logging.INFO,
level=logging.ERROR,
datefmt="%b %d %Y %H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [PEPPY] %(message)s",
)
Expand Down
2 changes: 1 addition & 1 deletion pephub/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi.responses import FileResponse
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import Response
from starlette.types import ASGIApp, Receive, Scope, Send
from starlette.types import Send

from .const import SPA_PATH

Expand Down
3 changes: 1 addition & 2 deletions pephub/routers/api/v1/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
from pepdbagent import PEPDatabaseAgent
from pepdbagent.exceptions import ProjectUniqueNameError
from pepdbagent.const import DEFAULT_LIMIT_INFO
from pepdbagent.models import ListOfNamespaceInfo
from pepdbagent.models import ListOfNamespaceInfo, Namespace
from typing import Literal
from typing_extensions import Annotated

from ...models import Namespace
from ....dependencies import (
get_db,
get_namespace_info,
Expand Down
13 changes: 8 additions & 5 deletions pephub/routers/api/v1/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
SUBSAMPLE_RAW_LIST_KEY,
)

from ...models import ProjectOptional, ProjectRawModel, AnnotationModel, ForkRequest
from pepdbagent import PEPDatabaseAgent
from pepdbagent.exceptions import ProjectUniqueNameError
from pepdbagent.models import AnnotationModel

from dotenv import load_dotenv


from ...models import ProjectOptional, ProjectRawModel, ForkRequest
from ....helpers import zip_conv_result, get_project_sample_names, zip_pep
from ....dependencies import (
get_db,
Expand All @@ -27,10 +34,6 @@
)
from ....const import SAMPLE_CONVERSION_FUNCTIONS, VALID_UPDATE_KEYS

from pepdbagent import PEPDatabaseAgent
from pepdbagent.exceptions import ProjectUniqueNameError

from dotenv import load_dotenv

load_dotenv()

Expand Down
4 changes: 2 additions & 2 deletions pephub/routers/auth/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
from typing import Union
from fastapi import APIRouter, Request, Header, BackgroundTasks, Depends
from fastapi.responses import RedirectResponse, Response
from fastapi.responses import RedirectResponse
from fastapi.exceptions import HTTPException
from fastapi.templating import Jinja2Templates
from dotenv import load_dotenv
Expand Down Expand Up @@ -136,7 +136,7 @@ def callback(

if state.get("device"):
DEVICE_CODES[state["device_code"]]["token"] = token
return f"/login/device/success"
return "/login/device/success"

else:
# create random auth code
Expand Down
6 changes: 3 additions & 3 deletions pephub/routers/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional
from pydantic import BaseModel
from pepdbagent.models import *
from typing import Optional, List
from pydantic import BaseModel, Field, Extra
from pepdbagent.models import UpdateItems
from pepdbagent.const import DEFAULT_TAG

from ..const import DEFAULT_PEP_SCHEMA
Expand Down
7 changes: 4 additions & 3 deletions pephub/routers/profile.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from fastapi import APIRouter, Request
from fastapi import APIRouter, Request, Depends
from fastapi.templating import Jinja2Templates
from fastapi.responses import RedirectResponse
from platform import python_version
from pepdbagent import PEPDatabaseAgent

from .._version import __version__ as pephub_version
from ..dependencies import get_db

from ..dependencies import *
from ..view_dependencies import *
# from ..view_dependencies import *
from ..const import BASE_TEMPLATES_PATH

router = APIRouter(prefix="/profile", tags=["profile"])
Expand Down
6 changes: 1 addition & 5 deletions pephub/routers/views/eido.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import jinja2
import eido
import peppy

from fastapi import APIRouter, Request
from fastapi.responses import RedirectResponse, HTMLResponse
from fastapi.responses import HTMLResponse
from starlette.templating import Jinja2Templates
from peppy import __version__ as peppy_version
from peppy.const import SAMPLE_RAW_DICT_KEY, CONFIG_KEY
from platform import python_version
from dotenv import load_dotenv

from ..._version import __version__ as pephub_version
from ...dependencies import *
from ...view_dependencies import *
from ...const import EIDO_TEMPLATES_PATH


Expand Down

0 comments on commit a6a7ae4

Please sign in to comment.