Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cycle sort by creation_date #1554

Merged
merged 1 commit into from
Jul 19, 2024
Merged

cycle sort by creation_date #1554

merged 1 commit into from
Jul 19, 2024

Conversation

FredLL-Avaiga
Copy link
Member

fix filter contains on str
resolves #1546

# Import necessary libraries
import datetime as dt

import taipy as tp
from taipy import Config, Frequency


# Function to run a Dataiku scenario
def run_something(input_1, input_2):
    datetime = dt.datetime.now()
    date = dt.date(2018, 1, 1)
    int_var = 10
    string_var = "String"
    return datetime, date, int_var, string_var


data = {"toto": list(range(10_000)),
        "titi": [2*i for i in range(10_000)],
        "tata": [4*i for i in range(10_000)]}



input_1_cfg = Config.configure_data_node(
    id="input_1_data_node",
    default_data=data,
)


input_2_cfg = Config.configure_data_node(
    id="input_2_data_node",
    default_data=data,
)

datetime_cfg = Config.configure_data_node(id="datetime_data_node")
date_cfg = Config.configure_data_node(id="date_data_node")
int_cfg = Config.configure_data_node(id="int_data_node")
string_cfg = Config.configure_data_node(id="string_data_node")


# Scenario and task configuration in Taipy
scenario_task_cfg = Config.configure_task(
    id="scenario_task",
    function=run_something,
    input=[input_1_cfg, input_2_cfg],
    output=[datetime_cfg, date_cfg, int_cfg, string_cfg]
)

scenario_cfg = Config.configure_scenario(
    id="scenario",
    task_configs=[scenario_task_cfg],
    frequency=Frequency.MONTHLY)

# GUI Markdown content
scenario_md = """
<|{scenario}|scenario_selector|>
"""

# Main execution block with GUI setup
if __name__ == "__main__":
    tp.Core().run()
    scenario = tp.create_scenario(scenario_cfg, name="Scenario April Before 2024", creation_date=dt.datetime(2024, 4, 17))
    scenario = tp.create_scenario(scenario_cfg, name="Scenario April After 2024", creation_date=dt.datetime(2024, 4, 18))
    scenario = tp.create_scenario(scenario_cfg, name="Scenario March 2024", creation_date=dt.datetime(2024, 3, 1))
    scenario = tp.create_scenario(scenario_cfg, name="Scenario May 2024", creation_date=dt.datetime(2024, 5, 1))
    scenario = tp.create_scenario(scenario_cfg, name="Scenario Jan 2024", creation_date=dt.datetime(2024, 1, 9))


    tp.Gui(scenario_md).run(title="1546 Cycle sort")

fix filter contains on str
resolves #1546
@FredLL-Avaiga FredLL-Avaiga added Core Related to Taipy Core 🟥 Priority: Critical Must be addressed as soon as possible 💥Malfunction Addresses an identified problem. 📝Release Notes Impacts the Release Notes Gui: Back-End labels Jul 19, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Jul 19, 2024
Copy link
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
19380 16406 85% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/gui_core/_adapters.py 50% 🟢
taipy/gui_core/_context.py 55% 🟢
TOTAL 53% 🟢

updated for commit: 94d7c27 by action🐍

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

Copy link
Member

@namnguyen20999 namnguyen20999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@dinhlongviolin1 dinhlongviolin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@FredLL-Avaiga FredLL-Avaiga merged commit 43081f7 into develop Jul 19, 2024
156 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the bug/#1546-cycle-sort branch July 19, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to Taipy Core Gui: Back-End 💥Malfunction Addresses an identified problem. 🟥 Priority: Critical Must be addressed as soon as possible 📝Release Notes Impacts the Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve order of cycles in scenario selector
4 participants