From ba4bcfc8d99810f667df0ebf1cd1f4f1a81a07b7 Mon Sep 17 00:00:00 2001 From: "Borrell.Guillem@bcg.com" Date: Mon, 18 Sep 2023 09:43:10 +0200 Subject: [PATCH] Removed references to dengfun --- src/retailtwin/api/README.md | 4 ++-- src/retailtwin/api/db.py | 4 ++-- src/retailtwin/api/main.py | 2 +- src/retailtwin/bootstrap.py | 8 ++++---- src/retailtwin/cli/data.py | 6 +++--- src/retailtwin/cli/pos/main.py | 6 +++--- src/retailtwin/cli/stock.py | 2 +- src/retailtwin/simulation.py | 2 +- src/retailtwin/sql/sync.py | 4 ++-- src/retailtwin/views.py | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/retailtwin/api/README.md b/src/retailtwin/api/README.md index ab0dfca..854e584 100644 --- a/src/retailtwin/api/README.md +++ b/src/retailtwin/api/README.md @@ -3,7 +3,7 @@ Run the backend with ```bash -uvicorn dengfun.retail.api.main:app +uvicorn retailtwin.api.main:app ``` Use Caddy to reverse proxy and the following Caddyfile. Paths are static so you have to run caddy from the root of the package @@ -14,7 +14,7 @@ Use Caddy to reverse proxy and the following Caddyfile. Paths are static so you reverse_proxy localhost:8000 } file_server { - root src/dengfun/retail/api/static + root src/retailtwin/api/static } } ``` diff --git a/src/retailtwin/api/db.py b/src/retailtwin/api/db.py index fcfd473..8c6f34b 100644 --- a/src/retailtwin/api/db.py +++ b/src/retailtwin/api/db.py @@ -2,8 +2,8 @@ import os from operator import itemgetter from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, AsyncSession from sqlalchemy import select, desc -from dengfun.retail.views import get_inventory_view, get_stores_view -from dengfun.retail.api.settings import Settings +from retailtwin.views import get_inventory_view, get_stores_view +from retailtwin.api.settings import Settings async def get_session(): diff --git a/src/retailtwin/api/main.py b/src/retailtwin/api/main.py index 9ae193a..5334dc1 100644 --- a/src/retailtwin/api/main.py +++ b/src/retailtwin/api/main.py @@ -1,7 +1,7 @@ from fastapi import FastAPI, Request, Depends from fastapi.responses import HTMLResponse from sqlalchemy.ext.asyncio import async_sessionmaker, AsyncSession -from dengfun.retail.api.db import get_inventory, get_session, get_stores +from retailtwin.api.db import get_inventory, get_session, get_stores app = FastAPI(root_path="/api/v1") diff --git a/src/retailtwin/bootstrap.py b/src/retailtwin/bootstrap.py index e1fce0e..215174e 100644 --- a/src/retailtwin/bootstrap.py +++ b/src/retailtwin/bootstrap.py @@ -10,9 +10,9 @@ import polars as pl from sqlalchemy import select from sqlalchemy.orm import Session -import dengfun -from dengfun.retail.utils import db_uri_from_session -from dengfun.retail.models import ( +import retailtwin +from retailtwin.utils import db_uri_from_session +from retailtwin.models import ( Discount, Item, ItemBatch, @@ -24,7 +24,7 @@ from dengfun.retail.models import ( ) # Some configuration parameters. -PACKAGE_ROOT = Path(dengfun.__file__).parent / "retail" +PACKAGE_ROOT = Path(retailtwin.__file__).parent / "retail" PRODUCT_LIST_FILE = "data/products.csv" DISCOUNT_LIST_FILE = "data/discounts.csv" RANDOM_PEOPLE_FILE = "data/random_people.csv" diff --git a/src/retailtwin/cli/data.py b/src/retailtwin/cli/data.py index 4841fd3..b92c16a 100644 --- a/src/retailtwin/cli/data.py +++ b/src/retailtwin/cli/data.py @@ -2,7 +2,7 @@ import typer from sqlalchemy import create_engine from sqlalchemy.orm import Session -from dengfun.retail.bootstrap import ( +from retailtwin.bootstrap import ( bootstrap_clients, bootstrap_discounts, bootstrap_items, @@ -11,8 +11,8 @@ from dengfun.retail.bootstrap import ( bootstrap_stock, bootstrap_taskowners, ) -from dengfun.retail.models import Base -from dengfun.retail.sql.sync import funcandproc +from retailtwin.models import Base +from retailtwin.sql.sync import funcandproc app = typer.Typer() diff --git a/src/retailtwin/cli/pos/main.py b/src/retailtwin/cli/pos/main.py index 3494a7a..5b72880 100644 --- a/src/retailtwin/cli/pos/main.py +++ b/src/retailtwin/cli/pos/main.py @@ -3,9 +3,9 @@ Terminal that mimics what a Point of Sale may operate like. """ import typer import polars as pl -from dengfun.retail.cli.db import query_local_batches -from dengfun.retail.cli.pos.models import Base, Sync, Direction, Cart, Item -from dengfun.retail.utils import db_uri_from_session +from retailtwin.cli.db import query_local_batches +from retailtwin.cli.pos.models import Base, Sync, Direction, Cart, Item +from retailtwin.utils import db_uri_from_session from datetime import datetime from sqlalchemy import create_engine, select diff --git a/src/retailtwin/cli/stock.py b/src/retailtwin/cli/stock.py index db5c7de..4ec3b43 100644 --- a/src/retailtwin/cli/stock.py +++ b/src/retailtwin/cli/stock.py @@ -2,7 +2,7 @@ import typer import polars as pl from sqlalchemy import create_engine, text as query -from dengfun.retail.cli.db import query_warehouse_stock, df_to_table, fetch_from_db +from retailtwin.cli.db import query_warehouse_stock, df_to_table, fetch_from_db from prompt_toolkit import PromptSession from prompt_toolkit.completion import WordCompleter from prompt_toolkit.shortcuts import clear diff --git a/src/retailtwin/simulation.py b/src/retailtwin/simulation.py index 123971b..c4d65db 100644 --- a/src/retailtwin/simulation.py +++ b/src/retailtwin/simulation.py @@ -5,7 +5,7 @@ import polars as pl from scipy.stats.distributions import lognorm from sqlalchemy.orm import Session -from dengfun.retail.models import Cart +from retailtwin.models import Cart def cart(session: Session) -> Cart: diff --git a/src/retailtwin/sql/sync.py b/src/retailtwin/sql/sync.py index d57cbd9..941e015 100644 --- a/src/retailtwin/sql/sync.py +++ b/src/retailtwin/sql/sync.py @@ -1,9 +1,9 @@ from pathlib import Path from sqlalchemy import create_engine, text from sqlalchemy.orm import Session -import dengfun +import retailtwin -PACKAGE_ROOT = Path(dengfun.__file__).parent / "retail" +PACKAGE_ROOT = Path(retailtwin.__file__).parent / "retail" def funcandproc(db_uri: str): diff --git a/src/retailtwin/views.py b/src/retailtwin/views.py index 0b69dea..345f6ed 100644 --- a/src/retailtwin/views.py +++ b/src/retailtwin/views.py @@ -4,7 +4,7 @@ to existing views in the database. Make sure these views have been synced after table creation. """ -from dengfun.retail.models import Base +from retailtwin.models import Base from functools import lru_cache from sqlalchemy import Table, Column, Date, Integer, String, JSON