Skip to content
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

fix a bunch of typos (found by codespell) #423

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/source/tutorials/1_Introduction-to-the-API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"- A 2D array containing the values of the requested field.\n",
"- 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",
"\n",
"These two objects can then be used in a Python environnement to perform numerical analysis."
"These two objects can then be used in a Python environment to perform numerical analysis."
]
},
{
Expand Down Expand Up @@ -208,7 +208,7 @@
"source": [
"### Additional documentation\n",
"\n",
"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."
"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."
]
},
{
Expand Down Expand Up @@ -351,7 +351,7 @@
"source": [
"### Missing or inconsistent arguments\n",
"\n",
"As for the fieds, if an argument is missing or inconsistent, an exception will be raised and an helper message will be printed."
"As for the fields, if an argument is missing or inconsistent, an exception will be raised and an helper message will be printed."
]
},
{
Expand All @@ -361,7 +361,7 @@
"source": [
"### Additional documentation\n",
"\n",
"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."
"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."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/5_Laser-plasma_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"metadata": {},
"source": [
"#### Laser $a_0$\n",
"A method to calculate the laser strenght a0 as given by $$a0 = E_{max} e / (m_e c \\omega)$$"
"A method to calculate the laser strength a0 as given by $$a0 = E_{max} e / (m_e c \\omega)$$"
]
},
{
Expand Down
20 changes: 10 additions & 10 deletions openpmd_viewer/addons/pic/lpa_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_sigma_gamma_slice(self, dz, t=None, iteration=None, species=None,
plot : bool, optional
Whether to plot the requested quantity

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's `plot` method

Returns
Expand Down Expand Up @@ -270,7 +270,7 @@ def get_sigma_gamma_slice(self, dz, t=None, iteration=None, species=None,

def get_charge( self, t=None, iteration=None, species=None, select=None ):
"""
Calculate the charge of the selcted particles.
Calculate the charge of the selected particles.

Parameters
----------
Expand Down Expand Up @@ -411,7 +411,7 @@ def get_emittance(self, t=None, iteration=None, species=None,
raise ValueError('Argument `kind` not recognized.')
if description not in ['projected', 'slice-averaged', 'all-slices']:
raise ValueError('Argument `description` not recognized.')
# Wheter to compute slice emittance
# Whether to compute slice emittance
do_slice_emittance = ( description in ['slice-averaged',
'all-slices'] )
if do_slice_emittance and not nslices > 0:
Expand Down Expand Up @@ -496,11 +496,11 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
plot : bool, optional
Whether to plot the requested quantity

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's `plot` method
Returns
-------
A tuple of arrays containig
A tuple of arrays containing
- The current in each bin in Ampere
- A FieldMetaInformation object
(see object's docstring for more details)
Expand All @@ -511,7 +511,7 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
var_list=['z', 'uz', 'uy', 'ux', 'w', 'charge'],
t=t, iteration=iteration,
species=species, select=select )
# Length to be seperated in bins
# Length to be separated in bins

if w.size > 0:
min_z = np.min(z)
Expand All @@ -520,7 +520,7 @@ def get_current( self, t=None, iteration=None, species=None, select=None,
gamma = np.sqrt(1 + ux ** 2 + uy ** 2 + uz ** 2)
# Calculate particle velocities
vz = uz / gamma * const.c
# Length to be seperated in bins
# Length to be separated in bins
len_z = np.max(z) - np.min(z)
vzq_sum, _ = np.histogram(z, bins=bins, weights=(vz * w * q))
# Calculate the current in each bin
Expand Down Expand Up @@ -611,7 +611,7 @@ def get_laser_envelope( self, t=None, iteration=None, pol=None,
along the 1st axis (first list) and 2nd axis (second list)
Default: plots the full extent of the simulation box

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's `plot`(1D) or
`imshow` (2D) method

Expand Down Expand Up @@ -757,7 +757,7 @@ def get_spectrum( self, t=None, iteration=None, pol=None,
plot: bool, optional
Whether to plot the data

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's `plot` method

Returns
Expand Down Expand Up @@ -1016,7 +1016,7 @@ def get_spectrogram( self, t=None, iteration=None, pol=None,
plot: bool, optional
Whether to plot the spectrogram

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's `imshow` method

Returns
Expand Down
5 changes: 3 additions & 2 deletions openpmd_viewer/openpmd_timeseries/data_reader/data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, backend):
def list_iterations(self, path_to_dir):
"""
Return a list of the iterations that correspond to the files
in this directory. (The correspondance between iterations and
in this directory. (The correspondence between iterations and
files is stored internally.)

Parameter
Expand Down Expand Up @@ -107,7 +107,8 @@ def list_iterations(self, path_to_dir):
file_path = path_to_dir
series_name = file_path
else:
# match last occurance of integers and replace with %T wildcards
# match last occurrence of integers and replace
# with %T wildcards
# examples: data00000100.h5 diag4_00000500.h5 io12.0.bp
# te42st.1234.yolo.json scan7_run14_data123.h5
file_path = re.sub(r'(\d+)(\.(?!\d).+$)', r'%T\2', first_file_name)
Expand Down
6 changes: 3 additions & 3 deletions openpmd_viewer/openpmd_timeseries/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def get_particle(self, var_list=None, species=None, t=None, iteration=None,
particles affects neighboring bins.
`cic` (which is the default) leads to smoother results than `ngp`.

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's
hist or hist2d.

Expand Down Expand Up @@ -425,7 +425,7 @@ def get_field(self, field=None, coord=None, t=None, iteration=None,
along the 1st axis (first list) and 2nd axis (second list)
Default: plots the full extent of the simulation box

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's imshow.

Returns
Expand Down Expand Up @@ -555,7 +555,7 @@ def iterate( self, called_method, *args, **kwargs ):
Arguments that would normally be passed to `called_method` for
a single iteration. Do not pass the argument `t` or `iteration`.
"""
# Add the iteration key in the keyword aguments
# Add the iteration key in the keyword arguments
kwargs['iteration'] = self.iterations[0]

# Check the shape of results
Expand Down
5 changes: 3 additions & 2 deletions openpmd_viewer/openpmd_timeseries/particle_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def __init__(self, ts, species=None, t=None,
In this case, a NaN is returned at the index of this particle.
When `preserve_particle_index=False`, no NaN is returned (the
returned array is simply smaller when particles are absent) but
then it is not garanteed that a given particle keeps the same index
then it is not guaranteed that a given particle keeps the same
index
"""

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

# Extract only the indices for which sorted_pid is one of pid
# in self.sselected_pid (i.e. which correpond to one
# in self.sselected_pid (i.e. which correspond to one
# of the original particles)
selected_indices = np.empty( self.N_selected, dtype=np.int64 )
N_extracted = extract_indices(
Expand Down
6 changes: 3 additions & 3 deletions openpmd_viewer/openpmd_timeseries/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def hist1d(self, q1, w, quantity1, species, current_i, nbins, hist_range,
particles affects neighboring bins.
`cic` (which is the default) leads to smoother results than `ngp`.

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's bar function
"""
# Check if matplotlib is available
Expand Down Expand Up @@ -222,7 +222,7 @@ def hist2d(self, q1, q2, w, quantity1, quantity2, species, current_i,
particles affects neighboring bins.
`cic` (which is the default) leads to smoother results than `ngp`.

**kw : dict, otional
**kw : dict, optional
Additional options to be passed to matplotlib's imshow function
"""
# Check if matplotlib is available
Expand Down Expand Up @@ -411,7 +411,7 @@ def print_cic_unavailable():

def check_matplotlib():
"""Raise error messages or warnings when potential issues when
potenial issues with matplotlib are detected."""
potential issues with matplotlib are detected."""

if not matplotlib_installed:
raise RuntimeError( "Failed to import the openPMD-viewer plotter.\n"
Expand Down
2 changes: 1 addition & 1 deletion openpmd_viewer/openpmd_timeseries/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def construct_3d_from_circ( F3d, Fcirc, x_array, y_array, modes,
else:
raise Exception(order_error_msg)

# Loop over all modes and recontruct data
# Loop over all modes and reconstruct data
if r == 0:
expItheta = 1. + 0.j
else:
Expand Down
Loading