diff --git a/.jenkins/check/config/filter_pylint.txt b/.jenkins/check/config/filter_pylint.txt index 31a788375aa2a75e87598805941414ae7d197cfd..e6face5cd10644c331599769fa568049d46acae6 100644 --- a/.jenkins/check/config/filter_pylint.txt +++ b/.jenkins/check/config/filter_pylint.txt @@ -1,2 +1,3 @@ #tools -"docs/tools/generate_html" \ No newline at end of file +"docs/tools/generate_html" +"docs/tools/ci_pipeline_gate_APIView" \ No newline at end of file diff --git a/docs/mindspore/_ext/overwrite_autodoc.txt b/docs/mindspore/_ext/overwrite_autodoc.txt index ba9ae3881609fa5f2a4a193b55439c08e54246d8..cde2f70668f4de05c8e34aac156f7342199eafdb 100644 --- a/docs/mindspore/_ext/overwrite_autodoc.txt +++ b/docs/mindspore/_ext/overwrite_autodoc.txt @@ -581,7 +581,7 @@ class Documenter: mint_doc = re.sub(f'(>>> .*?){j[0]}', rf'\1{j[1]}', mint_doc) break if not re.findall(f'>>> .*?{usename}', mint_doc): - mint_doc = re.sub(rf'(>>> .*?)(ops|nn)\.[\w\.]*?{b_name}(_ext|_ext_view)?(?!\w)', rf'\1{usename}', mint_doc) + mint_doc = re.sub(rf'(>>> .*?)(ops|nn)\.[\w\.]*?{b_name}(_ext|_ext_view|_view)?(?!\w)', rf'\1{usename}', mint_doc) if re.findall(rf'>>> .*?ops\.\w+\(', mint_doc): mint_doc = re.sub('(>>> from mindspore import .*?)(ops|nn)', r'\1mint, ops', mint_doc) mint_doc = mint_doc.replace('>>> import mindspore.ops as ops', '>>> from mindspore import mint, ops') diff --git a/docs/mindspore/_ext/overwriteobjectiondirective.txt b/docs/mindspore/_ext/overwriteobjectiondirective.txt index a67ccb886db4eab7d3c39dd49eedafc89514d9dd..20b2df48ffa48c2d242b71c63380574653ff2379 100644 --- a/docs/mindspore/_ext/overwriteobjectiondirective.txt +++ b/docs/mindspore/_ext/overwriteobjectiondirective.txt @@ -93,7 +93,7 @@ def get_example(name: str): api_doc = re.sub(f'(>>> .*?){j[0]}', rf'\1{j[1]}', api_doc) break if not re.findall(f'>>> .*?{usename}', api_doc): - api_doc = re.sub(f'(>>> .*?)(ops|nn)\.[\w\.]*?{b_name}(Ext|_ext|_ext_view)?(?!\w)', rf'\1{usename}', api_doc) + api_doc = re.sub(f'(>>> .*?)(ops|nn)\.[\w\.]*?{b_name}(Ext|_ext|_ext_view|_view)?(?!\w)', rf'\1{usename}', api_doc) if re.findall(rf'>>> .*?ops\.\w+\(', api_doc): api_doc = re.sub('(>>> from mindspore import .*?)(ops|nn)', r'\1mint, ops', api_doc) api_doc = api_doc.replace('>>> import mindspore.ops as ops', '>>> from mindspore import mint, ops') diff --git a/tools/ci_pipeline_gate_APIView/generate_pr_html.py b/tools/ci_pipeline_gate_APIView/generate_pr_html.py index 1e09131c00dd53c6466a01e300b171d3e6139bcd..4bb0028cd5efe7ca497656731284ac77aa830123 100644 --- a/tools/ci_pipeline_gate_APIView/generate_pr_html.py +++ b/tools/ci_pipeline_gate_APIView/generate_pr_html.py @@ -522,13 +522,16 @@ def en_file_handle(py_file_list, repo_path, dict1): if mpn[0] in repo_py_path: if k.endswith('.'): fullname = mpn[1] + '.' + k.replace('.', '') - if fullname.endswith('_ext') and mpn[1] == 'mindspore.ops': - new_fullname = 'mindspore.mint.' + fullname[:-4].split('.')[-1] - generate_interface_list.append( - '.. autofunction:: ' + new_fullname + f'&&&{i[0]}') - new_fullname = 'mindspore.mint.nn.functional.' + fullname[:-4].split('.')[-1] - generate_interface_list.append( - '.. autofunction:: ' + new_fullname + f'&&&{i[0]}') + if fullname.endswith(('_ext', '_view')) and mpn[1] == 'mindspore.ops': + b_name = fullname.rsplit('.', 1)[-1] + if b_name.endswith('_ext'): + simple_name = b_name[:-4] # 去掉 _ext + else: + simple_name = b_name[:-5] # 去掉 _view + for prefix in ('mindspore.mint.', 'mindspore.mint.nn.functional.'): + generate_interface_list.append( + f'.. autofunction:: {prefix}{simple_name}&&&{i[0]}') + elif fullname == 'mindspore.dataset.dataloader.collate': new_fullname = 'mindspore.dataset.dataloader._utils.collate.collate' generate_interface_list.append(