Rest API - Set CPU count

Need help setting the CPU parameters when calling the Pollination API. Any documentation on this topic?

I imagine there is a method to do this somewhere? Seeing an example would be very helpful.

Some context from my script:

if __name__ == '__main__':
    project = Payload.Create(
        name=project_name,
        description='A test project',
        public=False
    )
    res: Any = create_project(client, project)
    print(res.json())
    recipe_filter: Payload.RecipeFilter = Payload.RecipeFilter(
        owner='ladybug-tools',
        name='annual-daylight',
        tag='0.9.13'
    )
    # ...
    job: Payload.Job = Payload.Job(source=recipe_source_url, arguments=arguments)
    res: Any = client.create_job(project.name, job)
    # ...

Hi @jriise,

Here is a code sample that shows how to submit a study to Pollination using the API:

The daylighting recipes have an input for cpu_count that can be used to set the number of CPUs for the run. See these lines in the code.

recipe_inputs = {
    'model': None,
    'model_id': None,
    'min-sensor-count': 1000,
    'cpu-count': 20 # you can set the number of CPUs here
}

Let me know if you have any other questions.

1 Like