Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
PyWake
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
Container Registry
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
TOPFARM
PyWake
Commits
51dc4a3a
Commit
51dc4a3a
authored
4 months ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
Asarray copy
parent
f0d2b219
No related branches found
No related tags found
1 merge request
!611
Asarray copy
Pipeline
#66345
failed
4 months ago
Stage: test
Stage: test_plugins
Stage: deploy
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py_wake/tests/test_sites/test_distances.py
+4
-4
4 additions, 4 deletions
py_wake/tests/test_sites/test_distances.py
py_wake/utils/gradients.py
+3
-2
3 additions, 2 deletions
py_wake/utils/gradients.py
with
7 additions
and
6 deletions
py_wake/tests/test_sites/test_distances.py
+
4
−
4
View file @
51dc4a3a
...
...
@@ -55,7 +55,7 @@ def test_flat_distances(distance):
y
=
[
100
,
100
,
100
,
0
,
0
]
h
=
[
0
,
10
,
20
,
30
,
0
]
z
=
[
0
,
0
,
0
,
0
]
wdirs
=
[
0
,
30
,
90
]
wdirs
=
[
-
1e-1
0
,
30
,
90
+
1e-10
]
site
=
FlatSite
(
distance
=
distance
)
site
.
distance
.
setup
(
src_x_ilk
=
x
,
src_y_ilk
=
y
,
src_h_ilk
=
h
,
src_z_ilk
=
z
)
...
...
@@ -78,9 +78,9 @@ def test_flat_distances(distance):
[[
-
10
,
-
10
,
-
10
]],
[[
-
20
,
-
20
,
-
20
]],
[[
-
30
,
-
30
,
-
30
]]])
npt
.
assert_array_equal
(
dw_indices_lkd
[:,
0
,
:
4
],
[[
2
,
1
,
0
,
3
],
[
2
,
1
,
0
,
3
],
[
2
,
3
,
1
,
0
]])
npt
.
assert_array_equal
(
dw_indices_lkd
[:,
0
,
:],
[[
0
,
1
,
2
,
4
,
3
],
[
2
,
1
,
0
,
3
,
4
],
[
3
,
2
,
1
,
4
,
0
]])
@pytest.mark.parametrize
(
'
distance
'
,
[
StraightDistance
(),
...
...
This diff is collapsed.
Click to expand it.
py_wake/utils/gradients.py
+
3
−
2
View file @
51dc4a3a
...
...
@@ -24,13 +24,14 @@ from scipy.special import gamma as sgamma
from
autograd.scipy.special
import
gamma
as
agamma
def
asarray
(
x
,
dtype
=
None
,
order
=
None
):
def
asarray
(
x
,
dtype
=
None
,
order
=
None
,
**
kwargs
):
# kwargs: copy, like, etc introduced in numpy >=2
if
isinstance
(
x
,
(
ArrayBox
)):
return
x
elif
isinstance
(
x
,
DataArray
)
and
isinstance
(
x
.
values
,
ArrayBox
):
# pragma: no cover
# only needed or called with some versions of xarray
return
x
.
values
return
np_asarray
(
x
,
dtype
,
order
)
return
np_asarray
(
x
,
dtype
,
order
,
**
kwargs
)
# def asanyarray(x, dtype=None, order=None):
...
...
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