You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can now code easily. I know all my state variables. I know what is inside my scenario, the attributes, functions, data nodes, tasks, and also what is inside my data nodes.
If you want to test this out; this is the code I created. You only need to put if after the configuration where you should use Config.export("config.toml") for example.
defexport_as_py(filename: str):
withopen(filename, "w") asf:
# Write the necessary importsf.write("from taipy import Scenario, DataNode, Task\n\n")
# Iterate over each scenario configuration in Configforscenario_key, scenario_configinConfig.scenarios.items():
# Create a class name. For example, if scenario_key is "my_scenario",# class might be "My_scenarioScenario". Adjust naming as desired.class_name=f"{scenario_key.lower().capitalize()}Scenario"f.write(f"class {class_name}(Scenario):\n")
# Iterate over all data nodes for the current scenariofordn_configinscenario_config.data_nodes:
# Use the id of the data node as the attribute namedn_name=dn_config.idf.write(f" {dn_name}: DataNode\n")
f.write("\n")
fortask_configinscenario_config.tasks:
# Use the id of the task as the attribute nametask_name=task_config.idf.write(f" {task_name}: Task\n")
# Add a blank line after each class for readabilityf.write(" pass\n")
f.write("\n")
# Config.export("configuration/CoreModels.py")export_as_py("configuration/CoreModels.py")
Impact of Solution
This is just a proposition. I don't know how easy it is to introduce inside the developer workflow.
Acceptance Criteria
If applicable, a new demo code is provided to show the new feature in action.
Integration tests exhibiting how the functionality works are added.
Any new code is covered by a unit tested.
Check code coverage is at least 90%.
Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.
Description
Right now, using Taipy Core with the configuration, we do not get Intellisense linting when coding with the scenario.
We don't know what is inside our scenario, which tasks, and which data nodes, and we have lost a way to have accessible documentation.
This issue is connected with issue: #2024
Solution Proposed
We could propose to have an export to Python file.
This will create a Python file with what is inside the scenario:
If I combine if with my state class that I manually created. (This should be great if this is done automatically)
I can now code easily. I know all my state variables. I know what is inside my scenario, the attributes, functions, data nodes, tasks, and also what is inside my data nodes.
If you want to test this out; this is the code I created. You only need to put if after the configuration where you should use
Config.export("config.toml")
for example.Impact of Solution
This is just a proposition. I don't know how easy it is to introduce inside the developer workflow.
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: