Skip to content

Commit 4aac40b

Browse files
authored
Merge pull request openPMD#423 from fchapoton/some_typos
fix a bunch of typos (found by codespell)
2 parents 01b6426 + 373259c commit 4aac40b

File tree

8 files changed

+28
-26
lines changed

8 files changed

+28
-26
lines changed

docs/source/tutorials/1_Introduction-to-the-API.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"- A 2D array containing the values of the requested field.\n",
151151
"- An object containing metainformation about the extent of the grid (e.g `info_rho.z` and `info_rho.x` respectively return an array of the z and x positions).\n",
152152
"\n",
153-
"These two objects can then be used in a Python environnement to perform numerical analysis."
153+
"These two objects can then be used in a Python environment to perform numerical analysis."
154154
]
155155
},
156156
{
@@ -208,7 +208,7 @@
208208
"source": [
209209
"### Additional documentation\n",
210210
"\n",
211-
"Additional documentation on `get_field` can be obtained by reading its docstring. This can be done for instance by executing the following command in an IPython environnement."
211+
"Additional documentation on `get_field` can be obtained by reading its docstring. This can be done for instance by executing the following command in an IPython environment."
212212
]
213213
},
214214
{
@@ -351,7 +351,7 @@
351351
"source": [
352352
"### Missing or inconsistent arguments\n",
353353
"\n",
354-
"As for the fieds, if an argument is missing or inconsistent, an exception will be raised and an helper message will be printed."
354+
"As for the fields, if an argument is missing or inconsistent, an exception will be raised and an helper message will be printed."
355355
]
356356
},
357357
{
@@ -361,7 +361,7 @@
361361
"source": [
362362
"### Additional documentation\n",
363363
"\n",
364-
"As for the `get_field` method, the documentation on `get_particle` can be obtained by reading its docstring. This can be done for instance by executing the following command in an IPython environnement."
364+
"As for the `get_field` method, the documentation on `get_particle` can be obtained by reading its docstring. This can be done for instance by executing the following command in an IPython environment."
365365
]
366366
},
367367
{

docs/source/tutorials/5_Laser-plasma_tools.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
"metadata": {},
356356
"source": [
357357
"#### Laser $a_0$\n",
358-
"A method to calculate the laser strenght a0 as given by $$a0 = E_{max} e / (m_e c \\omega)$$"
358+
"A method to calculate the laser strength a0 as given by $$a0 = E_{max} e / (m_e c \\omega)$$"
359359
]
360360
},
361361
{

openpmd_viewer/addons/pic/lpa_diagnostics.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def get_sigma_gamma_slice(self, dz, t=None, iteration=None, species=None,
227227
plot : bool, optional
228228
Whether to plot the requested quantity
229229
230-
**kw : dict, otional
230+
**kw : dict, optional
231231
Additional options to be passed to matplotlib's `plot` method
232232
233233
Returns
@@ -270,7 +270,7 @@ def get_sigma_gamma_slice(self, dz, t=None, iteration=None, species=None,
270270

271271
def get_charge( self, t=None, iteration=None, species=None, select=None ):
272272
"""
273-
Calculate the charge of the selcted particles.
273+
Calculate the charge of the selected particles.
274274
275275
Parameters
276276
----------
@@ -411,7 +411,7 @@ def get_emittance(self, t=None, iteration=None, species=None,
411411
raise ValueError('Argument `kind` not recognized.')
412412
if description not in ['projected', 'slice-averaged', 'all-slices']:
413413
raise ValueError('Argument `description` not recognized.')
414-
# Wheter to compute slice emittance
414+
# Whether to compute slice emittance
415415
do_slice_emittance = ( description in ['slice-averaged',
416416
'all-slices'] )
417417
if do_slice_emittance and not nslices > 0:
@@ -496,11 +496,11 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
496496
plot : bool, optional
497497
Whether to plot the requested quantity
498498
499-
**kw : dict, otional
499+
**kw : dict, optional
500500
Additional options to be passed to matplotlib's `plot` method
501501
Returns
502502
-------
503-
A tuple of arrays containig
503+
A tuple of arrays containing
504504
- The current in each bin in Ampere
505505
- A FieldMetaInformation object
506506
(see object's docstring for more details)
@@ -511,7 +511,7 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
511511
var_list=['z', 'uz', 'uy', 'ux', 'w', 'charge'],
512512
t=t, iteration=iteration,
513513
species=species, select=select )
514-
# Length to be seperated in bins
514+
# Length to be separated in bins
515515

516516
if w.size > 0:
517517
min_z = np.min(z)
@@ -520,7 +520,7 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
520520
gamma = np.sqrt(1 + ux ** 2 + uy ** 2 + uz ** 2)
521521
# Calculate particle velocities
522522
vz = uz / gamma * const.c
523-
# Length to be seperated in bins
523+
# Length to be separated in bins
524524
len_z = np.max(z) - np.min(z)
525525
vzq_sum, _ = np.histogram(z, bins=bins, weights=(vz * w * q))
526526
# Calculate the current in each bin
@@ -611,7 +611,7 @@ def get_laser_envelope( self, t=None, iteration=None, pol=None,
611611
along the 1st axis (first list) and 2nd axis (second list)
612612
Default: plots the full extent of the simulation box
613613
614-
**kw : dict, otional
614+
**kw : dict, optional
615615
Additional options to be passed to matplotlib's `plot`(1D) or
616616
`imshow` (2D) method
617617
@@ -757,7 +757,7 @@ def get_spectrum( self, t=None, iteration=None, pol=None,
757757
plot: bool, optional
758758
Whether to plot the data
759759
760-
**kw : dict, otional
760+
**kw : dict, optional
761761
Additional options to be passed to matplotlib's `plot` method
762762
763763
Returns
@@ -1016,7 +1016,7 @@ def get_spectrogram( self, t=None, iteration=None, pol=None,
10161016
plot: bool, optional
10171017
Whether to plot the spectrogram
10181018
1019-
**kw : dict, otional
1019+
**kw : dict, optional
10201020
Additional options to be passed to matplotlib's `imshow` method
10211021
10221022
Returns

openpmd_viewer/openpmd_timeseries/data_reader/data_reader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, backend):
5959
def list_iterations(self, path_to_dir):
6060
"""
6161
Return a list of the iterations that correspond to the files
62-
in this directory. (The correspondance between iterations and
62+
in this directory. (The correspondence between iterations and
6363
files is stored internally.)
6464
6565
Parameter
@@ -107,7 +107,8 @@ def list_iterations(self, path_to_dir):
107107
file_path = path_to_dir
108108
series_name = file_path
109109
else:
110-
# match last occurance of integers and replace with %T wildcards
110+
# match last occurrence of integers and replace
111+
# with %T wildcards
111112
# examples: data00000100.h5 diag4_00000500.h5 io12.0.bp
112113
# te42st.1234.yolo.json scan7_run14_data123.h5
113114
file_path = re.sub(r'(\d+)(\.(?!\d).+$)', r'%T\2', first_file_name)

openpmd_viewer/openpmd_timeseries/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_particle(self, var_list=None, species=None, t=None, iteration=None,
200200
particles affects neighboring bins.
201201
`cic` (which is the default) leads to smoother results than `ngp`.
202202
203-
**kw : dict, otional
203+
**kw : dict, optional
204204
Additional options to be passed to matplotlib's
205205
hist or hist2d.
206206
@@ -425,7 +425,7 @@ def get_field(self, field=None, coord=None, t=None, iteration=None,
425425
along the 1st axis (first list) and 2nd axis (second list)
426426
Default: plots the full extent of the simulation box
427427
428-
**kw : dict, otional
428+
**kw : dict, optional
429429
Additional options to be passed to matplotlib's imshow.
430430
431431
Returns
@@ -555,7 +555,7 @@ def iterate( self, called_method, *args, **kwargs ):
555555
Arguments that would normally be passed to `called_method` for
556556
a single iteration. Do not pass the argument `t` or `iteration`.
557557
"""
558-
# Add the iteration key in the keyword aguments
558+
# Add the iteration key in the keyword arguments
559559
kwargs['iteration'] = self.iterations[0]
560560

561561
# Check the shape of results

openpmd_viewer/openpmd_timeseries/particle_tracker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def __init__(self, ts, species=None, t=None,
8787
In this case, a NaN is returned at the index of this particle.
8888
When `preserve_particle_index=False`, no NaN is returned (the
8989
returned array is simply smaller when particles are absent) but
90-
then it is not garanteed that a given particle keeps the same index
90+
then it is not guaranteed that a given particle keeps the same
91+
index
9192
"""
9293

9394
# Extract or load the particle id and sort them
@@ -220,7 +221,7 @@ def get_extraction_indices( self, pid ):
220221
sorted_pid = pid[ original_indices ]
221222

222223
# Extract only the indices for which sorted_pid is one of pid
223-
# in self.sselected_pid (i.e. which correpond to one
224+
# in self.sselected_pid (i.e. which correspond to one
224225
# of the original particles)
225226
selected_indices = np.empty( self.N_selected, dtype=np.int64 )
226227
N_extracted = extract_indices(

openpmd_viewer/openpmd_timeseries/plotter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def hist1d(self, q1, w, quantity1, species, current_i, nbins, hist_range,
145145
particles affects neighboring bins.
146146
`cic` (which is the default) leads to smoother results than `ngp`.
147147
148-
**kw : dict, otional
148+
**kw : dict, optional
149149
Additional options to be passed to matplotlib's bar function
150150
"""
151151
# Check if matplotlib is available
@@ -222,7 +222,7 @@ def hist2d(self, q1, q2, w, quantity1, quantity2, species, current_i,
222222
particles affects neighboring bins.
223223
`cic` (which is the default) leads to smoother results than `ngp`.
224224
225-
**kw : dict, otional
225+
**kw : dict, optional
226226
Additional options to be passed to matplotlib's imshow function
227227
"""
228228
# Check if matplotlib is available
@@ -411,7 +411,7 @@ def print_cic_unavailable():
411411

412412
def check_matplotlib():
413413
"""Raise error messages or warnings when potential issues when
414-
potenial issues with matplotlib are detected."""
414+
potential issues with matplotlib are detected."""
415415

416416
if not matplotlib_installed:
417417
raise RuntimeError( "Failed to import the openPMD-viewer plotter.\n"

openpmd_viewer/openpmd_timeseries/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def construct_3d_from_circ( F3d, Fcirc, x_array, y_array, modes,
336336
else:
337337
raise Exception(order_error_msg)
338338

339-
# Loop over all modes and recontruct data
339+
# Loop over all modes and reconstruct data
340340
if r == 0:
341341
expItheta = 1. + 0.j
342342
else:

0 commit comments

Comments
 (0)