Skip to content

Include docstrings, maybe a schema? #10

@tlambert03

Description

@tlambert03

Love that there is now a central kernels repo. I think it would be great to put as much of the universal information here as possible.

I know it's a lot of work... but it would be great if the kernels here could be documented with a good (parseable) format ... I guess doxygen is the defacto C standard? (not sure there). And then that info wouldn't need to be duplicated (for instance, pyclesperanto.absolute and clij2 Absolute). Adding docstrings here could be a first step.

a related idea (maybe an alternative?) would be to have a very easily parseable schema that that does not require doxygen to parse. The downside there is that we'd need to make sure the kernels were in sync with the schema (we could write tests for that ... but it's possible that the logic for those tests would be as complicated as simply using doxygen to parse in the first place). An example schema:

version: 2.0.0.10
operations:
  - name: absolute
    description: Computes the absolute value of every individual pixel x in a given image.
    details: <pre>f(x) = |x| </pre>
    categories: [filter, in_assistant]
    dimension_support: [2, 3]
    tier: 1
    parameters:
      - name: source
        type: IMAGE_src_TYPE
        description: The input image to be processed.
      - name: destination
        type: IMAGE_dst_TYPE
        description: The output image where results are written into.
    references: ...
  - name: add_image_and_scalar
    ...

(this sort of thing would also make it much easier to create templates that let you convert scripts between languages very easily... as well as facilitate autogeneration of most of the .py files in pyclesperanto)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions