Skip to content

Let descriptions method operate on entire namespaces #136

@elevans

Description

@elevans

Context: Jython script

Suppose I want to run a gaussian blur on an net.imglib2.img.Img but I don't know the op signature filter.gauss. Let's say that I know that the gaussian blur op is in the filter namespace but I'm unsure if its gauss or gaussian. In this scenario it would be great to have a mechanism to return all ops in a given namespace.

Current behavior:

# get op environment
from org.scijava.ops.api import OpEnvironment
ops = OpEnvironment.getEnvironment()

print(ops.descriptions("filter"))

Output:

[]

Proposed behavior:

# get op environment
from org.scijava.ops.api import OpEnvironment
ops = OpEnvironment.getEnvironment()

print(ops.descriptions("filter"))

Output:

[filter.addNoise(), filter.bilateral(), filter.convolve(), filter.gauss(), filter.hessian(), filter.ifft(), filter.max(), ...]

With this behavior I can easily find that the op signature I want in the filter namespace is filter.gauss(). I don't think we need to return all the possible input parameters for the ops as that will create an unruly list. Instead I think just returning the signature is fine. The user can get the description of the specific op for parameter information if they desire.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions