flip.core.factory

FLIP Factory.

This module provides the FLIP() factory function that returns the appropriate FLIP implementation based on job type and environment.

Functions

FLIP(→ flip.core.base.FLIPBase)

Factory function to create appropriate FLIP instance based on job type.

Module Contents

flip.core.factory.FLIP(job_type: flip.constants.job_types.JobType | flip.constants.job_types.JobTypeStr = JobType.STANDARD, **kwargs) flip.core.base.FLIPBase[source]

Factory function to create appropriate FLIP instance based on job type.

This is the main entry point for users to create FLIP instances. The factory automatically selects the correct implementation based on:

  1. The job type (standard, evaluation, fed_opt, diffusion_model)

  2. The environment (LOCAL_DEV or production)

Parameters:
  • job_type – One of “standard”, “evaluation”, “fed_opt”, “diffusion_model” or a JobType enum value. Defaults to “standard”.

  • **kwargs – Additional arguments passed to the constructor

Returns:

FLIPBase – Appropriate FLIP instance for the job type and environment

Examples

Create a standard FLIP instance:

flip = FLIP()
df = flip.get_dataframe(project_id, query)

Create an evaluation-specific FLIP instance:

flip = FLIP(job_type="evaluation")

Use the enum-based job type:

from flip.constants import JobType
flip = FLIP(job_type=JobType.DIFFUSION)