From b4de32b96e323065a0d0dfdeff24c052b2edaae7 Mon Sep 17 00:00:00 2001 From: FlorianJacta <98709993+FlorianJacta@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:39:31 +0200 Subject: [PATCH] Include 3.0 features --- .../complete_application/src/src.zip | Bin 92073 -> 92430 bytes .../algorithms/algorithms.py | 30 ++++------ .../src/taipy_application/main.py | 2 +- .../pages/scenario/scenario.md | 10 +++- .../pages/scenario/scenario.py | 13 +++-- .../complete_application/step_02/step_02.md | 52 ++++++++---------- .../complete_application/step_03/step_03.md | 8 +-- .../complete_application/step_04/step_04.md | 32 +++++++++-- 8 files changed, 83 insertions(+), 64 deletions(-) diff --git a/docs/tutorials/complete_applications/complete_application/src/src.zip b/docs/tutorials/complete_applications/complete_application/src/src.zip index a30a038ef075d4a96c0318f13d90da88273b6305..dd9d89298a2abc00c7e18e1a6a4b305ca85a36f5 100644 GIT binary patch delta 10714 zcmZWP1zc6j)Av%+-7P8I-7VdXbR!+ohm=M_xO7W5C=JrxAkwYUAP5L5-v!@$-}C*? z{hhOWcjD~K&d%=4p0Y{!_!)RKHAPrBT+sc+=pm4Z#sTZ+#+xW14Ex?)ATj7E7PQc< zb#`Okg$IG?Q9vL$NF6(v2*RcdMoC^rz)VI1;{z!=}}Ceyw2SBS8V$a%MoKFo24T_g0ZefeGQ zTA`Jk{Bo~lLIDNs*Q>RY4vKkaZhN?Dp+Xt`Oxhh)x8tw*tKq3X(X%N-259oZZ}_b_ zP)LDhp}I`(V2D{khXU8NQ&!&QnpI0)Hs+MuH#51k4u2U_Tjx`g>5YnImPU!)^;qG2|Wgc($IaYyPyCy8;pnv+=pcrN1^pM3y%d zqI0y$YsQk^o(<}YtxeanPsrI7QIlW6EeHe2fn}E-3F(Rst9#qgs0t<@sibrfj3?be43ly*<3p0&fOX} z@<}N#kGea{^yl!;Q4!E)2TPPcX+p{ct_!WFTV$6=Kpg6}FL>iOZi{nHJB)`O3CCUp zeo3`074J>sZ{7;UMiU@PPG~5x43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e9AvDN|CA5dx zmH_sBkX{MHWu*Sb|HtNdGXFr<046jE`)4+x-mfqVD=4$Ue-zk|aw~x7Uh^IpH25Dx z3b`M!e=`P9WvHQ}02_W-`8{vQWdChU;(oyXI(+}8gnrUOtLnplN$=0%%=g-o+dx}Q zlm8dOgiOi<*btD-Kf@IS!{-(L#xc3veE-u74yKtwju5{$^lb(>SY?1#Soz&YZsp(H zRJH&CEo>Rg2(*9AgTmX;`ZsC7Kcr8gr1wUFO(ehsl5YzL+%Eu7lB6&#l#K~md7u?m zez%gR0;#nFSRqt)|JV~Ylc1LbkL>^%nm-4oNhmoh)QHOWjDJ{7U_=72N=1VOb2 zsNs{%w`t8Zev?8EDUA2s{3|s2t1T&Qm@$}PkrK(hG5!h& t{vyrP`Ii*!|6}ml{Q{&v27mAuqk%q*5jw~Q050Up0l-Br)rTq#_kT2;rm_G4 diff --git a/docs/tutorials/complete_applications/complete_application/src/taipy_application/algorithms/algorithms.py b/docs/tutorials/complete_applications/complete_application/src/taipy_application/algorithms/algorithms.py index d4c87a3ea..f4d44fa33 100644 --- a/docs/tutorials/complete_applications/complete_application/src/taipy_application/algorithms/algorithms.py +++ b/docs/tutorials/complete_applications/complete_application/src/taipy_application/algorithms/algorithms.py @@ -45,29 +45,21 @@ def compute_metrics(historical_data, predicted_data): mae = mean_absolute_error(historical_to_compare, predicted_data) return rmse, mae + def create_predictions_dataset(predictions_baseline, predictions_ml, day, n_predictions, cleaned_data): print("Creating predictions dataset...") - - # Set arbitrarily the time window for the chart as 5 times the number of predictions - window = 5 * n_predictions - + # Create the historical dataset that will be displayed new_length = len(cleaned_data[cleaned_data["Date"] < day]) + n_predictions - temp_df = cleaned_data[:new_length] - temp_df = temp_df[-window:].reset_index(drop=True) + historical_data = cleaned_data[:new_length].reset_index(drop=True) - # Create the series that will be used in the concat - historical_values = pd.Series(temp_df["Value"], name="Historical values") - predicted_values_ml = pd.Series([np.NaN] * len(temp_df), name="Predicted values ML") - predicted_values_ml[-len(predictions_ml):] = predictions_ml - predicted_values_baseline = pd.Series([np.NaN] * len(temp_df), name="Predicted values Baseline") - predicted_values_baseline[-len(predictions_baseline):] = predictions_baseline + create_series = lambda data, name: pd.Series([np.NaN] * (len(historical_data)), name=name).fillna({i: val for i, val in enumerate(data, len(historical_data)-n_predictions)}) + + predictions_dataset = pd.concat([ + historical_data["Date"], + historical_data["Value"].rename("Historical values"), + create_series(predictions_ml, "Predicted values ML"), + create_series(predictions_baseline, "Predicted values Baseline") + ], axis=1) - # Create the predictions dataset - # Columns : [Date, Historical values, Predicted values] - predictions_dataset = pd.concat([temp_df["Date"], - historical_values, - predicted_values_ml, - predicted_values_baseline], axis=1) - return predictions_dataset \ No newline at end of file diff --git a/docs/tutorials/complete_applications/complete_application/src/taipy_application/main.py b/docs/tutorials/complete_applications/complete_application/src/taipy_application/main.py index e59019d04..50c98c7ad 100644 --- a/docs/tutorials/complete_applications/complete_application/src/taipy_application/main.py +++ b/docs/tutorials/complete_applications/complete_application/src/taipy_application/main.py @@ -30,4 +30,4 @@ def on_change(state, var_name: str, var_value): if __name__ == "__main__": tp.Core().run() gui = Gui(pages=pages) - gui.run(title="Taipy Application", port=3455) + gui.run(title="Taipy Application") diff --git a/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.md b/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.md index b19c00bed..a51b31ce3 100644 --- a/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.md +++ b/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.md @@ -17,4 +17,12 @@ <|{scenario}|scenario|on_submission_change=submission_change|> -<|{predictions_dataset}|chart|x=Date|y[1]=Historical values|type[1]=bar|y[2]=Predicted values ML|y[3]=Predicted values Baseline|> \ No newline at end of file +<|{predictions_dataset}|chart|x=Date|y[1]=Historical values|type[1]=bar|y[2]=Predicted values ML|y[3]=Predicted values Baseline|> + +# Data Node Exploration + +<|layout|columns=1 5| +<|{data_node}|data_node_selector|> + +<|{data_node}|data_node|> +|> \ No newline at end of file diff --git a/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.py b/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.py index 836c28e22..43a34fb32 100644 --- a/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.py +++ b/docs/tutorials/complete_applications/complete_application/src/taipy_application/pages/scenario/scenario.py @@ -11,17 +11,22 @@ scenario = None +data_node = None day = dt.datetime(2021, 7, 26) n_predictions = 40 max_capacity = 200 -predictions_dataset = {"Date":[0], +predictions_dataset = {"Date":[dt.datetime(2021, 7, 26)], "Predicted values ML":[0], "Predicted values Baseline":[0], "Historical values":[0]} def submission_change(state, submittable, details: dict): - print(f"submission_change(state, submittable: {submittable}, details: {details})") - notify(state, "info", f"submission_change(state, submittable: {submittable}, details: {details})") + if details['submission_status'] == 'COMPLETED': + notify(state, "success", 'Scenario completed!') + state['scenario'].on_change(state, 'scenario', state.scenario) + else: + notify(state, "error", 'Something went wrong!') + def save(state): print("Saving scenario...") @@ -44,7 +49,7 @@ def on_change(state, var_name, var_value): state.max_capacity = state.scenario.max_capacity.read() if state.scenario.full_predictions.is_ready_for_reading: - state.predictions_dataset = state.scenario.full_predictions.read() + state.predictions_dataset = state.scenario.full_predictions.read()[-200:] else: state.predictions_dataset = predictions_dataset diff --git a/docs/tutorials/complete_applications/complete_application/step_02/step_02.md b/docs/tutorials/complete_applications/complete_application/step_02/step_02.md index e03b86219..329355487 100644 --- a/docs/tutorials/complete_applications/complete_application/step_02/step_02.md +++ b/docs/tutorials/complete_applications/complete_application/step_02/step_02.md @@ -85,14 +85,17 @@ containing the date, historical values, ML predicted values, and baseline predic ```python def create_predictions_dataset(predictions_baseline, predictions_ml, day, n_predictions, cleaned_data): - .... - - # Columns : [Date, Historical values, Predicted values (ml and baseline)] - predictions_dataset = pd.concat([temp_df["Date"], - historical_values, - predicted_values_ml, - predicted_values_baseline], axis=1) + print("Creating predictions dataset...") + ... + + predictions_dataset = pd.concat([ + historical_data["Date"], + historical_data["Value"].rename("Historical values"), + create_series(predictions_ml, "Predicted values ML"), + create_series(predictions_baseline, "Predicted values Baseline") + ], axis=1) + return predictions_dataset ``` @@ -100,7 +103,7 @@ def create_predictions_dataset(predictions_baseline, predictions_ml, day, n_pred Chaining all the functions together can be represented as a following graph: -![Execution Graph](config_toml.png){ width=300 style="margin:auto;display:block" } +![Execution Graph](config_toml.png){ width=700 style="margin:auto;display:block" } ```python # For the sake of clarity, we have used an AutoRegressive model rather than a pure ML model such as: @@ -153,28 +156,19 @@ def compute_metrics(historical_data, predicted_data): def create_predictions_dataset(predictions_baseline, predictions_ml, day, n_predictions, cleaned_data): print("Creating predictions dataset...") - - # Set arbitrarily the time window for the chart as 5 times the number of predictions - window = 5 * n_predictions - + # Create the historical dataset that will be displayed new_length = len(cleaned_data[cleaned_data["Date"] < day]) + n_predictions - temp_df = cleaned_data[:new_length] - temp_df = temp_df[-window:].reset_index(drop=True) - - # Create the series that will be used in the concat - historical_values = pd.Series(temp_df["Value"], name="Historical values") - predicted_values_ml = pd.Series([np.NaN] * len(temp_df), name="Predicted values ML") - predicted_values_ml[-len(predictions_ml):] = predictions_ml - predicted_values_baseline = pd.Series([np.NaN] * len(temp_df), name="Predicted values Baseline") - predicted_values_baseline[-len(predictions_baseline):] = predictions_baseline - - # Create the predictions dataset - # Columns : [Date, Historical values, Predicted values] - predictions_dataset = pd.concat([temp_df["Date"], - historical_values, - predicted_values_ml, - predicted_values_baseline], axis=1) - + historical_data = cleaned_data[:new_length].reset_index(drop=True) + + create_series = lambda data, name: pd.Series([np.NaN] * (len(historical_data)), name=name).fillna({i: val for i, val in enumerate(data, len(historical_data)-n_predictions)}) + + predictions_dataset = pd.concat([ + historical_data["Date"], + historical_data["Value"].rename("Historical values"), + create_series(predictions_ml, "Predicted values ML"), + create_series(predictions_baseline, "Predicted values Baseline") + ], axis=1) + return predictions_dataset ``` \ No newline at end of file diff --git a/docs/tutorials/complete_applications/complete_application/step_03/step_03.md b/docs/tutorials/complete_applications/complete_application/step_03/step_03.md index 6b50e3605..0e68a1d75 100644 --- a/docs/tutorials/complete_applications/complete_application/step_03/step_03.md +++ b/docs/tutorials/complete_applications/complete_application/step_03/step_03.md @@ -58,7 +58,7 @@ of items sold in a given store on a 15-min basis. The graph below represents the scenario to configure, where tasks are in orange and data nodes in blue. -![Configuration](config_toml.png){ width=300 style="margin:auto;display:block" } +![Configuration](config_toml.png){ width=700 style="margin:auto;display:block" } ### Input Data Nodes configuration @@ -193,7 +193,7 @@ from algos.algos import * path_to_csv = "data/dataset.csv" -# Datanodes (3.1) +# Datanodes ## Input Data Nodes initial_dataset_cfg = Config.configure_data_node(id="initial_dataset", storage_type="csv", @@ -220,9 +220,7 @@ full_predictions_cfg = Config.configure_data_node(id="full_predictions") metrics_baseline_cfg = Config.configure_data_node(id="metrics_baseline") metrics_ml_cfg = Config.configure_data_node(id="metrics_ml") -# Functions (3.2) - -# Tasks (3.3) +# Tasks clean_data_task_cfg = Config.configure_task(id="task_clean_data", function=clean_data, input=initial_dataset_cfg, diff --git a/docs/tutorials/complete_applications/complete_application/step_04/step_04.md b/docs/tutorials/complete_applications/complete_application/step_04/step_04.md index 348c4f402..aaf508f5c 100644 --- a/docs/tutorials/complete_applications/complete_application/step_04/step_04.md +++ b/docs/tutorials/complete_applications/complete_application/step_04/step_04.md @@ -33,9 +33,17 @@ The Scenario Page is constructed using a combination of Markdown and Python code
<|Save|button|on_action=save|active={scenario}|> |> -<|{scenario}|scenario|> +<|{scenario}|scenario|on_submission_change=submission_change|> <|{predictions_dataset}|chart|x=Date|y[1]=Historical values|type[1]=bar|y[2]=Predicted values ML|y[3]=Predicted values Baseline|> + +# Data Node Exploration + +<|layout|columns=1 5| +<|{data_node}|data_node_selector|> + +<|{data_node}|data_node|> +|> ``` The Markdown section outlines the arrangement and elements of the Scenario Page. It consists of the following components: @@ -60,14 +68,18 @@ A number input field where users can set the desired number of predictions to be A button that triggers the "save" action when clicked. It is used to save the selected scenario and parameter values. -- **Scenario Section**: `<|{scenario}|scenario|>` +- **Scenario Section**: `<|{scenario}|scenario|on_submission_change=submission_change|>` -A section that displays information about the currently selected scenario. It includes details about the scenario, properties, and the ability to delete or submit the scenario. +A section that displays information about the currently selected scenario. It includes details about the scenario, properties, and the ability to delete or submit the scenario. When the scenario status is changed, `submission_change` is called with information on the scenario. - **Predictions Chart**: `<|{predictions_dataset}|chart|...|>` A chart that displays historical values and the predicted values obtained from machine learning and baseline methods. It shows how well the predictions align with the historical data. +- **Data Node Exploration**: `<|{data_node}|data_node_selector|> <|{data_node}|data_node_selector|>` + +This is where the detailed information and history about the selected data node is presented. Depending on the nature of the data node, this could display raw data in a tabular format, visualizations, texts, or dates. If the format allows it, the user can directly write new values in the data node. + ## Python Code (pages/scenario/scenario.py) @@ -80,6 +92,7 @@ import pandas as pd scenario = None +data_node = None day = dt.datetime(2021, 7, 26) n_predictions = 40 max_capacity = 200 @@ -88,7 +101,12 @@ predictions_dataset = {"Date":[0], "Predicted values Baseline":[0], "Historical values":[0]} - +def submission_change(state, submittable, details: dict): + if details['submission_status'] == 'COMPLETED': + notify(state, "success", 'Scenario completed!') + state['scenario'].on_change(state, 'scenario', state.scenario) + else: + notify(state, "error", 'Something went wrong!') def save(state): print("Saving scenario...") @@ -125,7 +143,7 @@ It includes the following components: - **Global Variables**: -The global variables *scenario*, *day*, *n_predictions*, *max_capacity*, and *predictions_dataset* are defined. These variables store the initial state of the application. +The global variables *scenario*, *data_node*, *day*, *n_predictions*, *max_capacity*, and *predictions_dataset* are defined. These variables store the initial state of the application. - **Save Function**: @@ -134,6 +152,10 @@ When the user clicks the "Save" button, this function gets activated. It receives the page's state as input, converts the date format to the correct one, adjusts the scenario parameters accordingly, and then informs the user with a success message. +- **Submission Status Change** + +The `submission_change` function is designed to handle feedback when a scenario submission completes. It takes in the current state, the submitted object, and details regarding the submission. If the submission is successful ('*COMPLETED*'), it sends a success notification to the user and triggers an update on the *scenario* object. In the event of a failure, it provides an error notification, alerting the user that something went wrong. + - **On Change Function**: The `on_change` function is called when any variable on the page changes its value. It monitors the changes in the scenario variable and updates the other variables accordingly. It also checks if the *full_predictions* are ready for reading and updates the *predictions_dataset*` accordingly.