Avaiga / taipy-gui

Graphical User Interface generator for Taipy
Apache License 2.0
60 stars 20 forks source link

BUG-Scenario config with id "default" does not appear in scenario_selector configurations #995

Closed arcanaxion closed 1 year ago

arcanaxion commented 1 year ago

Description Scenario config with id "default" does not appear in scenario_selector configurations.

How to reproduce

import taipy as tp
from taipy import Config

x_cfg = Config.configure_pickle_data_node(id="x", default_data=5)
y_cfg = Config.configure_data_node(id="y")

def square(x): 
    return x**2
task1_cfg = Config.configure_task(id="task1", function=square, input=x_cfg, output=y_cfg)

scenario_cfg = Config.configure_scenario(id="default", task_configs=[task1_cfg])

selected_scenario = None
md = """<|{selected_scenario}|scenario_selector|>"""

if __name__ == "__main__":
    tp.Core().run()
    tp.Gui(md).run()

Expected behavior The scenario should show up in the scenario_selector configuration list -- or Config.configure_scenario should raise an error if the id is reserved.

Screenshots

image

Runtime environment Please specify relevant indications.

jrobinAV commented 1 year ago

Hello,

Indeed 'default' is a restricted config_id. Taipy core should prevent you from building such a scenario config. Here is a taipy-core ticket to improve user experience on that. https://github.com/Avaiga/taipy/issues/411 Please feel free to add comments on it.

I am closing the ticket for duplication.