Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
15.51k stars 1.86k forks source link

[šŸ› BUG] taipy 4.0 scenario multiple reruns #2014

Open sumanth-tccc opened 1 month ago

sumanth-tccc commented 1 month ago

What went wrong? šŸ¤”

Taipy 4.0 multiple times it is rerunning and the whole process is 10x slower now

Steps to Reproduce Issue

import taipy as tp
from taipy.gui import Gui
from src.config.config import *
from taipy import Config 
from src.pages.root import *
from src.constants import *

if __name__ == '__main__':

    # Load configuration
    Config.configure_job_executions(mode="standalone", max_nb_of_workers  =1 )
    Config.load('src/config/config.toml')
    scenario_cfg = Config.scenarios['nielsen_top_40']

    pages = {
    "/": root,
    "Databases": databases,
    "Data-Visualization-New": data_visualization_new,
    "Visualization-Hierarchy": visualization_hierarchy, 
    "Emerging-Brands": emerging_brands,
    "Projection-Trends": projection_trends,

    }

    tp.Orchestrator().run()

    if tp.get_scenarios() == []:
        print('create_scenario')
        scenario = tp.create_scenario(scenario_cfg)
        print(scenario)
        tp.submit(scenario)
    else:
        print('get_scenario')
        scenario = tp.get_scenarios()[0]

    top40_country_list = TOP_40_MARKET_LS

    # Read datasets
    raw_dataset = scenario.raw_dataset.read()

    stylekit = {
        "color_primary":"#F40009",
        "highlight-row": "#F40009",
    }

    gui = Gui(pages=pages)
    gui.run(gui, title="NSP", dark_mode=False, port=8494, stylekit=stylekit ) 

Screenshots

DESCRIPTION

Code of Conduct

jrobinAV commented 1 month ago

Hi, @sumanth-tccc

Thank you for the feedback. We are going to look at this quickly. Could you also share your toml configuration so we can easily reproduce your situation? Any environment details could also help.

Thank you in advance.

sumanth-tccc commented 1 month ago

Hi @jrobinAV This is happening on gui.run(gui, title="NSP", dark_mode=False, port=8494, debug=True, use_reloader=True, stylekit=stylekit )

With the debug and use_reloader parameters off it is working close as 3.1.1

jrobinAV commented 1 month ago

Oh ok, that helps a lot. Thanks!

FredLL-Avaiga commented 1 month ago

that's the point of the reloader: it reloads if anything changes Maybe we should take a look and see what triggers the reload ?