Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- id: check-github-workflows

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.7
rev: v0.11.11
hooks:
- id: ruff
args: [--fix]
- id: ruff-check
- id: ruff-format
39 changes: 13 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
[build-system]
requires = ["flit_core >=3.2,<3.11"]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "ansys-tools-common"
version = "0.8.dev0"
version = "0.1.dev0"
description = "A set of tools for PyAnsys libraries"
readme = "README.rst"
requires-python = ">=3.10,<4"
license = { file = "LICENSE" }
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }]
maintainers = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Information Analysis",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [

]
dependencies = []

[project.optional-dependencies]

tests = [

]

doc = [

]
tests = []
doc = []

[project.urls]
Source = "https://github.com/ansys/ansys-tools"
Expand All @@ -46,17 +39,9 @@ Releases = "https://github.com/ansys/ansys-tools/releases/"
[tool.flit.module]
name = "ansys.tools"

[tool.black]
line-length = 100

[tool.isort]
profile = "black"
force_sort_within_sections = true
line_length = 100
src_paths = ["doc", "src", "tests"]

[tool.ruff]
line-length = 120
fix = true
extend-exclude = ["examples/**/*.py"]

[tool.ruff.lint]
Expand All @@ -68,12 +53,14 @@ select = [
"N", # pep8-naming, see https://beta.ruff.rs/docs/rules/#pep8-naming-n
"PTH", # flake8-use-pathlib, https://beta.ruff.rs/docs/rules/#flake8-use-pathlib-pth
]
ignore = ["D416"]
ignore = []

[tool.ruff.format]
quote-style = "double"
indent-style = "tab"
indent-style = "space"
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"

[tool.ruff.lint.isort]
combine-as-imports = true
Expand All @@ -82,7 +69,7 @@ known-first-party = ["ansys"]

[tool.ruff.lint.pydocstyle]
# Settings: https://docs.astral.sh/ruff/settings/#lintpydocstyle
convention = "google"
convention = "numpy"

[tool.towncrier]
package = "ansys.tools"
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Main module."""
"""Main module."""
3 changes: 2 additions & 1 deletion src/ansys/tools/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ class AnsysTypeError(AnsysError):
def __init__(self, expected_type: str | type, actual_type: str | type = None) -> None:
"""Initialize the exception with expected and actual types."""
expected_type = expected_type if isinstance(expected_type, str) else expected_type.__name__
actual_type= actual_type if isinstance(actual_type, str) else actual_type.__name__
actual_type = actual_type if isinstance(actual_type, str) else actual_type.__name__
message = f"Expected type {expected_type}, but got {actual_type}."
super().__init__(message)
self.expected_type = expected_type
self.actual_type = actual_type


class AnsysLogicError(AnsysError):
"""Exception raised when an unexpected logical condition occurs.

Expand Down