Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NTRfC
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
TFD - Institut für Turbomaschinen und Fluid-Dynamik
tools
NTRfC
Commits
a43e2927
Commit
a43e2927
authored
2 years ago
by
Malte Nyhuis
Browse files
Options
Downloads
Patches
Plain Diff
fix tests for unitvector computations
parent
4b0802e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Merge recent changes in master to we_ahrens
Pipeline
#8319
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/math/test_ntrfc_vectorcalc.py
+7
-4
7 additions, 4 deletions
tests/math/test_ntrfc_vectorcalc.py
with
7 additions
and
4 deletions
tests/math/test_ntrfc_vectorcalc.py
+
7
−
4
View file @
a43e2927
import
numpy
as
np
import
numpy
as
np
from
ntrfc.math.vectorcalc
import
unitvec_list
def
test_absVec
():
def
test_absVec
():
import
numpy
as
np
import
numpy
as
np
...
@@ -90,15 +88,20 @@ def test_vecAbs_list():
...
@@ -90,15 +88,20 @@ def test_vecAbs_list():
def
test_unitvec_list
():
def
test_unitvec_list
():
from
ntrfc.math.vectorcalc
import
unitvec_list
a
=
np
.
array
([
1
,
0
,
0
])
a
=
np
.
array
([
1
,
0
,
0
])
b
=
np
.
array
([
0
,
0
,
9
])
b
=
np
.
array
([
0
,
0
,
9
])
c
=
np
.
stack
([
a
,
b
])
c
=
np
.
stack
([
a
,
b
])
directions
=
unitvec_list
(
c
)
directions
=
unitvec_list
(
c
)
assert
directions
[
0
]
==
np
.
array
([
1
,
0
,
0
])
assert
all
(
np
.
equal
(
directions
[
0
]
,
np
.
array
([
1
,
0
,
0
])
))
assert
directions
[
1
]
==
np
.
array
([
0
,
0
,
1
])
assert
all
(
np
.
equal
(
directions
[
1
]
,
np
.
array
([
0
,
0
,
1
])
))
def
test_unitvec
():
def
test_unitvec
():
from
ntrfc.math.vectorcalc
import
unitvec
a
=
np
.
array
([
9
,
0
,
0
])
a
=
np
.
array
([
9
,
0
,
0
])
am
=
unitvec
(
a
)
am
=
unitvec
(
a
)
assert
all
(
np
.
equal
(
am
,
np
.
array
([
1
,
0
,
0
])))
b
=
np
.
array
([
0
,
0
,
-
9
])
b
=
np
.
array
([
0
,
0
,
-
9
])
bm
=
unitvec
(
b
)
assert
all
(
np
.
equal
(
bm
,
np
.
array
([
0
,
0
,
-
1
])))
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