api Package¶
api
Package¶
This module provides the API for fastr that users should use. This API will be
considered stable between major versions. If users only interact via this API
(and refrain from operating on parent
attributes), their code should be
compatible within major version of fastr.
- class fastr.api.ResourceLimit(cores=1, memory='2G', time=None, gpus=None)[source]¶
Bases:
object
- __eq__(other)[source]¶
Check if two resource limits are equal
- Parameters
other – resource limit to test against
- Return type
- __hash__ = None¶
- __init__(cores=1, memory='2G', time=None, gpus=None)[source]¶
An object describing resource requirements/limits for a node
- Parameters
memory (
Union
[str
,int
,None
]) – memory specification, can be int with number of megabytes or a string with numbers ending on M, G, T, P for megabytes, gigabytes, terrabytes or petabytes. Note that the number has to be an integer, e.g. 1500M would work, whereas 1.5G would be invalidtime (
Union
[str
,int
,None
]) – run time specification, this can be an int with the number of seconds or a string in the HH:MM:SS, MM:SS, or SS format. Where HH, MM, and SS are integers representing the number of hours, minutes and seconds.
- __module__ = 'fastr.core.resourcelimit'¶
- __ne__(other)[source]¶
Check if two resource limits are not equal
- Parameters
other – resource limit to test against
- Return type
- __slots__ = ('_cores', '_memory', '_time', '_gpus')¶