Skip to content

Commit

Permalink
refactor: conform to snake_case filenames
Browse files Browse the repository at this point in the history
PEP8: https://peps.python.org/pep-0008/#package-and-module-names

Mixing uppercase and lowercase in filenames can cause cross-platform issues
  • Loading branch information
jorgenengelsen committed Aug 29, 2023
1 parent cb2c2eb commit 2057e60
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 345 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pymongo.mongo_client import MongoClient

from common.exceptions import NotFoundException, ValidationException
from data_providers.clients.ClientInterface import ClientInterface
from data_providers.clients.client_interface import ClientInterface


class MongoDatabaseClient(ClientInterface[dict, str]):
Expand Down
4 changes: 2 additions & 2 deletions api/src/data_providers/get_repository.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from pymongo.mongo_client import MongoClient

from config import config
from data_providers.clients.mongodb.MongoDatabaseClient import MongoDatabaseClient
from data_providers.repositories.TodoRepository import TodoRepository
from data_providers.clients.mongodb.mongo_database_client import MongoDatabaseClient
from data_providers.repositories.todo_repository import TodoRepository

MONGO_CLIENT: MongoClient = MongoClient(
host=config.MONGODB_HOSTNAME,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from common.exceptions import NotFoundException
from data_providers.clients.ClientInterface import ClientInterface
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.clients.client_interface import ClientInterface
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


def to_dict(todo_item: TodoItem):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABCMeta, abstractmethod

from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


class TodoRepositoryInterface(metaclass=ABCMeta):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/src/features/todo/todo_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from authentication.models import User
from common.responses import create_response
from data_providers.get_repository import get_todo_repository
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)

Expand Down
4 changes: 2 additions & 2 deletions api/src/features/todo/use_cases/add_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from pydantic import BaseModel, Field

from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


class AddTodoRequest(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion api/src/features/todo/use_cases/delete_todo_by_id.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import BaseModel

from common.exceptions import MissingPrivilegeException, NotFoundException
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)

Expand Down
4 changes: 2 additions & 2 deletions api/src/features/todo/use_cases/get_todo_all.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pydantic import BaseModel

from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


class GetTodoAllResponse(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions api/src/features/todo/use_cases/get_todo_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from pydantic import BaseModel

from common.exceptions import MissingPrivilegeException
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


class GetTodoByIdResponse(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions api/src/features/todo/use_cases/update_todo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from pydantic import BaseModel, Field

from common.exceptions import MissingPrivilegeException
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


class UpdateTodoRequest(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions api/src/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

from app import create_app
from config import config
from data_providers.clients.mongodb.MongoDatabaseClient import MongoDatabaseClient
from data_providers.clients.mongodb.mongo_database_client import MongoDatabaseClient
from data_providers.get_repository import get_todo_repository
from data_providers.repositories.TodoRepository import TodoRepository
from data_providers.repositories.todo_repository import TodoRepository


@pytest.fixture(scope="function")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
)
from starlette.testclient import TestClient

from data_providers.clients.ClientInterface import ClientInterface
from data_providers.clients.client_interface import ClientInterface

pytestmark = pytest.mark.integration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from common.exceptions import NotFoundException, ValidationException
from data_providers.clients.mongodb.MongoDatabaseClient import MongoDatabaseClient
from data_providers.clients.mongodb.mongo_database_client import MongoDatabaseClient


class TestMongoDatabaseClient:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest

from common.exceptions import NotFoundException, ValidationException
from data_providers.clients.mongodb.MongoDatabaseClient import MongoDatabaseClient
from data_providers.repositories.TodoRepository import TodoRepository
from entities.TodoItem import TodoItem
from data_providers.clients.mongodb.mongo_database_client import MongoDatabaseClient
from data_providers.repositories.todo_repository import TodoRepository
from entities.todo_item import TodoItem


class TestTodoRepository:
Expand Down
2 changes: 1 addition & 1 deletion api/src/tests/unit/entities/test_todo_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from entities.TodoItem import TodoItem
from entities.todo_item import TodoItem


def test_todo_item_init():
Expand Down
2 changes: 1 addition & 1 deletion api/src/tests/unit/features/todo/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from data_providers.repositories.TodoRepository import TodoRepository
from data_providers.repositories.todo_repository import TodoRepository


@pytest.fixture(scope="function")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from pydantic.error_wrappers import ValidationError

from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from features.todo.use_cases.add_todo import AddTodoRequest, add_todo_use_case
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest as pytest

from common.exceptions import NotFoundException
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from features.todo.use_cases.delete_todo_by_id import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from features.todo.use_cases.get_todo_all import get_todo_all_use_case
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest as pytest

from common.exceptions import NotFoundException
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from features.todo.use_cases.get_todo_by_id import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from data_providers.repository_interfaces.TodoRepositoryInterface import (
from data_providers.repository_interfaces.todo_repository_interface import (
TodoRepositoryInterface,
)
from features.todo.use_cases.update_todo import UpdateTodoRequest, update_todo_use_case
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An entity can be an object with methods, or it can be a set of data structures a

```mdx-code-block
import CodeBlock from '@theme/CodeBlock';
import TodoItem from '!!raw-loader!@site/../api/src/entities/TodoItem.py';
import TodoItem from '!!raw-loader!@site/../api/src/entities/todo_item.py';
<CodeBlock language="jsx">{TodoItem}</CodeBlock>
```
Expand Down
2 changes: 1 addition & 1 deletion web/src/api/generated/core/OpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type OpenAPIConfig = {

export const OpenAPI: OpenAPIConfig = {
BASE: '',
VERSION: '1.4.0',
VERSION: '1.13.0',
WITH_CREDENTIALS: false,
CREDENTIALS: 'include',
TOKEN: undefined,
Expand Down
75 changes: 63 additions & 12 deletions web/src/api/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,68 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';

export { AccessLevel } from './models/AccessLevel';
export type { AddTodoRequest } from './models/AddTodoRequest';
export type { AddTodoResponse } from './models/AddTodoResponse';
export type { DeleteTodoByIdResponse } from './models/DeleteTodoByIdResponse';
export type { ErrorResponse } from './models/ErrorResponse';
export type { GetTodoAllResponse } from './models/GetTodoAllResponse';
export type { GetTodoByIdResponse } from './models/GetTodoByIdResponse';
export type { UpdateTodoRequest } from './models/UpdateTodoRequest';
export type { UpdateTodoResponse } from './models/UpdateTodoResponse';
export type { User } from './models/User';
export type { AHAPhaseOptComponents } from './models/AHAPhaseOptComponents';
export type { AHAPhaseOptRequest } from './models/AHAPhaseOptRequest';
export type { AHAPhaseOptResponse } from './models/AHAPhaseOptResponse';
export type { AHAS2PhaseOptComponents } from './models/AHAS2PhaseOptComponents';
export type { AHAS2PhaseOptRequest } from './models/AHAS2PhaseOptRequest';
export type { AHAS2PhaseOptResponse } from './models/AHAS2PhaseOptResponse';
export type { AHAS3PhaseOptComponents } from './models/AHAS3PhaseOptComponents';
export type { AHAS3PhaseOptRequest } from './models/AHAS3PhaseOptRequest';
export type { AHAS3PhaseOptResponse } from './models/AHAS3PhaseOptResponse';
export type { AHASphaseOptRequest } from './models/AHASphaseOptRequest';
export type { AHASphaseOptResponse } from './models/AHASphaseOptResponse';
export { AsyncCalculation } from './models/AsyncCalculation';
export type { CompressorRequest } from './models/CompressorRequest';
export type { CompressorResults } from './models/CompressorResults';
export type { CustomComponent } from './models/CustomComponent';
export type { ExportRiserInput } from './models/ExportRiserInput';
export type { ExportRiserOutput } from './models/ExportRiserOutput';
export type { FlashPointsOutput } from './models/FlashPointsOutput';
export type { FluidComponent } from './models/FluidComponent';
export type { FluidPropertiesOutput } from './models/FluidPropertiesOutput';
export type { GasMolarComposition } from './models/GasMolarComposition';
export type { GasPhaseComposition } from './models/GasPhaseComposition';
export type { GasPhaseProperties } from './models/GasPhaseProperties';
export type { GenericCalcResult } from './models/GenericCalcResult';
export type { HTTPValidationError } from './models/HTTPValidationError';
export type { models__AHA__TEG__pydantic_classes__ProcessInput } from './models/models__AHA__TEG__pydantic_classes__ProcessInput';
export type { models__AHA__TEG__pydantic_classes__ProcessOutput } from './models/models__AHA__TEG__pydantic_classes__ProcessOutput';
export type { models__ASG__ASGA__third_stage_compressor__asga_dto__ProcessInput } from './models/models__ASG__ASGA__third_stage_compressor__asga_dto__ProcessInput';
export type { models__ASG__ASGA__third_stage_compressor__asga_dto__ProcessOutput } from './models/models__ASG__ASGA__third_stage_compressor__asga_dto__ProcessOutput';
export { models__DEMO__pydantic_models__ProcessInput } from './models/models__DEMO__pydantic_models__ProcessInput';
export type { models__DEMO__pydantic_models__ProcessOutput } from './models/models__DEMO__pydantic_models__ProcessOutput';
export type { models__GDR__Degasser__pydantic_classes__ProcessInput } from './models/models__GDR__Degasser__pydantic_classes__ProcessInput';
export type { models__GDR__Degasser__pydantic_classes__ProcessOutput } from './models/models__GDR__Degasser__pydantic_classes__ProcessOutput';
export type { models__GDR__DegasserSaltWater__pydantic_classes__ProcessInput } from './models/models__GDR__DegasserSaltWater__pydantic_classes__ProcessInput';
export type { models__GDR__DegasserSaltWater__pydantic_classes__ProcessOutput } from './models/models__GDR__DegasserSaltWater__pydantic_classes__ProcessOutput';
export type { models__ML__MLA__TEG__pydantic_classes__ProcessInput } from './models/models__ML__MLA__TEG__pydantic_classes__ProcessInput';
export type { models__ML__MLA__TEG__pydantic_classes__ProcessOutput } from './models/models__ML__MLA__TEG__pydantic_classes__ProcessOutput';
export type { models__TLAB__glycol_rig__tlabglycolrig__ProcessInput } from './models/models__TLAB__glycol_rig__tlabglycolrig__ProcessInput';
export type { models__TLAB__glycol_rig__tlabglycolrig__ProcessOutput } from './models/models__TLAB__glycol_rig__tlabglycolrig__ProcessOutput';
export { models__TLAB__hpseprig__hpseprig_pydantic_classes__ProcessInput } from './models/models__TLAB__hpseprig__hpseprig_pydantic_classes__ProcessInput';
export type { models__TLAB__hpseprig__hpseprig_pydantic_classes__ProcessOutput } from './models/models__TLAB__hpseprig__hpseprig_pydantic_classes__ProcessOutput';
export type { NmVOC } from './models/NmVOC';
export type { PhaseProperties } from './models/PhaseProperties';
export type { PHFlashInput } from './models/PHFlashInput';
export type { PredefinedComponent } from './models/PredefinedComponent';
export type { PSFlashInput } from './models/PSFlashInput';
export type { SetpointProperties } from './models/SetpointProperties';
export type { TPFlashInput } from './models/TPFlashInput';
export type { TrollBTEGInput } from './models/TrollBTEGInput';
export type { TrollBTEGOutput } from './models/TrollBTEGOutput';
export type { TrollBTEGregenInput } from './models/TrollBTEGregenInput';
export type { TrollBTEGregenOutput } from './models/TrollBTEGregenOutput';
export type { ValidationError } from './models/ValidationError';
export type { WaterSampleFlash } from './models/WaterSampleFlash';

export { AasgardAService } from './services/AasgardAService';
export { AastaHansteenService } from './services/AastaHansteenService';
export { DemoInstallationService } from './services/DemoInstallationService';
export { FlashpointSimulationsService } from './services/FlashpointSimulationsService';
export { GudrunService } from './services/GudrunService';
export { HealthCheckService } from './services/HealthCheckService';
export { TodosService } from './services/TodosService';
export { WhoamiService } from './services/WhoamiService';
export { MartinLingeService } from './services/MartinLingeService';
export { ResultsService } from './services/ResultsService';
export { RotvollLaboratoryService } from './services/RotvollLaboratoryService';
export { TrobService } from './services/TrobService';
13 changes: 0 additions & 13 deletions web/src/api/generated/models/AccessLevel.ts

This file was deleted.

9 changes: 0 additions & 9 deletions web/src/api/generated/models/AddTodoRequest.ts

This file was deleted.

11 changes: 0 additions & 11 deletions web/src/api/generated/models/AddTodoResponse.ts

This file was deleted.

9 changes: 0 additions & 9 deletions web/src/api/generated/models/DeleteTodoByIdResponse.ts

This file was deleted.

13 changes: 0 additions & 13 deletions web/src/api/generated/models/ErrorResponse.ts

This file was deleted.

11 changes: 0 additions & 11 deletions web/src/api/generated/models/GetTodoAllResponse.ts

This file was deleted.

11 changes: 0 additions & 11 deletions web/src/api/generated/models/GetTodoByIdResponse.ts

This file was deleted.

Loading

0 comments on commit 2057e60

Please sign in to comment.