Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Mar 12, 2024
1 parent 9abc133 commit bfb647b
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 21 deletions.
Binary file added database.db
Binary file not shown.
2 changes: 1 addition & 1 deletion genotype_api/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from fastapi.middleware.cors import CORSMiddleware

from genotype_api.config import security_settings
from genotype_api.database.database import create_db_and_tables
from genotype_api.database.session_handler import create_db_and_tables
from genotype_api.api.endpoints import samples, snps, users, plates, analyses
from sqlalchemy.exc import NoResultFound

Expand Down
4 changes: 2 additions & 2 deletions genotype_api/api/endpoints/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from genotype_api.database.crud.read import get_analysis, check_analyses_objects
from genotype_api.database.crud.create import create_analysis, create_analyses_sample_objects
from genotype_api.database.crud.update import refresh_sample_status
from genotype_api.database.database import get_session
from genotype_api.database.session_handler import get_session
from genotype_api.file_parsing.files import check_file
from genotype_api.database.models.models import (
from genotype_api.database.models import (
Analysis,
AnalysisRead,
User,
Expand Down
4 changes: 2 additions & 2 deletions genotype_api/api/endpoints/plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
)
from genotype_api.database.crud.update import refresh_sample_status
from genotype_api.database.crud.create import create_plate, create_analyses_sample_objects
from genotype_api.database.database import get_session
from genotype_api.database.session_handler import get_session
from genotype_api.file_parsing.excel import GenotypeAnalysis
from genotype_api.file_parsing.files import check_file
from genotype_api.database.models.models import (
from genotype_api.database.models import (
Analysis,
User,
Plate,
Expand Down
4 changes: 2 additions & 2 deletions genotype_api/api/endpoints/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

import genotype_api.database.crud.create
from genotype_api.constants import SEXES
from genotype_api.database.database import get_session
from genotype_api.database.session_handler import get_session
from genotype_api.match import check_sample
from genotype_api.models import (
SampleDetail,
MatchResult,
MatchCounts,
)
from genotype_api.database.models.models import (
from genotype_api.database.models import (
Analysis,
Sample,
SampleRead,
Expand Down
6 changes: 3 additions & 3 deletions genotype_api/api/endpoints/snps.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Routes for the snps"""

from genotype_api.database.models.models import SNP, User
from genotype_api.database.models import SNP, User
from typing import List

from fastapi import APIRouter, Depends, HTTPException, Query, File, UploadFile
from genotype_api.database.database import get_session
from fastapi import APIRouter, Depends, HTTPException, Query, UploadFile
from genotype_api.database.session_handler import get_session
from sqlmodel import Session, delete, select

from genotype_api.security import get_active_user
Expand Down
4 changes: 2 additions & 2 deletions genotype_api/api/endpoints/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from starlette.responses import JSONResponse

from genotype_api.database.crud.read import get_user
from genotype_api.database.database import get_session
from genotype_api.database.models.models import User, UserRead, UserCreate, UserReadWithPlates
from genotype_api.database.session_handler import get_session
from genotype_api.database.models import User, UserRead, UserCreate, UserReadWithPlates
from sqlmodel import Session, select

from genotype_api.security import get_active_user
Expand Down
2 changes: 1 addition & 1 deletion genotype_api/database/crud/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi import HTTPException
from sqlmodel import Session

from genotype_api.database.models.models import (
from genotype_api.database.models import (
Analysis,
Sample,
User,
Expand Down
2 changes: 1 addition & 1 deletion genotype_api/database/crud/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from sqlmodel import Session

from genotype_api.database.models.models import Analysis, Plate
from genotype_api.database.models import Analysis, Plate
from sqlmodel.sql.expression import Select, SelectOfScalar

SelectOfScalar.inherit_cache = True
Expand Down
2 changes: 1 addition & 1 deletion genotype_api/database/crud/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sqlmodel import Session, select

from genotype_api.constants import TYPES
from genotype_api.database.models.models import Analysis, Sample, User, Plate
from genotype_api.database.models import Analysis, Sample, User, Plate
from sqlmodel.sql.expression import Select, SelectOfScalar

SelectOfScalar.inherit_cache = True
Expand Down
2 changes: 1 addition & 1 deletion genotype_api/database/crud/update.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from sqlmodel import Session

from genotype_api.match import check_sample
from genotype_api.database.models.models import Sample
from genotype_api.database.models import Sample
from sqlmodel.sql.expression import Select, SelectOfScalar

SelectOfScalar.inherit_cache = True
Expand Down
File renamed without changes.
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion genotype_api/file_parsing/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import openpyxl
from genotype_api.exceptions import SexConflictError
from genotype_api.database.models.models import Genotype, Analysis
from genotype_api.database.models import Genotype, Analysis

from openpyxl.workbook import Workbook
from openpyxl.worksheet.worksheet import Worksheet
Expand Down
2 changes: 1 addition & 1 deletion genotype_api/file_parsing/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Dict, Iterable, List, TextIO

from genotype_api.database.models.models import Genotype as DBGenotype, Analysis
from genotype_api.database.models import Genotype as DBGenotype, Analysis
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion genotype_api/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genotype_api.models import (
SampleDetail,
)
from genotype_api.database.models.models import Sample, check_snps, check_sex
from genotype_api.database.models import Sample, check_snps, check_sex

log = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions genotype_api/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from starlette.requests import Request

from genotype_api.database.database import get_session
from genotype_api.database.models.models import User
from genotype_api.database.session_handler import get_session
from genotype_api.database.models import User
from genotype_api.config import security_settings
from genotype_api.database.crud.read import get_user_by_email
from jose import jwt
Expand Down

0 comments on commit bfb647b

Please sign in to comment.