Skip to content
Snippets Groups Projects
Commit 3fe8d037 authored by dboe's avatar dboe
Browse files

Some formatting, pre-commit working black

parent 80eca49f
No related branches found
No related tags found
No related merge requests found
Pipeline #135980 passed
......@@ -23,6 +23,7 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- repo: https://github.com/asottile/blacken-docs
rev: v1.10.0
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
......@@ -8,9 +8,9 @@ part of tfields library
"""
import warnings
import typing
import logging
import numpy as np
import tfields
import logging
from tfields.lib.decorators import cached_property
......@@ -112,10 +112,9 @@ class Triangles3D(tfields.TensorFields):
]
else:
item = tfields.Tensors(item)
except IndexError:
except IndexError as err:
logging.warning(
"Index error occured for field.__getitem__. Error "
"message: {err}".format(**locals())
"Index error occured for field.__getitem__. Error message: %s", err
)
return item
......@@ -330,9 +329,9 @@ class Triangles3D(tfields.TensorFields):
) # side length of side opposite to pointA
b = np.linalg.norm(pointC - pointA, axis=1)
c = np.linalg.norm(pointB - pointA, axis=1)
bary1 = a ** 2 * (b ** 2 + c ** 2 - a ** 2)
bary2 = b ** 2 * (a ** 2 + c ** 2 - b ** 2)
bary3 = c ** 2 * (a ** 2 + b ** 2 - c ** 2)
bary1 = a**2 * (b**2 + c**2 - a**2)
bary2 = b**2 * (a**2 + c**2 - b**2)
bary3 = c**2 * (a**2 + b**2 - c**2)
matrices = np.concatenate((pointA, pointB, pointC), axis=1).reshape(
pointA.shape + (3,)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment