diff options
author | Matthew Bentham <Matthew.Bentham@arm.com> | 2019-12-02 12:59:43 +0000 |
---|---|---|
committer | Matthew Bentham <Matthew.Bentham@arm.com> | 2019-12-02 16:23:45 +0000 |
commit | 245d64c60d0ea30f5080ff53225b5169927e24d6 (patch) | |
tree | d623e46d7d5ddb34ef3bb84c45df3ada9209ce82 /python/pyarmnn/scripts | |
parent | 88d5f9f1615fa956464b8932b574d85c37cec937 (diff) | |
download | armnn-experimental/pyarmnn.tar.gz |
Work in progress of python bindings for Arm NNexperimental/pyarmnn
Not built or tested in any way
Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
Change-Id: Ie7f92b529aa5087130f0c5cc8c17db1581373236
Diffstat (limited to 'python/pyarmnn/scripts')
-rw-r--r-- | python/pyarmnn/scripts/generate_docs.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/python/pyarmnn/scripts/generate_docs.py b/python/pyarmnn/scripts/generate_docs.py new file mode 100644 index 0000000000..76c9520083 --- /dev/null +++ b/python/pyarmnn/scripts/generate_docs.py @@ -0,0 +1,47 @@ +import os +import tarfile + +import pyarmnn as ann +import shutil + +from typing import List, Union + +from pdoc.cli import main + + +def __copy_file_to_dir(file_paths: Union[List[str], str], target_dir_path: str): + file_paths = [] + file_paths + + if not (os.path.exists(target_dir_path) and os.path.isdir(target_dir_path)): + os.makedirs(target_dir_path) + + for file_path in file_paths: + if not (os.path.exists(file_path) and os.path.isfile(file_path)): + raise RuntimeError('Not a file: {}'.format(file_path)) + + file_name = os.path.basename(file_path) + shutil.copyfile(file_path, os.path.join(str(target_dir_path), file_name)) + + +def copy_doc_images(): + __copy_file_to_dir(file_paths=['./images/pyarmnn.png' ], + target_dir_path='docs/pyarmnn/images') + + +def archive_docs(path, version): + + output_filename = f'pyarmnn_docs-{version}.tar' + + with tarfile.open(output_filename, "w") as tar: + tar.add(path) + + +if __name__ == "__main__": + with open('./readme.md', 'r') as readme_file: + top_level_pyarmnn_doc = ''.join(readme_file.readlines()) + ann.__doc__ = top_level_pyarmnn_doc + + main() + + copy_doc_images() + archive_docs('./docs', ann.__version__) |