diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c21671d..a0c4fbce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: '^.*external.*$' repos: -- repo: https://github.com/psf/black - rev: 22.12.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black args: [ @@ -9,7 +9,7 @@ repos: ] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort args: [ @@ -21,12 +21,12 @@ repos: ] - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.4.1 hooks: - id: codespell @@ -39,14 +39,14 @@ repos: # exclude: "tests/" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: check-merge-conflict - id: debug-statements # this validates our github workflow files - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.19.2 + rev: 0.36.0 hooks: - id: check-github-workflows diff --git a/benchmark/data/process_data.py b/benchmark/data/process_data.py index 8b66e54d..37f2d0ff 100644 --- a/benchmark/data/process_data.py +++ b/benchmark/data/process_data.py @@ -49,7 +49,7 @@ "multiply_matrices", ] -for (test_type, x_axis) in zip(test_types, x_axis_tests): +for test_type, x_axis in zip(test_types, x_axis_tests): print("Plotting %s test..." % test_type) diff --git a/benchmark/tests/python/test_tools.py b/benchmark/tests/python/test_tools.py index 79ccada3..bca5e28f 100644 --- a/benchmark/tests/python/test_tools.py +++ b/benchmark/tests/python/test_tools.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" Tools for BM tests """ +"""Tools for BM tests""" from random import random, seed @@ -49,6 +49,7 @@ # Initialize our seed seed(1) + # Create the random value generator def gen_value(): return MIN + (random() * (MAX - MIN)) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8c115e26..2fbcffba 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,4 +1,5 @@ """Sphinx documentation configuration file.""" + from datetime import datetime from sphinx_gallery.sorting import FileNameSortKey diff --git a/doc/validate_png.py b/doc/validate_png.py index 820ecce2..4494993e 100644 --- a/doc/validate_png.py +++ b/doc/validate_png.py @@ -2,6 +2,7 @@ Removes invalid PNGs (probably GIF) """ + from glob import glob import os diff --git a/src/ansys/eigen/python/rest/client.py b/src/ansys/eigen/python/rest/client.py index a3fccc09..fc94dc2c 100644 --- a/src/ansys/eigen/python/rest/client.py +++ b/src/ansys/eigen/python/rest/client.py @@ -232,7 +232,7 @@ def __perform_operation(self, arg1, arg2, arg_dim, ops): Returns ------- numpy.ndarray - Tesult of the operation requested between arg1 and arg2. + Result of the operation requested between arg1 and arg2. """ # At this point we must check if we are dealing with a vector or a matrix... # and proceed to perform the requested operation @@ -281,7 +281,7 @@ def __post_resource(self, arg, resource): json={"value": arg.tolist()}, auth=(self._user, self._pwd), ) - except (requests.exceptions.ConnectionError): + except requests.exceptions.ConnectionError: raise RuntimeError( "Could not connect to server... Check server status or connection details." ) @@ -333,7 +333,7 @@ def __get_ops_resource(self, id1, id2, ops, resource): json={"id1": id1, "id2": id2}, auth=(self._user, self._pwd), ) - except (requests.exceptions.ConnectionError): + except requests.exceptions.ConnectionError: raise RuntimeError( "Could not connect to server... Check server status or connection details." ) diff --git a/src/ansys/eigen/python/testing/test_tools.py b/src/ansys/eigen/python/testing/test_tools.py index 3a06180f..d3b587a9 100644 --- a/src/ansys/eigen/python/testing/test_tools.py +++ b/src/ansys/eigen/python/testing/test_tools.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tools for tests """ +"""Tools for tests""" from random import random, seed @@ -49,6 +49,7 @@ # Initialize the seed seed(1) + # Create the random value generator def gen_value(): return MIN + (random() * (MAX - MIN)) diff --git a/tests/test_rest_server.py b/tests/test_rest_server.py index b969f094..3a0bbb27 100644 --- a/tests/test_rest_server.py +++ b/tests/test_rest_server.py @@ -80,7 +80,8 @@ def test_server_ops_vectors(testing_client): def test_server_ops_matrices(testing_client): """Unit test to verify that the server returns the expected response - when performing the addition and multiplication of two numpy arrays (as matrices).""" + when performing the addition and multiplication of two numpy arrays (as matrices). + """ # Define your matrices mat_1 = np.array([[1, 2], [3, 4]], dtype=np.float64)