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

Add optional docs_info str to task models #874

Closed
jluethi opened this issue Dec 13, 2024 · 6 comments
Closed

Add optional docs_info str to task models #874

jluethi opened this issue Dec 13, 2024 · 6 comments

Comments

@jluethi
Copy link
Collaborator

jluethi commented Dec 13, 2024

We should add a docs_info str to the task models. The purpose is that developers can specify a single, markdown formatted string that describes the functionality of their task. This is useful to show under the info button on the task page (public & in Fractal servers). If it's filled out, the docs_info entry in the manifest is filled with that.

Screenshot 2024-12-13 at 10 14 34

Currently, we just show the task docstring as docs_info. We could just improve docstrings to become more user-friendly. But sometimes developers want dev-related info in the docstrings.
Plus, having a single docs_info field in the task models that's filled in the task list will allow us to provide a single summary for compound tasks, instead of combining the docstrings.

Screenshot 2024-12-13 at 10 14 20

Given how these info panels are currently displayed, the content of docs_info can be multiple sentences without an issue.

Screenshot 2024-12-13 at 10 20 02

If we can also adapt to not show the titles quite so large or not default to setting titles based on docstring info parsed at all, that would further help clean up the interface

@tcompa
Copy link
Collaborator

tcompa commented Dec 13, 2024

I think it will be fairly simple to add this to the manifest-building script. In principle I think that no other changes in fractal-server or fractal-web are needed.

The main question is where this string is stored.

  1. We can start by storing the full markdown string in the task_list.py module, but it's not really usable if one wants to build (and preview locally) some more complex markdown file.
  2. We can define some custom pattern for the task_list.py objects. E.g. if one sets docs_info="file:relative/path/to/some/file.md, then the manifest-building script use the contents of that file as a docs_info.

Could you provide a basic example for one of the fractal-tasks-core tasks, so that?

@tcompa
Copy link
Collaborator

tcompa commented Dec 13, 2024

If we can also adapt to not show the titles quite so large or not default to setting titles based on docstring info parsed at all

If the user provides a full string, then that one will fully override the original one.
As per the current automatically-generated ones, I'll change the style of the generated markdown.

@tcompa
Copy link
Collaborator

tcompa commented Dec 16, 2024

The updates in #876 are now released as fractal-tasks-core 1.3.4, and live at https://fractal-analytics-platform.github.io/fractal_tasks - see e.g.
image
image

@jluethi
Copy link
Collaborator Author

jluethi commented Dec 16, 2024

Awesome, thanks a lot @tcompa ! This looks great to me, I'll slowly work on getting other tasks packages to adopt this.

Out of curiosity: I someone were to embed an image in the markdown same as we can embed them in READMEs => would that load?

@tcompa
Copy link
Collaborator

tcompa commented Dec 17, 2024

Out of curiosity: I someone were to embed an image in the markdown same as we can embed them in READMEs => would that load?

Yes, it would. For instance with this task-description file

### Purpose

![Fractal_overview](https://github.com/user-attachments/assets/666c8797-2594-4b8e-b1d2-b43fca66d1df)

- **Segments images using Cellpose models**.
- Supports both **built-in Cellpose models** (shipped with Cellpose) and **user-trained models**.
- Accepts dual image input for segmentation.
- Can process **arbitrary regions of interest (ROIs)**, including whole images, fields of view (FOVs), or masked outputs from prior segmentations, based on corresponding ROI tables.
- Provides access to all advanced Cellpose parameters.
- Allows custom rescaling options per channel, particularly useful for sparse images.


<p align="center">
  <img src="https://raw.githubusercontent.com/fractal-analytics-platform/fractal-logos/refs/heads/main/projects/fractal_server.png" alt="Fractal server" width="400">
</p>

### Limitations
- Compatible only with Cellpose 2.x models; does not yet support 3.x models.

you obtain this info modal
image

@jluethi
Copy link
Collaborator Author

jluethi commented Dec 17, 2024

Awesome, thanks for testing this! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants