Commit 54e21d40 authored by Lucas Bourneuf's avatar Lucas Bourneuf

export api for compiling toward dotfile

parent 90aa72ef
from .script import Script from .script import Script
from .core import run, single_image_from_filenames, multiple_images_from_filenames, gif_from_filenames, compile_to_single_image, compile_to_images, compile_context_to_dots from .core import run, single_image_from_filenames, multiple_images_from_filenames, gif_from_filenames, compile_to_single_image, compile_to_images, compile_context_to_dots, compile_context_to_dot
from .module_loader import build_scripts_from_file, build_scripts_from_dir from .module_loader import build_scripts_from_file, build_scripts_from_dir
......
...@@ -163,3 +163,11 @@ def compile_context_to_dots(context:str, nb_model:int=0) -> [str]: ...@@ -163,3 +163,11 @@ def compile_context_to_dots(context:str, nb_model:int=0) -> [str]:
solve_context(context, nb_model=nb_model) solve_context(context, nb_model=nb_model)
) )
yield from dot_writer.multiple_graphs_from_configs(configs) yield from dot_writer.multiple_graphs_from_configs(configs)
def compile_context_to_dot(context:str, nb_model:int=0) -> str:
"Return a dot string for all found model"
configs = asp_to_dot.visual_config_from_asp(
solve_context(context, nb_model=nb_model)
)
return dot_writer.one_graph_from_configs(configs)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment