-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add maximum streamline length property. #6062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b14d46d
c60bfe2
67aa36e
ea75ec1
6cef6bc
e67ade8
ac00e8d
e3d24e8
6695ea9
c014846
4652f7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Maximum streamline length and integration direction can now be specified | ||
------------------------------------------------------------------------ | ||
|
||
This allows to follow the vector field for a longer time and can enhance the visibilty of the flow pattern in some use cases. | ||
This allows to follow the vector field for a longer time and can enhance the | ||
visibility of the flow pattern in some use cases. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None, | |
any number | ||
*maxlength* : float | ||
Maximum length of streamline in axes coordinates. | ||
*integration_direction* : ['foward','backward','both'] | ||
*integration_direction* : ['forward', 'backward', 'both'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you specify the default in the docstring? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, according to numpydoc, it should be braces |
||
Integrate the streamline in forward, backward or both directions. | ||
|
||
Returns: | ||
|
@@ -101,9 +101,9 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None, | |
arrow_kw = dict(arrowstyle=arrowstyle, mutation_scale=10 * arrowsize) | ||
|
||
if integration_direction not in ['both', 'forward', 'backward']: | ||
errstr = ("Integration direction '%s' not recognised." % | ||
integration_direction) | ||
errstr += "Expected 'both', 'forward' or 'backward'." | ||
errstr = ("Integration direction '%s' not recognised." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need a space after the dot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, i fixed it in 7a304de |
||
"Expected 'both', 'forward' or 'backward'." % | ||
integration_direction) | ||
raise ValueError(errstr) | ||
|
||
if integration_direction == 'both': | ||
|
@@ -466,8 +466,8 @@ def integrate(x0, y0): | |
dmap.reset_start_point(x0, y0) | ||
s, xt, yt = _integrate_rk12(x0, y0, dmap, forward_time, maxlength) | ||
if len(x_traj) > 0: | ||
xt = xt[1:] | ||
yt = yt[1:] | ||
xt = xt[1:] | ||
yt = yt[1:] | ||
stotal += s | ||
x_traj += xt | ||
y_traj += yt | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove the "*". They are not helpful for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course i could, but all parameters in this function use the "*". It seems inconsistent if i only remove them for the new "maxlength" parameter?