Skip to content

Commit 93709e4

Browse files
documentation english corrections (AntSimi#79)
documentation : english corrections
1 parent a499d14 commit 93709e4

File tree

8 files changed

+232
-220
lines changed

8 files changed

+232
-220
lines changed

src/py_eddy_tracker/appli/network.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def build_network():
3737

3838

3939
def divide_network():
40-
parser = EddyParser("Separate path for a same group(network)")
40+
parser = EddyParser("Separate path for a same group (network)")
4141
parser.add_argument("input", help="input network file")
4242
parser.add_argument("out", help="output file")
4343
parser.contour_intern_arg()
@@ -66,7 +66,7 @@ def subset_network():
6666
"--length",
6767
nargs=2,
6868
type=int,
69-
help="Nb of day which must be cover by network, first minimum number of day and last maximum number of day,"
69+
help="Nb of days that must be covered by the network, first minimum number of day and last maximum number of day,"
7070
"if value is negative, this bound won't be used",
7171
)
7272
parser.add_argument(
@@ -85,8 +85,8 @@ def subset_network():
8585
"--period",
8686
nargs=2,
8787
type=int,
88-
help="Start day and end day, if it's negative value we will add to day min and add to day max,"
89-
"if 0 it s not use",
88+
help="Start day and end day, if it's a negative value we will add to day min and add to day max,"
89+
"if 0 it is not used",
9090
)
9191
args = parser.parse_args()
9292
n = NetworkObservations.load_file(args.input, raw_data=True)

src/py_eddy_tracker/dataset/grid.py

Lines changed: 64 additions & 64 deletions
Large diffs are not rendered by default.

src/py_eddy_tracker/generic.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@njit(cache=True)
3131
def count_consecutive(mask):
3232
"""
33-
Count consecutive event every False flag count restart
33+
Count consecutive events every False flag count restart
3434
3535
:param array[bool] mask: event to count
3636
:return: count when consecutive event
@@ -50,7 +50,7 @@ def count_consecutive(mask):
5050
@njit(cache=True)
5151
def reverse_index(index, nb):
5252
"""
53-
Compute a list of index, which are not in index.
53+
Compute a list of indexes, which are not in index.
5454
5555
:param array index: index of group which will be set to False
5656
:param array nb: Count for each group
@@ -65,25 +65,25 @@ def reverse_index(index, nb):
6565

6666
@njit(cache=True)
6767
def build_index(groups):
68-
"""We expected that variable is monotonous, and return index for each step change.
68+
"""We expect that variable is monotonous, and return index for each step change.
6969
70-
:param array groups: array which contain group to be separated
71-
:return: (first_index of each group, last_index of each group, value to shift group)
70+
:param array groups: array that contains groups to be separated
71+
:return: (first_index of each group, last_index of each group, value to shift groups)
7272
:rtype: (array, array, int)
73-
7473
Examples
7574
--------
7675
>>> build_index(array((1, 1, 3, 4, 4)))
7776
(array([0, 2, 2, 3]), array([2, 2, 3, 5]), 1)
7877
"""
78+
7979
i0, i1 = groups.min(), groups.max()
8080
amplitude = i1 - i0 + 1
8181
# Index of first observation for each group
8282
first_index = zeros(amplitude, dtype=numba_types.int_)
8383
for i, group in enumerate(groups[:-1]):
8484
# Get next value to compare
8585
next_group = groups[i + 1]
86-
# if different we need to set index for all group between the 2 values
86+
# if different we need to set index for all groups between the 2 values
8787
if group != next_group:
8888
first_index[group - i0 + 1 : next_group - i0 + 1] = i + 1
8989
last_index = zeros(amplitude, dtype=numba_types.int_)
@@ -95,21 +95,21 @@ def build_index(groups):
9595

9696
@njit(cache=True)
9797
def hist_numba(x, bins):
98-
"""Call numba histogram to speed up."""
98+
"""Call numba histogram to speed up."""
9999
return histogram(x, bins)
100100

101101

102102
@njit(cache=True, fastmath=True, parallel=False)
103103
def distance_grid(lon0, lat0, lon1, lat1):
104104
"""
105-
Get distance for every couple of point.
105+
Get distance for every couple of points.
106106
107107
:param array lon0:
108108
:param array lat0:
109109
:param array lon1:
110110
:param array lat1:
111111
112-
:return: nan value for far away point, and km for other
112+
:return: nan value for far away points, and km for other
113113
:rtype: array
114114
"""
115115
nb_0 = lon0.shape[0]
@@ -164,7 +164,7 @@ def cumsum_by_track(field, track):
164164
Cumsum by track.
165165
166166
:param array field: data to sum
167-
:pram array(int) track: id of track to separate data
167+
:pram array(int) track: id of trajectories to separate data
168168
:return: cumsum with a reset at each start of track
169169
:rtype: array
170170
"""
@@ -192,7 +192,7 @@ def interp2d_geo(x_g, y_g, z_g, m_g, x, y, nearest=False):
192192
:param array m_g: Boolean grid, True if value is masked
193193
:param array x: coordinate where interpolate z
194194
:param array y: coordinate where interpolate z
195-
:param bool nearest: if true we will take nearest pixel
195+
:param bool nearest: if True we will take nearest pixel
196196
:return: z interpolated
197197
:rtype: array
198198
"""
@@ -256,17 +256,17 @@ def interp2d_bilinear(x_g, y_g, z_g, m_g, x, y):
256256
nb_x = x_g.shape[0]
257257
nb_y = y_g.shape[0]
258258
is_circular = abs(x_g[-1] % 360 - (x_g[0] - x_step) % 360) < 1e-5
259-
# Indices which should be never exist
259+
# Indexes that should never exist
260260
i0_old, j0_old, masked = -100000000, -10000000, False
261261
z = empty(x.shape, dtype=z_g.dtype)
262262
for i in prange(x.size):
263263
x_ = (x[i] - x_ref) / x_step
264264
y_ = (y[i] - y_ref) / y_step
265265
i0 = int(floor(x_))
266-
# To keep original value if wrapping apply to compute xd
266+
# To keep original values if wrapping applied to compute xd
267267
i0_ = i0
268268
j0 = int(floor(y_))
269-
# corner are the same need only a new xd and yd
269+
# corners are the same need only a new xd and yd
270270
if i0 != i0_old or j0 != j0_old:
271271
i1 = i0 + 1
272272
j1 = j0 + 1
@@ -288,7 +288,7 @@ def interp2d_bilinear(x_g, y_g, z_g, m_g, x, y):
288288
z_g[i1, j1],
289289
)
290290
masked = False
291-
# Need to be store only on change
291+
# Need to be stored only on change
292292
i0_old, j0_old = i0, j0
293293
if masked:
294294
z[i] = nan
@@ -359,17 +359,17 @@ def flatten_line_matrix(l_matrix):
359359
@njit(cache=True)
360360
def simplify(x, y, precision=0.1):
361361
"""
362-
Will remove all middle/end point which are closer than precision.
362+
Will remove all middle/end points closer than precision.
363363
364364
:param array x:
365365
:param array y:
366-
:param float precision: if two points have distance inferior to precision with remove next point
366+
:param float precision: if two points have distance inferior to precision we remove next point
367367
:return: (x,y)
368368
:rtype: (array,array)
369369
"""
370370
precision2 = precision ** 2
371371
nb = x.shape[0]
372-
# will be True for value keep
372+
# will be True for kept values
373373
mask = ones(nb, dtype=bool_)
374374
for j in range(0, nb):
375375
x_previous, y_previous = x[j], y[j]
@@ -423,7 +423,7 @@ def split_line(x, y, i):
423423
:param y: array
424424
:param i: array of int at each i change, we cut x, y
425425
426-
:return: x and y separate by nan at each i jump
426+
:return: x and y separated by nan at each i jump
427427
"""
428428
nb_jump = len(where(i[1:] - i[:-1] != 0)[0])
429429
nb_value = x.shape[0]
@@ -445,11 +445,11 @@ def split_line(x, y, i):
445445
@njit(cache=True)
446446
def wrap_longitude(x, y, ref, cut=False):
447447
"""
448-
Will wrap contiguous longitude with reference as west bound.
448+
Will wrap contiguous longitude with reference as western boundary.
449449
450450
:param array x:
451451
:param array y:
452-
:param float ref: longitude of reference, all the new value will be between ref and ref + 360
452+
:param float ref: longitude of reference, all the new values will be between ref and ref + 360
453453
:param bool cut: if True line will be cut at the bounds
454454
:return: lon,lat
455455
:rtype: (array,array)
@@ -557,7 +557,7 @@ def local_to_coordinates(x, y, lon0, lat0):
557557
@njit(cache=True, fastmath=True)
558558
def nearest_grd_indice(x, y, x0, y0, xstep, ystep):
559559
"""
560-
Get nearest grid indice from a position.
560+
Get nearest grid index from a position.
561561
562562
:param x: longitude
563563
:param y: latitude
@@ -575,7 +575,7 @@ def nearest_grd_indice(x, y, x0, y0, xstep, ystep):
575575
@njit(cache=True)
576576
def bbox_indice_regular(vertices, x0, y0, xstep, ystep, N, circular, x_size):
577577
"""
578-
Get bbox indice of a contour in a regular grid.
578+
Get bbox index of a contour in a regular grid.
579579
580580
:param vertices: vertice of contour
581581
:param float x0: first grid longitude

src/py_eddy_tracker/gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, *args, **kwargs):
2828

2929
class GUIAxes(PlatCarreAxes):
3030
"""
31-
Axes which will use full space available
31+
Axes that uses full space available
3232
"""
3333

3434
name = "full_axes"

src/py_eddy_tracker/observations/groups.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
def get_missing_indices(
1414
array_time, array_track, dt=1, flag_untrack=True, indice_untrack=0
1515
):
16-
"""return indices where it misses values
16+
"""Return indexes where values are missing
1717
1818
:param np.array(int) array_time : array of strictly increasing int representing time
19-
:param np.array(int) array_track: N° track where observation belong
20-
:param int,float dt: theorical timedelta between 2 observation
19+
:param np.array(int) array_track: N° track where observations belong
20+
:param int,float dt: theorical timedelta between 2 observations
2121
:param bool flag_untrack: if True, ignore observations where n°track equal `indice_untrack`
22-
:param int indice_untrack: n° representing where observations are untrack
22+
:param int indice_untrack: n° representing where observations are untracked
2323
2424
2525
ex : array_time = np.array([67, 68, 70, 71, 74, 75])
26-
array_track= np.array([ 1, 1, 1, 1, 1, 1])
26+
array_track= np.array([ 1, 1, 1, 1, 1, 1])
2727
return : np.array([2, 4, 4])
2828
"""
2929

@@ -72,11 +72,11 @@ def fix_next_previous_obs(self):
7272

7373
@abstractmethod
7474
def get_missing_indices(self, dt):
75-
"find indices where observations is missing"
75+
"Find indexes where observations are missing"
7676
pass
7777

7878
def filled_by_interpolation(self, mask):
79-
"""Filled selected values by interpolation
79+
"""Fill selected values by interpolation
8080
8181
:param array(bool) mask: True if must be filled by interpolation
8282
@@ -102,20 +102,20 @@ def filled_by_interpolation(self, mask):
102102
)
103103

104104
def insert_virtual(self):
105-
"""insert virtual observation on segments where observations were not found"""
105+
"""insert virtual observations on segments where observations are missing"""
106106

107107
dt_theorical = median(self.time[1:] - self.time[:-1])
108108
indices = self.get_missing_indices(dt_theorical)
109109

110110
logger.info("%d virtual observation will be added", indices.size)
111111

112-
# new observation size
112+
# new observations size
113113
size_obs_corrected = self.time.size + indices.size
114114

115-
# correction of indices for new size
115+
# correction of indexes for new size
116116
indices_corrected = indices + arange(indices.size)
117117

118-
# creating mask with indices
118+
# creating mask with indexes
119119
mask = zeros(size_obs_corrected, dtype=bool)
120120
mask[indices_corrected] = 1
121121

@@ -128,12 +128,12 @@ def insert_virtual(self):
128128

129129
def keep_tracks_by_date(self, date, nb_days):
130130
"""
131-
Find tracks which exist at date `date` and lasted at least `nb_days` after.
131+
Find tracks that exist at date `date` and lasted at least `nb_days` after.
132132
133133
:param int,float date: date where the tracks must exist
134-
:param int,float nb_days: number of time where the tracks must exist. Can be negative
134+
:param int,float nb_days: number of times the tracks must exist. Can be negative
135135
136-
If nb_days is negative, it search a tracks which exist at the date,
136+
If nb_days is negative, it searches a track that exists at the date,
137137
but existed at least `nb_days` before the date
138138
"""
139139

0 commit comments

Comments
 (0)