diff --git a/.ipynb_checkpoints/main-checkpoint.ipynb b/.ipynb_checkpoints/main-checkpoint.ipynb index 5098552..f9046c2 100644 --- a/.ipynb_checkpoints/main-checkpoint.ipynb +++ b/.ipynb_checkpoints/main-checkpoint.ipynb @@ -2,72 +2,12 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "id": "90c70e46-71a0-44a6-8090-f53aad3193c3", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Query start time: 2024-10-13 18:13:45.509982\n", - "Query end time: 2024-10-13 18:13:45.944136\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
START_DATE_TIMEEND_DATE_TIMEFOCAL_IDMIN_PRICEMAX_PRICEPRICE_CHANGE (%)PARTICIPANT_VOLUMETOTAL_VOLUMEVOLUME (%)PARTICIPANT_VOLUME_PCTSegmentSAR_FLAGRisk
\n", - "
" - ], - "text/plain": [ - "Empty DataFrame\n", - "Columns: [START_DATE_TIME, END_DATE_TIME, FOCAL_ID, MIN_PRICE, MAX_PRICE, PRICE_CHANGE (%), PARTICIPANT_VOLUME, TOTAL_VOLUME, VOLUME (%), PARTICIPANT_VOLUME_PCT, Segment, SAR_FLAG, Risk]\n", - "Index: []" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from datetime import datetime\n", "import pandas as pd\n", @@ -171,35 +111,28 @@ " return final_scenario_df\n", "\n", "\n", - "# Instantiate and execute logic\n", - "scenario = Scenario()\n", - "scenario.logic(validation_window=1000)\n" + "\n" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "caee5554-5254-4388-bf24-029281d77890", "metadata": {}, - "outputs": [ - { - "ename": "TypeError", - "evalue": "unsupported operand type(s) for /: 'NoneType' and 'int'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[6], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m scenario \u001b[38;5;241m=\u001b[39m Scenario()\n\u001b[0;32m----> 2\u001b[0m \u001b[43mscenario\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlogic\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", - "Cell \u001b[0;32mIn[4], line 60\u001b[0m, in \u001b[0;36mScenario.logic\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mlogic\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 59\u001b[0m validation_window \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalidation_window\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m---> 60\u001b[0m time_window_s \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(\u001b[43mvalidation_window\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1000\u001b[39;49m)\n\u001b[1;32m 62\u001b[0m query_start_time \u001b[38;5;241m=\u001b[39m datetime\u001b[38;5;241m.\u001b[39mnow()\n\u001b[1;32m 63\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mQuery start time:\u001b[39m\u001b[38;5;124m\"\u001b[39m, query_start_time)\n", - "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'NoneType' and 'int'" - ] - } - ], + "outputs": [], "source": [ "# Instantiate and execute logic\n", - "scenario = Scenario()\n", - "scenario.logic(validation_window=1000)" + "#scenario = Scenario()\n", + "#scenario.logic(validation_window=1000)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1feaf267-88d1-41b8-a8b9-f150b7ff16cd", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/main.ipynb b/main.ipynb index db3c9d0..f9046c2 100644 --- a/main.ipynb +++ b/main.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "90c70e46-71a0-44a6-8090-f53aad3193c3", "metadata": { "tags": [] @@ -116,74 +116,14 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "id": "caee5554-5254-4388-bf24-029281d77890", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Query start time: 2024-10-13 18:14:29.793521\n", - "Query end time: 2024-10-13 18:14:29.933772\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
START_DATE_TIMEEND_DATE_TIMEFOCAL_IDMIN_PRICEMAX_PRICEPRICE_CHANGE (%)PARTICIPANT_VOLUMETOTAL_VOLUMEVOLUME (%)PARTICIPANT_VOLUME_PCTSegmentSAR_FLAGRisk
\n", - "
" - ], - "text/plain": [ - "Empty DataFrame\n", - "Columns: [START_DATE_TIME, END_DATE_TIME, FOCAL_ID, MIN_PRICE, MAX_PRICE, PRICE_CHANGE (%), PARTICIPANT_VOLUME, TOTAL_VOLUME, VOLUME (%), PARTICIPANT_VOLUME_PCT, Segment, SAR_FLAG, Risk]\n", - "Index: []" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Instantiate and execute logic\n", - "scenario = Scenario()\n", - "scenario.logic(validation_window=1000)" + "#scenario = Scenario()\n", + "#scenario.logic(validation_window=1000)" ] }, { diff --git a/main.py b/main.py index 621c750..3f4b66d 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -# In[3]: +# In[4]: from datetime import datetime @@ -109,12 +109,12 @@ class Scenario: -# In[2]: +# In[5]: # Instantiate and execute logic -scenario = Scenario() -scenario.logic(validation_window=1000) +#scenario = Scenario() +#scenario.logic(validation_window=1000) # In[ ]: