Data Model
Data model classes definition used throughout FarmVibes.AI.
- class vibe_core.datamodel.Message(message, id=None, location=None)
Bases:
objectDataclass that represents an API message.
- class vibe_core.datamodel.MetricsDict
Bases:
TypedDictType definition for metrics dictionary.
- class vibe_core.datamodel.MonitoredWorkflowRun(workflow, name, id, status, task_details)
Bases:
objectDataclass that represents the monitored workflow run information.
- class vibe_core.datamodel.Region(name, geojson=<factory>)
Bases:
objectDataclass that represents a region.
- class vibe_core.datamodel.RunBase(name, workflow, parameters)
Bases:
objectBase dataclass for a run.
- class vibe_core.datamodel.RunConfig(name, workflow, parameters, user_input, id, details, task_details, spatio_temporal_json, output='', history_compacted=False)
Bases:
RunConfigInputDataclass that represents a run config.
- set_output(value)
Set the output of the run config.
- Parameters:
value (Dict[str, List[Dict[str, Any]] | Dict[str, Any]]) – The value to set the output to.
- class vibe_core.datamodel.RunConfigInput(name, workflow, parameters, user_input)
Bases:
RunBaseDataclass that represents a run config input.
- class vibe_core.datamodel.RunConfigUser(name, workflow, parameters, user_input, id, details, task_details, spatio_temporal_json, output='', history_compacted=False)
Bases:
RunConfigDataclass that represents a run config for the user.
- static finished(status)
Check if a run has finished.
This method checks if a given status is either
vibe_core.datamodel.RunStatus.done,vibe_core.datamodel.RunStatus.cancelled, orvibe_core.datamodel.RunStatus.failed.- Parameters:
status (RunStatus) – The status to check.
- Returns:
Whether the run has finished.
- classmethod from_runconfig(run_config)
Create a
RunConfigUserfrom aRunConfig.- Parameters:
run_config (RunConfig) – The run config to create the user run config from.
- Returns:
The user run config.
- class vibe_core.datamodel.RunDetails(start_time=None, submission_time=None, end_time=None, reason=None, status=RunStatus.pending, subtasks=None)
Bases:
objectDataclass that encapsulates the details of a run.
- class vibe_core.datamodel.RunStatus(*values)
Bases:
StrEnumEnum that represents the status of a run.
- static finished(status)
Check if a run has finished.
This method checks if a run status is either
vibe_core.datamodel.RunStatus.done,vibe_core.datamodel.RunStatus.cancelled, orvibe_core.datamodel.RunStatus.failed.- Parameters:
status (RunStatus) – The status to check.
- Returns:
Whether the run has finished.
- class vibe_core.datamodel.SpatioTemporalJson(start_date, end_date, geojson)
Bases:
objectDataclass that represents a spatio temporal json.
- class vibe_core.datamodel.TaskDescription(inputs=<factory>, outputs=<factory>, parameters=<factory>, task_descriptions=<factory>, short_description='', long_description='')
Bases:
objectDataclass that represents a task description.
- class vibe_core.datamodel.WorkflowRun
Bases:
ABCAn abstract base class for workflow runs.
- abstract property output: List[ForwardRef('BaseVibe')]]
Get the output of the workflow run.
- Returns:
The output of the workflow run as a
vibe_core.data.BaseVibeDict.- Raises:
NotImplementedError – If the method is not implemented by a subclass.
- abstract property status: str
Get the status of the workflow run.
- Returns:
The status of the workflow run as a string.
- Raises:
NotImplementedError – If the method is not implemented by a subclass.
- vibe_core.datamodel.decode(data)
Decode the given data using zlib and base64 encodings.
- Parameters:
data (str) – The string to decode.
- Returns:
The decoded string.
- Return type:
str
- vibe_core.datamodel.encode(data)
Encode a string using zlib and base64 encoding.
This function compresses the data string with zlib and then encodes it into a base64 string.
- Parameters:
data (str) – The string to be encoded.
- Returns:
The encoded string.
- Return type:
str