Avaiga / taipy

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

Open ScenarioConfig API to export a scenario config graph as a picture. #1592

Open jrobinAV opened 3 months ago

jrobinAV commented 3 months ago

The purpose of this issue is to let developers draw a scenario config DAG using matplotlib (or an alternative) and networkx to visualize the graph he just created, helping him understand if it is correct.

Description

In the ScenarioConfig class (located at taipy/core/config/scenario_config.py), we want a new method named draw() that exports the scenario configuration graph (a DAG) as an image file.

The graph comprises the input DataNodeConfigs, the output DataNodeConfigs, and the TaskConfigs as nodes. There is a directed edge from a DatanodeConfig node to a TaskConfig node if and only if the DatanodeConfig is a TaskConfig input. A directed edge is from a TaskConfig node to a DatanodeConfig node if and only if the DatanodeConfig is a TaskConfig input.

Implementation constraint.

If a new package is required (matplotlib?, marmaid?, etc.), it must be made optional. The draw function should check the presence of the package before using it. If the package is not installed, the draw function should log a warning message and return doing nothing else.

https://networkx.org/documentation/stable/reference/drawing.html

FabienLelaquais commented 3 months ago

I certainly don't like this idea, involving both the import of another (large) package but also impacts the global product homogeneity, as Taipy GUI and Taipy Studio already provide ways of representing DAGs. Why chose a technology that we don't already use?

quest-bot[bot] commented 1 month ago

New Quest! image New Quest!

A new Quest has been launched in @Avaiga’s repo. Merge a PR that solves this issue to loot the Quest and earn your reward.


Some loot has been stashed in this issue to reward the solver!

🗡 Comment @quest-bot embark to check-in for this Quest and start solving the issue. Other solvers will be notified!

⚔️ When you submit a PR, comment @quest-bot loot #1592 to link your PR to this Quest.

Questions? Check out the docs.

HimangshuYadav commented 1 month ago

@quest-bot loot #1932

quest-bot[bot] commented 1 month ago

⚠️ Oops... You can only loot in a Pull Request!

Check the docs for more info.

HimangshuYadav commented 1 month ago

@quest-bot embark

quest-bot[bot] commented 1 month ago

@HimangshuYadav has embarked on their Quest. 🗡

Questions? Check out the docs.

xyfer17 commented 1 month ago

@jrobinAV could you please assign this issue to me, I would like to take this up.

satyyam11 commented 1 month ago

@quest-bot loot #1592

quest-bot[bot] commented 1 month ago

⚠️ Oops... You can only loot in a Pull Request!

Check the docs for more info.

jrobinAV commented 1 month ago

Yep sure, you are assigned, @xyfer17 .

satyyam11 commented 1 month ago

Hey can you assign me this

xyfer17 commented 1 month ago

@jrobinAV can you please tell me that image format should be a svg or png ( mention if any other format is suitable ), also what would be the warning log message please specify?

jrobinAV commented 1 month ago

@xyfer17 The functionality is really for developers, not for end-users, so I don't think the image format matters. Both svg or png are good. By the way, the format could also be an optional parameter to the draw method with one of the two as a default value.

If you need an external package with a specific version range, and if the package is not installed, the log message could be:

f"Package '{package_name}' between version '{min_version}'and '{max_version}' is required to use the draw method. Please install the package first."