GithubHelp home page GithubHelp logo

Comments (4)

jeffbaumes avatar jeffbaumes commented on July 18, 2024

Your outputFileName structure has a few incorrect parts. png is not a valid format for type string, you should instead use 'format': 'text'. Also, the string value should be stored in the data field instead of the a field named text. So if you replace your declaration of outputFileName to this it should work properly:

outputFileName = {
        'type': 'string',
        'format': 'text',
        'data': "/home/vagrant/tangelo/tangelo_demo/proj/lennaimage.jpg"
}

from girder_worker.

rbaral avatar rbaral commented on July 18, 2024

Thanks. It worked!
So, is the "data" field the one that is expected all the time? I saw in the image blurring example, the "lenna" object had "url" instead of the "data".
How can I make the worker execute a method instead of the inline script. The document says that we can execute a script or a function. But it doesn't recognize the function when called from inside the script part.

from girder_worker.

jeffbaumes avatar jeffbaumes commented on July 18, 2024

This documentation should be made more clear, but the required fields for specifying input data is described here:

http://girder-worker.readthedocs.io/en/latest/api-docs.html#the-input-specification

Note a few other bits of information that aren't spelled out clearly in the docs:

  • A type field is not required when sending an input to a task. Any supplied type will be ignored, since the task defines the required type of each input. However, the format field is required because the format is allowed to differ from the task spec. If a different format is supplied, the data will be auto-converted before running the task.
  • The mode field is inferred in a few special cases. If there is a url field, the mode is assumed to be "http", and if there is a data field, the mode is assumed to be "inline".

So the following input specs are equivalent:

{
    'format': 'text',
    'data': 'hello'
}
{
    'mode': 'inline',
    'format': 'text',
    'data': 'hello'
}

As well as the following:

{
    'format': 'png',
    'url': 'https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png'
}
{
    'mode': 'http',
    'format': 'png',
    'url': 'https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png'
}

I'll submit a PR to get this documentation in there.

from girder_worker.

rbaral avatar rbaral commented on July 18, 2024

That's cool. Thanks!

from girder_worker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.