Skip to content

Commit 238b856

Browse files
authored
Merge branch 'main' into docs/add_latest_changes
2 parents 1183597 + 5c52cc3 commit 238b856

File tree

6 files changed

+45
-32
lines changed

6 files changed

+45
-32
lines changed

.github/workflows/autodoc_cicd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: "Install Git and checkout project"
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
with:
3030
persist-credentials: false
3131

3232
- name: "Setup Python"
33-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
33+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3434
with:
3535
python-version: ${{ env.MAIN_PYTHON_VERSION }}
3636

@@ -44,7 +44,7 @@ jobs:
4444
4545
# The token will expire in 2024.
4646
- name: "Checkout mapdl-cmd-doc repository"
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848
with:
4949
repository: ansys-internal/mapdl-cmd-doc
5050
ref: feat/pyconverter-xml2py-predifined-format
@@ -74,7 +74,7 @@ jobs:
7474
needs: [generate-code]
7575
steps:
7676
- name: Download autogenerated documentation
77-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
77+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
7878
with:
7979
name: package
8080

@@ -94,7 +94,7 @@ jobs:
9494
needs: [auto-doc-code-style]
9595
steps:
9696
- name: Download autogenerated documentation
97-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
97+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
9898
with:
9999
name: package
100100

.github/workflows/ci_cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ jobs:
122122

123123
steps:
124124
- name: "Install Git and checkout project"
125-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
126126
with:
127127
persist-credentials: false
128128

129129
- name: "Setup Python"
130-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
130+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
131131
with:
132132
python-version: ${{ env.MAIN_PYTHON_VERSION }}
133133

@@ -146,7 +146,7 @@ jobs:
146146
147147
# The token will expire in 2025.
148148
- name: "Checkout mapdl-cmd-doc repository"
149-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
149+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
150150
with:
151151
repository: ansys-internal/mapdl-cmd-doc
152152
ref: feat/pyconverter-xml2py-predifined-format
@@ -184,12 +184,12 @@ jobs:
184184
needs: [doc-style]
185185
steps:
186186
- name: "Install Git and checkout project"
187-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
187+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
188188
with:
189189
persist-credentials: false
190190

191191
- name: "Setup Python"
192-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
192+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
193193
with:
194194
python-version: ${{ env.MAIN_PYTHON_VERSION }}
195195

@@ -278,7 +278,7 @@ jobs:
278278
steps:
279279

280280
- name: "Download the library artifacts from build-library step"
281-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
281+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
282282
with:
283283
name: ${{ env.PACKAGE_NAME }}-artifacts
284284
path: ${{ env.PACKAGE_NAME }}-artifacts

.github/workflows/label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
pull-requests: write
2424
issues: write
2525
steps:
26-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
persist-credentials: false
2929
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Label based on modified files
4343
- name: Label based on changed files
44-
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
44+
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
4545
with:
4646
repo-token: ${{ secrets.GITHUB_TOKEN }}
4747
sync-labels: true

_package/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ doc = [
4545
"pydata_sphinx_theme==0.16.1",
4646
"pypandoc==1.15",
4747
"pytest-sphinx==0.6.3",
48-
"pyyaml==6.0.2",
48+
"pyyaml==6.0.3",
4949
"sphinx-autobuild==2024.10.3",
5050
"sphinx-autodoc-typehints==3.2.0",
5151
"sphinx-copybutton==0.5.2",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ tests = [
4444
"black>=24.2.0",
4545
"click==8.2.1",
4646
"inflect==7.5.0",
47-
"pygithub==2.6.1",
47+
"pygithub==2.8.1",
4848
"lxml==5.3.0",
4949
"numpy==2.2.6",
5050
"parse==1.20.2",
51-
"pytest==8.4.1",
51+
"pytest==8.4.2",
5252
"pytest-cov==6.2.1",
5353
"pytest-rerunfailures==15.1",
5454
"pyyaml==6.0.2",

src/pyconverter/xml2py/ast_tree.py

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
"Caret 40?": "",
5555
'``"``': "``",
5656
"/_nolinebreak?": "",
57+
"/_nolinebreak ?": "",
5758
"_nolinebreak?": "",
59+
"_nolinebreak ?": "",
5860
"nbsp": " ",
5961
}
6062

@@ -700,7 +702,7 @@ def find(self, _type, terms=None):
700702
"""Find the first type matching a given type string."""
701703
for item in self:
702704
if type(item).__name__ == _type:
703-
if _type == "Refname" or _type == "Refnamediv":
705+
if _type == "Refname":
704706
if terms == None:
705707
logging.error("ERROR: terms are not defined for a 'Refname' class.")
706708
item.terms = terms
@@ -712,7 +714,9 @@ def find_all(self, _type, recursive=False, terms=None):
712714
items = []
713715
for item in self:
714716
if type(item).__name__ == _type:
715-
if _type == "Refname" or _type == "Refnamediv":
717+
if _type == "Refname":
718+
if not terms:
719+
logging.error("ERROR: terms are not defined for a 'Refname' class.")
716720
item.terms = terms
717721
items.append(item)
718722
elif recursive and isinstance(item, Element):
@@ -3093,7 +3097,21 @@ def arg_desc(self) -> List[Argument]:
30933097
refsyn = self.rec_find("Refsynopsisdiv")
30943098
# search by ID
30953099
arguments = None
3096-
if refsyn is None:
3100+
if refsyn and "Variablelist" in refsyn.children_types:
3101+
for elem in refsyn:
3102+
if isinstance(elem, Variablelist):
3103+
if arguments is None:
3104+
arguments = ArgumentList(
3105+
self.py_name, self.url, self._terms, elem, self.args
3106+
)
3107+
else:
3108+
arguments += ArgumentList(
3109+
self.py_name, self.url, self._terms, elem, self.args
3110+
)
3111+
if isinstance(elem, Paragraph):
3112+
self._is_paragraph_in_arg_desc = True
3113+
3114+
else:
30973115
refsections = self.find_all("RefSection")
30983116
for elem in refsections:
30993117
for child in elem:
@@ -3109,19 +3127,14 @@ def arg_desc(self) -> List[Argument]:
31093127
if isinstance(child, Paragraph):
31103128
self._is_paragraph_in_arg_desc = True
31113129

3112-
else:
3113-
for elem in refsyn:
3114-
if isinstance(elem, Variablelist):
3115-
if arguments is None:
3116-
arguments = ArgumentList(
3117-
self.py_name, self.url, self._terms, elem, self.args
3118-
)
3119-
else:
3120-
arguments += ArgumentList(
3121-
self.py_name, self.url, self._terms, elem, self.args
3122-
)
3123-
if isinstance(elem, Paragraph):
3124-
self._is_paragraph_in_arg_desc = True
3130+
# Check whether arguments have been caught
3131+
if not arguments:
3132+
refnamediv = self.find("Refnamediv")
3133+
available_arguments = refnamediv[0].get_children_by_type("Replaceable")
3134+
if available_arguments:
3135+
arguments = ArgumentList(
3136+
self.py_name, self.url, self._terms, available_arguments, self.args
3137+
)
31253138

31263139
arg_file = Path("args.txt")
31273140

0 commit comments

Comments
 (0)