Skip to content

mdjob

mdjob

Module for generating mkdocs str for jobs

Functions

get_job_md

get_job_md(job, include_graph=True)

creates the job markdown

Source code in niceml/mkdocs/mdjob.py
def get_job_md(job: JobDefinition, include_graph: bool = True) -> str:
    """creates the job markdown"""
    job_md: str = f"## Job: `{job.name}`\n\n"

    job_md += job.__doc__ + "\n\n"
    if include_graph:
        graph_md = get_graph_md(job)
        if len(graph_md) > 0:
            job_md += graph_md + "\n\n"
    op_list: List[OpDefinition] = get_ops_from_job(job)
    for cur_op in op_list:
        job_md += get_md_op(cur_op)

    return job_md

get_ops_from_job

get_ops_from_job(job)

Returns all ops from job

Source code in niceml/mkdocs/mdjob.py
def get_ops_from_job(job: JobDefinition) -> List[OpDefinition]:
    """Returns all ops from job"""
    return job.all_node_defs