Skip to content

Commit b222cd5

Browse files
committed
build, package and release documentation
1 parent 357ffa7 commit b222cd5

File tree

10 files changed

+32
-44
lines changed

10 files changed

+32
-44
lines changed

.ci/azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189
DISPLAY: ':99.0'
190190
PYANSYS_OFF_SCREEN: True
191191
DPF_PORT: 32772
192-
GH_DOC_BRANCH: 'cbellot/doc_try'
192+
GH_DOC_BRANCH: 'gh-pages'
193193
pool:
194194
vmImage: 'windows-2019'
195195

@@ -225,20 +225,20 @@ jobs:
225225
- powershell: |
226226
git init
227227
git checkout -b $(GH_DOC_BRANCH)
228-
git config --local user.name "pyansys-ci-bot"
229-
git config --local user.email "$(GH_EMAIL)"
230-
git config --local http.https://github.com/.extraheader "AUTHORIZATION: Basic ${GH_PAT}"
228+
git config --global user.name "pyansys-ci-bot"
229+
git config --global user.email "$(GH_EMAIL)"
231230
New-Item -ItemType file .nojekyll
232231
git add .
233232
git commit -m "Documentation generated by $(Build.DefinitionName)"
234233
displayName: "Init git and add docs"
235234
workingDirectory: docs\build\html
236235
237236
- script: |
238-
git remote add origin https://github.com/pyansys/DPF-Core-docs.git
237+
git remote add origin https://$(GH_PAT)@github.com/pyansys/DPF-Core-docs
239238
git push -u origin $(GH_DOC_BRANCH) --force
240239
displayName: "Publish GitHub Pages merge commit"
241240
workingDirectory: docs\build\html
241+
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
242242
243243
- template: templates\kill-servers-windows.yml
244244

.ci/templates/prepare-environment-windows.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ steps:
3333
python -c "from ansys.dpf import core; print(core.Report(gpu=False))"
3434
3535
displayName: Install ansys-dpf-core
36-
37-
- task: PublishBuildArtifacts@1
38-
displayName: 'WHEEL: publish artifacts'
39-
inputs:
40-
PathtoPublish: '$(System.DefaultWorkingDirectory)\dist'
41-
ArtifactName: 'ansys_dpf_core_wheel'
42-
enabled: true
43-
36+
4437
- task: UniversalPackages@0
4538
inputs:
4639
command: 'download'

ansys/dpf/core/check_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def version_tuple(ver):
119119
120120
Parameters
121121
----------
122-
ver : string
122+
ver : str
123123
124124
Returns
125125
-------

ansys/dpf/core/collection.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def set_labels(self, labels):
6666
6767
Parameters
6868
----------
69-
labels : list[string], optional
69+
labels : list[str], optional
7070
labels on which the entries will be scoped, for example:
7171
['time','complex']
7272
@@ -110,7 +110,7 @@ def _get_labels(self):
110110
111111
Returns
112112
-------
113-
labels: list[string]
113+
labels: list[str]
114114
labels on which the entries are scoped, for example:
115115
``['time', 'complex']``
116116
"""
@@ -123,12 +123,13 @@ def has_label(self, label):
123123
124124
Parameters
125125
----------
126-
label: string
126+
label: str
127127
Labels that must be searched, for example ``'time'``.
128128
129129
Returns
130130
-------
131-
bool: True if the specified value have been found in the collection.
131+
bool
132+
``True`` if the specified value has been found in the collection.
132133
133134
Examples
134135
--------
@@ -137,25 +138,19 @@ def has_label(self, label):
137138
>>> coll.add_label('time')
138139
>>> coll.has_label('time')
139140
True
141+
140142
>>> coll.has_label('complex')
141143
False
142144
143145
"""
144-
result = False
145-
labels = self.labels
146-
i = 0
147-
while i < len(labels):
148-
if labels[i] == label:
149-
result = True
150-
i += 1
151-
return result
146+
return label in self.labels
152147

153148
def _get_entries(self, label_space_or_index):
154149
"""Returns the entries at a requested index or label space
155150
156151
Parameters
157152
----------
158-
label_space_or_index : dict[string,int]
153+
label_space_or_index : dict[str,int]
159154
Label space of the requested entry, for example:
160155
``{"time": 1, "complex": 0}`` or index of the field.
161156
@@ -199,7 +194,7 @@ def _get_entry(self, label_space_or_index):
199194
200195
Parameters
201196
----------
202-
label_space_or_index : dict[string,int]
197+
label_space_or_index : dict[str,int]
203198
Label space of the requested entry, for example:
204199
``{"time": 1, "complex": 0}`` or index of the field.
205200
@@ -228,7 +223,7 @@ def get_label_space(self, index):
228223
229224
Returns
230225
-------
231-
label_space : dict(string:int)
226+
label_space : dict(str:int)
232227
Scoping of the requested entry, for example:
233228
``{"time": 1, "complex": 0}``
234229
"""
@@ -320,7 +315,7 @@ def _add_entry(self, label_space, entry):
320315
321316
parameters
322317
----------
323-
label_space : list[string,int]
318+
label_space : list[str,int]
324319
label space of the requested fields, ex : {"time":1, "complex":0}
325320
326321
entry : Field or Scoping

ansys/dpf/core/fields_container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def get_fields(self, label_space):
164164
165165
Parameters
166166
----------
167-
label_space : dict[string,int]
167+
label_space : dict[str,int]
168168
Scoping of the requested fields, for example:
169169
``{"time": 1, "complex": 0}``
170170
@@ -202,7 +202,7 @@ def get_field(self, label_space_or_index):
202202
203203
Parameters
204204
----------
205-
label_space_or_index : dict[string,int] , int
205+
label_space_or_index : dict[str,int] , int
206206
Scoping of the requested fields, for example:
207207
``{"time": 1, "complex": 0}``
208208
or Index of the field.
@@ -305,7 +305,7 @@ def add_field(self, label_space, field):
305305
306306
Parameters
307307
----------
308-
label_space : dict[string,int]
308+
label_space : dict[str,int]
309309
label_space of the requested fields, ex : {"time":1, "complex":0}
310310
311311
field : Field

ansys/dpf/core/fields_container_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def over_time_freq_fields_container(fields, time_freq_unit = None, server = None
2222
fields : Dictionary(time_int_key : Field) or list of Field
2323
Dictionary of Field entities to add to the fields container
2424
25-
time_freq_unit : string , optional
25+
time_freq_unit : str , optional
2626
String that defines the unit symbol of the time_freq_support. Will be taken
2727
into account if the fields attribute has a dictionary type.
2828
@@ -86,7 +86,7 @@ def over_time_freq_complex_fields_container(real_fields, imaginary_fields, time_
8686
imaginary_fields : Dictionary(time_int_key : Field) or list of Field
8787
Dictionary or list of Field entities to add to the fields container
8888
89-
time_freq_unit : string , optional
89+
time_freq_unit : str , optional
9090
String that defines the unit symbol of the time_freq_support. Will be taken
9191
into account if the fields attribute has a dictionary type.
9292

ansys/dpf/core/mesh_scoping_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def named_selection_scoping(named_selection_name, model, server = None):
5858
5959
Parameters
6060
----------
61-
named_selection_name : string
61+
named_selection_name : str
6262
6363
server : server.DPFServer, optional
6464
Server with channel connected to the remote or local instance. When

ansys/dpf/core/meshes_container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_meshes(self, label_space):
4141
4242
Parameters
4343
----------
44-
label_space : dict[string,int]
44+
label_space : dict[str,int]
4545
Meshes corresponding to the filter (label space) in input, for example:
4646
``{"elshape":1, "body":12}``
4747
@@ -58,7 +58,7 @@ def get_mesh(self, label_space_or_index):
5858
5959
Parameters
6060
----------
61-
label_space_or_index : dict[string,int] , int
61+
label_space_or_index : dict[str,int] , int
6262
Scoping of the requested mesh, for example:
6363
``{"time": 1, "complex": 0}``
6464
or Index of the mesh.
@@ -90,7 +90,7 @@ def add_mesh(self, label_space, mesh):
9090
9191
Parameters
9292
----------
93-
label_space : dict[string,int]
93+
label_space : dict[str,int]
9494
label_space of the requested meshes, ex : {"elshape":1, "body":12}
9595
9696
mesh : MeshedRegion

ansys/dpf/core/scopings_container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_scopings(self, label_space):
4141
4242
Parameters
4343
----------
44-
label_space_or_index : dict[string,int] , int
44+
label_space_or_index : dict[str,int] , int
4545
Scopings corresponding to the filter (label space) in input, for example:
4646
``{"elshape":1, "body":12}``
4747
@@ -58,7 +58,7 @@ def get_scoping(self, label_space_or_index):
5858
5959
Parameters
6060
----------
61-
label_space_or_index : dict[string,int] , int
61+
label_space_or_index : dict[str,int] , int
6262
Scopings corresponding to the filter (label space) in input, for example:
6363
``{"elshape":1, "body":12}``
6464
or Index of the scoping.
@@ -90,7 +90,7 @@ def add_scoping(self, label_space, scoping):
9090
9191
Parameters
9292
----------
93-
label_space : dict[string,int]
93+
label_space : dict[str,int]
9494
label_space of the requested scopings, ex : {"elshape":1, "body":12}
9595
9696
scoping : Scoping

ansys/dpf/core/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def ip(self):
332332
333333
Returns
334334
-------
335-
ip : string
335+
ip : str
336336
"""
337337
try:
338338
return self._base_service.server_info["server_ip"]
@@ -358,7 +358,7 @@ def version(self):
358358
359359
Returns
360360
-------
361-
version : string
361+
version : str
362362
"""
363363
return self._base_service.server_info["server_version"]
364364

0 commit comments

Comments
 (0)