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
6d276b75
Commit
6d276b75
authored
3 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
fix gradients of ZongGaussianDeficit and CarbajofuertesGaussianDeficit
parent
f0ca5ed8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py_wake/deficit_models/gaussian.py
+1
-1
1 addition, 1 deletion
py_wake/deficit_models/gaussian.py
py_wake/utils/gradients.py
+11
-0
11 additions, 0 deletions
py_wake/utils/gradients.py
with
12 additions
and
1 deletion
py_wake/deficit_models/gaussian.py
+
1
−
1
View file @
6d276b75
from
numpy
import
newaxis
as
na
from
scipy.special
import
erf
from
py_wake.utils.gradients
import
erf
import
numpy
as
np
from
py_wake.deficit_models
import
DeficitModel
from
py_wake.deficit_models.deficit_model
import
ConvectionDeficitModel
...
...
This diff is collapsed.
Click to expand it.
py_wake/utils/gradients.py
+
11
−
0
View file @
6d276b75
...
...
@@ -21,6 +21,8 @@ from scipy.interpolate._cubic import PchipInterpolator as scipy_PchipInterpolato
from
itertools
import
count
from
scipy.interpolate
import
UnivariateSpline
as
scipy_UnivariateSpline
from
scipy.special
import
erf
as
scipy_erf
from
autograd.scipy.special
import
erf
as
autograd_erf
def
asarray
(
x
,
dtype
=
None
,
order
=
None
):
...
...
@@ -304,6 +306,15 @@ class UnivariateSpline(scipy_UnivariateSpline):
return
y
def
erf
(
z
):
if
isinstance
(
z
,
ArrayBox
):
return
autograd_erf
(
z
)
else
:
return
scipy_erf
(
z
)
# def get_dtype(arg_lst):
# return (float, np.complex128)[any([np.iscomplexobj(v) for v in arg_lst])]
def
trapz
(
y
,
x
,
axis
=-
1
):
if
isinstance
(
y
,
ArrayBox
)
or
isinstance
(
x
,
ArrayBox
):
x
,
y
=
asarray
(
x
),
asarray
(
y
)
...
...
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