Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tfields
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Boeckenhoff
tfields
Commits
3fe8d037
Commit
3fe8d037
authored
3 years ago
by
dboe
Browse files
Options
Downloads
Patches
Plain Diff
Some formatting, pre-commit working black
parent
80eca49f
No related branches found
No related tags found
No related merge requests found
Pipeline
#135980
passed
3 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.pre-commit-config.yaml
+2
-1
2 additions, 1 deletion
.pre-commit-config.yaml
tfields/triangles_3d.py
+6
-7
6 additions, 7 deletions
tfields/triangles_3d.py
with
8 additions
and
8 deletions
.pre-commit-config.yaml
+
2
−
1
View file @
3fe8d037
...
...
@@ -23,6 +23,7 @@ repos:
-
id
:
detect-private-key
-
id
:
end-of-file-fixer
-
repo
:
https://github.com/asottile/blacken-docs
rev
:
v1.1
0.0
rev
:
v1.1
2.1
hooks
:
-
id
:
blacken-docs
additional_dependencies
:
[
black==22.3.0
]
This diff is collapsed.
Click to expand it.
tfields/triangles_3d.py
+
6
−
7
View file @
3fe8d037
...
...
@@ -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
,)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment