Beispiel #1
0
        "your.utils.gpu.gpu_dedisp_and_dmt_crop",
        "your.utils.gpu.get_gpu_memory_map",
    ],
    "utils/misc.md": [
        "your.utils.misc.crop",
        "your.utils.misc.pad_along_axis",
        "your.utils.misc.MyEncoder",
        "your.utils.misc.YourArgparseFormatter",
    ],
}

# Generate documentation from the installed package
doc_generator = DocumentationGenerator(
    pages, "https://github.com/thepetabyteproject/your/blob/master"
)
doc_generator.generate("./sources")

# Make readme as the start page
shutil.copyfile("../README.md", "sources/index.md")
shutil.copyfile("../CODE_OF_CONDUCT.md", "sources/CODE_OF_CONDUCT.md")
shutil.copyfile("../CONTRIBUTING.md", "sources/CONTRIBUTING.md")

remove_html("sources/index.md")

# Make the dir for tutorials
os.mkdir("sources/ipynb")
for nb in glob.glob("../examples/*ipynb"):
    file_name = os.path.basename(nb)
    os.symlink(os.path.abspath(nb), "sources/ipynb/" + file_name)

# make the dir for bin files and run argmark
Beispiel #2
0
pages = {
    'AutoEncoder.md': [
        "docclean.autoencoder.Autoencoder",
        "docclean.autoencoder.Autoencoder.build_model",
        "docclean.autoencoder.Autoencoder.train_model"
    ],
    'CycleGAN.md':
    ["docclean.cycle_gan.CycleGan", "docclean.cycle_gan.CycleGan.train"],
    'Utils.md': [
        "docclean.utils.ImageMosaic",
        "docclean.utils.ImageMosaic.get_powers_of_two",
        "docclean.utils.ImageMosaic.normalise",
        "docclean.utils.ImageMosaic.extend_image",
        "docclean.utils.ImageMosaic.make_patches",
        "docclean.utils.ImageMosaic.combine_patches",
        "docclean.utils.normed_to_uint8", "docclean.utils.get_png_data",
        "docclean.utils.get_kaggle_paired_data",
        "docclean.utils.get_kaggle_data", "docclean.utils.normalize",
        "docclean.utils.books_crop_and_augment",
        "docclean.utils.kaggle_paired_augment"
    ]
}

doc_generator = DocumentationGenerator(pages)
doc_generator.generate('./sources')

shutil.copyfile('../README.md', 'sources/index.md')
os.makedirs(os.path.dirname('sources/data/'), exist_ok=True)
shutil.copyfile('../data/demo.gif', 'sources/data/demo.gif')
Beispiel #3
0
        ],
        "operators.md": [],
    },
}

repo_package_names = {
    "compute-engine": "larq-compute-engine",
    "larq": "larq",
    "zoo": "larq-zoo",
}

for repo, api_pages in repo_apis.items():
    version = pkg_resources.require(repo_package_names[repo])[0].version
    doc_generator = DocumentationGenerator(
        api_pages,
        project_url=f"https://github.com/larq/{repo}/blob/v{version}",
        template_dir=f"./docs/{repo}/api_page_templates"
        if os.path.exists(f"./docs/{repo}/api_page_templates") else None,
        extra_aliases={
            "tensorflow.python.ops.variables.Variable": "tf.Variable",
            "tensorflow.python.keras.optimizer_v2.optimizer_v2.OptimizerV2":
            "tf.keras.optimizers.Optimizer",
            "tensorflow.python.framework.ops.Tensor": "tf.Tensor",
            "tensorflow.python.keras.engine.training.Model": "tf.keras.Model",
            "tensorflow.python.framework.dtypes.DType": "tf.dtypes.DType",
            "numpy.ndarray": "np.ndarray",
        },
        max_signature_line_length=88,
    )
    doc_generator.generate(f"./docs/{repo}/api")