def test_get_class_methods_aliases(): expected = { 'tests.dummy_package.DataGenerator.flow', 'tests.dummy_package.DataGenerator.flow_from_directory' } computed = set(get_methods('tests.dummy_package.DataGenerator')) assert computed == expected
def test_get_class_methods(): expected = { dummy_module.ImageDataGenerator.flow, dummy_module.ImageDataGenerator.flow_from_directory } computed = get_methods(dummy_module.ImageDataGenerator, return_strings=False) computed = set(computed) assert computed == expected
import shutil from docs_utils import add_all_code_examples, add_links from keras_autodoc import DocumentationGenerator, get_methods from python_on_whales.utils import PROJECT_ROOT a = get_methods( "python_on_whales.components.buildx.imagetools.cli_wrapper.ImagetoolsCLI") print(a) pages = { "docker_client.md": ["python_on_whales.DockerClient"] + get_methods("python_on_whales.docker_client.DockerClient"), "sub-commands/buildx.md": get_methods("python_on_whales.components.buildx.cli_wrapper.BuildxCLI") + get_methods( "python_on_whales.components.buildx.imagetools.cli_wrapper.ImagetoolsCLI" ), "sub-commands/compose.md": get_methods("python_on_whales.components.compose.cli_wrapper.ComposeCLI"), "sub-commands/config.md": get_methods("python_on_whales.components.config.cli_wrapper.ConfigCLI"), "sub-commands/container.md": get_methods( "python_on_whales.components.container.cli_wrapper.ContainerCLI"), "sub-commands/context.md": get_methods("python_on_whales.components.context.cli_wrapper.ContextCLI"), "sub-commands/image.md": get_methods("python_on_whales.components.image.cli_wrapper.ImageCLI"), "sub-commands/manifest.md": get_methods(
import pathlib import shutil import keras_autodoc PAGES = { "project.md": { "connection": ["hsfs.connection.Connection"], "connection_methods": keras_autodoc.get_methods( "hsfs.connection.Connection", exclude=["connection"] ), }, "feature_store.md": { "fs_get": ["hsfs.connection.Connection.get_feature_store"], "fs_properties": keras_autodoc.get_properties( "hsfs.feature_store.FeatureStore" ), "fs_methods": keras_autodoc.get_methods( "hsfs.feature_store.FeatureStore", exclude=["from_response_json"] ), }, "feature.md": { "feature": ["hsfs.feature.Feature"], "feature_properties": keras_autodoc.get_properties("hsfs.feature.Feature"), "feature_methods": keras_autodoc.get_methods( "hsfs.feature.Feature", exclude=["from_response_json", "to_dict"] ), }, "feature_group.md": { "fg_create": ["hsfs.feature_store.FeatureStore.create_feature_group"], "fg_get": ["hsfs.feature_store.FeatureStore.get_feature_group"],
import shutil from docs_utils import add_all_code_examples, add_links from keras_autodoc import DocumentationGenerator, get_methods from python_on_whales.utils import PROJECT_ROOT pages = { "docker_client.md": ["python_on_whales.DockerClient"] + get_methods("python_on_whales.docker_client.DockerClient"), "sub-commands/app.md": get_methods( "python_on_whales.components.app.cli_wrapper.AppCLI" ), "sub-commands/buildx.md": get_methods( "python_on_whales.components.buildx.cli_wrapper.BuildxCLI" ), "sub-commands/compose.md": get_methods( "python_on_whales.components.compose.cli_wrapper.ComposeCLI" ), "sub-commands/config.md": get_methods( "python_on_whales.components.config.cli_wrapper.ConfigCLI" ), "sub-commands/container.md": get_methods( "python_on_whales.components.container.cli_wrapper.ContainerCLI" ), "sub-commands/context.md": get_methods( "python_on_whales.components.context.cli_wrapper.ContextCLI" ), "sub-commands/image.md": get_methods( "python_on_whales.components.image.cli_wrapper.ImageCLI" ),
import shutil from docs_utils import add_all_code_examples, add_links from keras_autodoc import DocumentationGenerator, get_methods from python_on_whales.utils import PROJECT_ROOT pages = { "docker_client.md": ["python_on_whales.DockerClient"] + get_methods("python_on_whales.docker_client.DockerClient"), "sub-commands/app.md": get_methods("python_on_whales.components.app.AppCLI"), "sub-commands/buildx.md": get_methods("python_on_whales.components.buildx.BuildxCLI"), "sub-commands/compose.md": get_methods("python_on_whales.components.compose.ComposeCLI"), "sub-commands/config.md": get_methods("python_on_whales.components.config.ConfigCLI"), "sub-commands/container.md": get_methods("python_on_whales.components.container.ContainerCLI"), "sub-commands/context.md": get_methods("python_on_whales.components.context.ContextCLI"), "sub-commands/image.md": get_methods("python_on_whales.components.image.ImageCLI"), "sub-commands/manifest.md": get_methods("python_on_whales.components.manifest.ManifestCLI"), "sub-commands/network.md": get_methods("python_on_whales.components.network.NetworkCLI"), "sub-commands/node.md": get_methods("python_on_whales.components.node.NodeCLI"), "sub-commands/plugin.md":
def test_generate_markdown(): elements = [dummy_module.Dense, dummy_module.ImageDataGenerator] elements += get_methods(dummy_module.ImageDataGenerator) elements.append(dummy_module.to_categorical) check_against_expected(elements)
from keras_autodoc import DocumentationGenerator import keras_autodoc import shutil client_methods = keras_autodoc.get_methods('flybrainlab.Client.Client') ordered_methods = [ 'flybrainlab.Client.Client', 'flybrainlab.Client.Client.__init__', 'flybrainlab.Client.Client.tryComms', 'flybrainlab.Client.Client.executeNLPquery', 'flybrainlab.Client.Client.executeNAquery' ] client_methods_final = ordered_methods + [ i for i in client_methods if i not in ordered_methods ] pages = { 'client.md': client_methods_final, 'widgets.md': [ 'flybrainlab.widget.CallbackManager', 'flybrainlab.widget.WidgetManager', 'flybrainlab.Client.MetaClient' ] } doc_generator = DocumentationGenerator(pages) doc_generator.generate('./sources') shutil.copyfile('index.md', 'sources/index.md')