Skip to content

Make ewoksdraw work with any workflow#10

Merged
loichuder merged 1 commit into
mainfrom
ewoksdraw-for-any-workflow
May 29, 2026
Merged

Make ewoksdraw work with any workflow#10
loichuder merged 1 commit into
mainfrom
ewoksdraw-for-any-workflow

Conversation

@loichuder

Copy link
Copy Markdown
Member

The current CLI ewoksdraw generates a random workflow before transforming it to SVG.

This MR allows to load an arbitrary workflow instead and transform it as SVG. Here is an example with the demo workflow of ewokscore:

image

Note: Links are not here since #2 is not done

There is some follow-up to be done as I'll underline in the comments below but I didn't want to bloat the PR too much.

Comment thread src/ewoksdraw/main.py
Comment on lines +16 to +21
parser.add_argument("workflow", type=str, help="Workflow to save to SVG")
parser.add_argument(
"--test",
help="The 'workflow' argument refers to the name of a test graph.",
action="store_true",
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This part could be imported from ewokscore in the future to handle other representations.

This needs some refactoring in ewokscore to expose the needed utilities.

Comment thread src/ewoksdraw/main.py
from faker import Faker
from ewokscore import load_graph
from ewokscore.graph.inputs import _get_all_node_inputs
from ewokscore.graph.inputs import _get_all_task_output_names

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Using private members for now. I'll do some refactoring in ewokscore next week to avoid this.

Comment thread pyproject.toml
requires-python = ">=3.9"
dependencies = [
"reportlab",
"faker",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed faker and added ewokscore since it is needed to load graphs. To be discussed later if we want to keep it like that or not: #7

@loichuder loichuder force-pushed the ewoksdraw-for-any-workflow branch from a78f1f7 to 2dbd044 Compare May 29, 2026 10:51
@loichuder loichuder requested review from a team and LudoBroche May 29, 2026 10:51
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ewoksdraw/main.py 0.00% 21 Missing ⚠️

📢 Thoughts on this report? Let us know!

@woutdenolf

Copy link
Copy Markdown
Member

This MR allows to load an arbitrary workflow instead and transform it as SVG.

Not really, only workflow representations supported by ewokscore. If you want to support all workflows you would need ewoks but ewoks will use ewoksdraw as dependency.

This goes in the direction of the ewoksjob vs. ewoks inter-dependency which we should avoid if possible:

https://github.com/ewoks-kit/ewoks/blob/d03a7aeee136626af3fef15ba345bbedd2d3e7a2/src/ewoks/bindings.py#L137

https://github.com/ewoks-kit/ewoksjob/blob/2aac4b6397249d83913e708f7a55ca32e1b0afb3/pyproject.toml#L33

https://github.com/ewoks-kit/ewoksutils/blob/main/src/ewoksutils/cli_utils/cli_submit_utils.py

I'm not sure having a rich ewoksdraw CLI is worth it. I do understand it helps in development so I'm ok with this PR but to be clear, I don't see the ewoksdraw CLI being used by users.

@woutdenolf woutdenolf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some suggestions but looks good otherwise.

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@loichuder

Copy link
Copy Markdown
Member Author

I'm not sure having a rich ewoksdraw CLI is worth it. I do understand it helps in development so I'm ok with this PR but to be clear, I don't see the ewoksdraw CLI being used by users.

If I understand correctly, you rather view ewoksdraw as a library to be able to generate the SVG in Ewoks packages rather than an utility by itself.

I am OK with that. In that case, I'll rework the interface in a follow-up PR to expose Python functions rather than a CLI.

@loichuder loichuder force-pushed the ewoksdraw-for-any-workflow branch from 2dbd044 to 04e04a0 Compare May 29, 2026 12:36
@loichuder loichuder merged commit bbfd84b into main May 29, 2026
6 checks passed
@loichuder loichuder deleted the ewoksdraw-for-any-workflow branch May 29, 2026 12:40
@loichuder loichuder mentioned this pull request May 29, 2026
@woutdenolf

woutdenolf commented May 30, 2026

Copy link
Copy Markdown
Member

If I understand correctly, you rather view ewoksdraw as a library to be able to generate the SVG in Ewoks packages rather than an utility by itself.

Indeed.

Primary use cases:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants