Skip to content

Commit

Permalink
maint: migrate codespell config to pyproject.toml. (#3613)
Browse files Browse the repository at this point in the history
* Modify pyproject.toml.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add codespell dependency to pre-commit hook.

* Rename datas as data.

* Update pyproject.toml

Co-authored-by: ansys-reviewer-bot[bot] <143693109+ansys-reviewer-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ansys-reviewer-bot[bot] <143693109+ansys-reviewer-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 27, 2023
1 parent 826289e commit cebebea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ repos:
rev: v2.2.5
hooks:
- id: codespell
args: ["--ignore-words=ignore_words.txt"]
additional_dependencies:
- tomli

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
20 changes: 10 additions & 10 deletions pyaedt/application/Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -2241,21 +2241,21 @@ def _get_boundaries_object(self):
return boundaries

@pyaedt_function_handler()
def _get_ds_data(self, name, datas):
def _get_ds_data(self, name, data):
"""
Parameters
----------
name :
datas :
data :
Returns
-------
"""
units = datas["DimUnits"]
units = data["DimUnits"]
numcol = len(units)
x = []
y = []
Expand All @@ -2264,15 +2264,15 @@ def _get_ds_data(self, name, datas):
if numcol > 2:
z = []
v = []
if "Coordinate" in datas:
for el in datas["Coordinate"]:
if "Coordinate" in data:
for el in data["Coordinate"]:
x.append(el["CoordPoint"][0])
y.append(el["CoordPoint"][1])
if numcol > 2:
z.append(el["CoordPoint"][2])
v.append(el["CoordPoint"][3])
else:
new_list = [datas["Points"][i : i + numcol] for i in range(0, len(datas["Points"]), numcol)]
new_list = [data["Points"][i : i + numcol] for i in range(0, len(data["Points"]), numcol)]
for el in new_list:
x.append(el[0])
y.append(el[1])
Expand All @@ -2290,10 +2290,10 @@ def _get_project_datasets(self):
datasets = {}
try:
for ds in self.project_properties["AnsoftProject"]["ProjectDatasets"]["DatasetDefinitions"]:
datas = self.project_properties["AnsoftProject"]["ProjectDatasets"]["DatasetDefinitions"][ds][
data = self.project_properties["AnsoftProject"]["ProjectDatasets"]["DatasetDefinitions"][ds][
"Coordinates"
]
datasets[ds] = self._get_ds_data(ds, datas)
datasets[ds] = self._get_ds_data(ds, data)
except:
pass
return datasets
Expand All @@ -2304,8 +2304,8 @@ def _get_design_datasets(self):
datasets = {}
try:
for ds in self.design_properties["ModelSetup"]["DesignDatasets"]["DatasetDefinitions"]:
datas = self.design_properties["ModelSetup"]["DesignDatasets"]["DatasetDefinitions"][ds]["Coordinates"]
datasets[ds] = self._get_ds_data(ds, datas)
data = self.design_properties["ModelSetup"]["DesignDatasets"]["DatasetDefinitions"][ds]["Coordinates"]
datasets[ds] = self._get_ds_data(ds, data)
except:
pass
return datasets
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ line_length = 120
default_section = "THIRDPARTY"
src_paths = ["doc", "pyaedt", "_unittests"]

[tool.codespell]
ignore-words = "ignore_words.txt"
skip = """
*.pyc,*.aedt,*.xml,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,\
*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./docs/build/*,./docs/images/*,./dist/*,*~,.hypothesis*,\
./pyaedt/third_party,./docs/source/examples/*,*cover,*.dat,*.mac,PKG-INFO,*.mypy_cache/*,*.xml,*.aedt,*.svg
"""
enable-colors = true

[tool.coverage.run]
source = ["pyaedt"]

Expand All @@ -168,4 +177,3 @@ testpaths = [
]



0 comments on commit cebebea

Please sign in to comment.