diff --git a/.gitignore b/.gitignore index 1e1f284..99d47c7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,5 @@ site/ # data artifacts -data/ \ No newline at end of file +data/ +jaffle-data/ \ No newline at end of file diff --git a/jafgen/simulation.py b/jafgen/simulation.py index 7907190..cc04252 100644 --- a/jafgen/simulation.py +++ b/jafgen/simulation.py @@ -1,3 +1,4 @@ +import os import uuid import pandas as pd @@ -114,10 +115,13 @@ def save_results(self): df_supplies = pd.DataFrame.from_dict(Stock.to_dict()) # ask Drew about what the heck is up with the to_dict generator stuff + if not os.path.exists("./jaffle-data"): + os.makedirs("./jaffle-data") + # save output - df_customers.to_csv("./data/customers.csv", index=False) - df_items.to_csv("./data/items.csv", index=False) - df_orders.to_csv("./data/orders.csv", index=False) - df_products.to_csv("./data/products.csv", index=False) - df_stores.to_csv("./data/stores.csv", index=False) - df_supplies.to_csv("./data/supplies.csv", index=False) + df_customers.to_csv("./jaffle-data/customers.csv", index=False) + df_items.to_csv("./jaffle-data/items.csv", index=False) + df_orders.to_csv("./jaffle-data/orders.csv", index=False) + df_products.to_csv("./jaffle-data/products.csv", index=False) + df_stores.to_csv("./jaffle-data/stores.csv", index=False) + df_supplies.to_csv("./jaffle- data/supplies.csv", index=False) diff --git a/jafgen/stores/stock.py b/jafgen/stores/stock.py index 4d40cfb..82d447b 100644 --- a/jafgen/stores/stock.py +++ b/jafgen/stores/stock.py @@ -128,6 +128,3 @@ def to_dict(cls): Supply(id="SUP-029", name="lime", cost=0.13, perishable=True, skus=["BEV-005"]), ] ) - -for supply in Stock.stock: - print(Stock.stock[supply])