lapspython.pipeline

Pipe all necessary steps to extract, translate and store programs.

Classes

Pipeline()

Pipelines the entire extraction/translation process of LapsPython.

class lapspython.pipeline.Pipeline[source]

Pipelines the entire extraction/translation process of LapsPython.

classmethod extract_translate(result: dreamcoder.dreamcoder.ECResult, json_path: str = '', mode: str = 'python', verbose: bool = True) lapspython.types.CompactResult[source]

Extract and translate programs from a LAPS result.

Parameters
  • result (dreamcoder.dreamcoder.ECResult) – A LAPS result.

  • json_path (string) – Path to dump or read from json.

Returns

Extracted and translated programs

Return type

lapspython.types.CompactResult

classmethod from_checkpoint(filepath: str, mode='python', verbose=True, save=True) lapspython.types.CompactResult[source]

Load checkpoint, then extract and translate.

Parameters
  • filepath (str) – Checkpoint name in checkpoints directory.

  • mode (str) – Translate to ‘python’ or ‘r’.

  • verbose (bool) – Whether to print statistics and sample translations.

  • save (bool) – Whether to save the results in a JSON file.

Returns

Extracted and translated programs

Return type

lapspython.types.CompactResult