Skip to content

Commit

Permalink
Remove redundant defaults from docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccafair committed May 13, 2020
1 parent a1552b2 commit 6ca7dd6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
34 changes: 17 additions & 17 deletions euphonic/force_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def __init__(self, crystal, force_constants, sc_matrix, cell_origins,
The supercell matrix
cell_origins : (n_cells_in_sc, 3) int ndarray
The locations of the unit cells within the supercell
born : (n_atoms, 3, 3) float Quantity, optional, default None
born : (n_atoms, 3, 3) float Quantity, optional
The Born charges for each atom
dielectric : (3, 3) float Quantity, optional, default None
dielectric : (3, 3) float Quantity, optional
The dielectric permittivity tensor
"""
# Check independent inputs first
Expand Down Expand Up @@ -146,42 +146,42 @@ def calculate_qpoint_phonon_modes(
----------
qpts : (n_qpts, 3) float ndarray
The q-points to interpolate onto
asr : {'realspace', 'reciprocal'}, optional, default None
asr : {'realspace', 'reciprocal'}, optional
Which acoustic sum rule correction to apply. 'realspace'
applies the correction to the force constant matrix in real
space. 'reciprocal' applies the correction to the dynamical
matrix at every q-point
dipole : boolean, optional, default True
dipole : boolean, optional
Calculates the dipole tail correction to the dynamical
matrix at each q-point using the Ewald sum, if the Born
charges and dielectric permitivitty tensor are present.
eta_scale : float, optional, default 1.0
eta_scale : float, optional
Changes the cutoff in real/reciprocal space for the dipole
Ewald sum. A higher value uses more reciprocal terms. If tuned
correctly this can result in performance improvements. See
scripts/optimise_eta.py for help on choosing a good eta_scale.
splitting : boolean, optional, default True
splitting : boolean, optional
Whether to calculate the LO-TO splitting at the gamma
points. Only applied if dipole is True and the Born charges
and dielectric permitivitty tensor are present.
insert_gamma : boolean, optional, default False
insert_gamma : boolean, optional
If splitting is True, this will insert gamma points into
qpts to store the extra split frequencies. Note this means
that the length of qpts in the output QpointPhononModes
object will not necessarily be the same as the input qpts.
If qpts already contains double gamma points where you want
split frequencies, leave this as False.
reduce_qpts : boolean, optional, default False
reduce_qpts : boolean, optional
Whether to use periodicity to reduce all q-points and only
calculate for unique q-points within the 1st BZ. This won't
change the output but could increase performance.
use_c : boolean, optional, default False
use_c : boolean, optional
Whether to use C instead of Python to calculate and
diagonalise the dynamical matrix
n_threads : int, optional, default 1
n_threads : int, optional
The number of OpenMP threads to use when looping over
q-points in C. Only applicable if use_c=True
fall_back_on_python : boolean, optional, default True
fall_back_on_python : boolean, optional
If we cannot use the C extension, fall back on using python
if this is true, else raise an ImportCError.
Expand Down Expand Up @@ -557,7 +557,7 @@ def _dipole_correction_init(self, eta_scale=1.0):
Parameters
----------
eta_scale : float, optional, default 1.0
eta_scale : float, optional
Changes the cutoff in real/reciprocal space for the dipole
Ewald sum. A higher value uses more reciprocal terms
"""
Expand Down Expand Up @@ -1281,21 +1281,21 @@ def from_phonopy(cls, path='.', summary_name='phonopy.yaml',
Parameters
----------
path : str, optional, default '.'
path : str, optional
Path to directory containing the file(s)
summary_name : str, optional, default 'phonpy.yaml'
summary_name : str, optional
Filename of phonopy summary file, default phonopy.yaml. By
default any information (e.g. force constants) read from
this file takes priority
born_name : str, optional, default None
born_name : str, optional
Name of the Phonopy file containing born charges and
dielectric tensor (by convention in Phonopy this would be
called BORN). Is only read if Born charges can't be found in
the summary_name file
fc_name : str, optional, default 'FORCE_CONSTANTS'
fc_name : str, optional
Name of file containing force constants. Is only read if
force constants can't be found in summary_name
fc_format : {'phonopy', 'hdf5'} str, optional, default None
fc_format : {'phonopy', 'hdf5'} str, optional
Format of file containing force constants data.
FORCE_CONSTANTS is type 'phonopy'
Expand Down
22 changes: 11 additions & 11 deletions euphonic/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def plot_dispersion(phonons, btol=10.0, *args, **kwargs):
----------
phonons : QpointPhononModes
Containing the q-points/frequencies to plot
btol : float, optional, default 10.0
btol : float, optional
Determines the limit for plotting sections of reciprocal space
on different subplots, as a fraction of the median distance
between q-points
Expand Down Expand Up @@ -60,18 +60,18 @@ def plot_1d(spectra, title='', x_label='', y_label='', y_min=None, labels=[],
spectra : Spectrum1D or list of Spectrum1D
Containing the 1D data to plot. Note only the x_tick_labels in
the first spectrum in the list will be used
title : string, default ''
title : string, optional
Plot title
x_label : string, default ''
x_label : string, optional
X-axis label
y_label : string, default ''
y_label : string, optional
Y-axis label
y_min : float, default None
y_min : float, optional
Minimum value on the y-axis. Can be useful to set y-axis minimum
to 0 for energy, for example.
labels : list of str, default []
labels : list of str, optional
Legend labels for spectra, in the same order as spectra
btol : float, optional, default None
btol : float, optional
If there are large gaps on the x-axis (e.g sections of
reciprocal space) data can be plotted in sections on different
subplots. btol is the limit for plotting on different subplots,
Expand Down Expand Up @@ -148,13 +148,13 @@ def plot_2d(spectrum, vmin=None, vmax=None, ratio=None, x_width=0, y_width=0,
Ratio of the size of the y and x axes. e.g. if ratio is 2, the
y-axis will be twice as long as the x-axis
Default: None
cmap : string, optional, default 'viridis'
cmap : string, optional
Which colormap to use, see Matplotlib docs
title : string, optional
The figure title. Default: ''
x_label : string, default ''
x_label : string, optional
X-axis label
y_label : string, default ''
y_label : string, optional
Y-axis label
Returns
Expand Down Expand Up @@ -234,7 +234,7 @@ def _get_gridspec_kw(x_data, btol=None):
----------
x_data : (n_x_data,) float ndarray
The x_data points
btol : float, optional, default None
btol : float, optional
Determines the limit for plotting sections of data on different
subplots, as a fraction of the median difference between x_data
points. If None all data will be on the same subplot
Expand Down
14 changes: 7 additions & 7 deletions euphonic/qpoint_phonon_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, crystal, qpts, frequencies, eigenvectors, weights=None):
number. Default units meV
eigenvectors: (n_qpts, 3*crystal.n_atoms, crystal.n_atoms, 3) complex ndarray
Dynamical matrix eigenvectors
weights : (n_qpts,) float ndarray, optional, default None
weights : (n_qpts,) float ndarray, optional
The weight for each q-point. If None, equal weights are
assumed
"""
Expand Down Expand Up @@ -95,7 +95,7 @@ def reorder_frequencies(self, reorder_gamma=True):
Parameters
----------
reorder_gamma : bool, default True
reorder_gamma : bool
Whether to reorder frequencies at gamma-equivalent points.
If an analytical correction has been applied at the gamma
points (i.e LO-TO splitting) mode assignments can be
Expand Down Expand Up @@ -181,7 +181,7 @@ def calculate_structure_factor(self, scattering_lengths, dw=None):
Dictionary of spin and isotope averaged coherent scattering
length for each element in the structure in e.g.
{'O': 5.803*ureg('fm'), 'Zn': 5.680*ureg('fm')}
dw : DebyeWaller, default None
dw : DebyeWaller
A DebyeWaller exponent object
Returns
Expand Down Expand Up @@ -485,15 +485,15 @@ def from_phonopy(cls, path='.', phonon_name='band.yaml',
Parameters
----------
path : str, optional, default '.'
path : str, optional
Path to directory containing the file(s)
phonon_name : str, optional, default 'band.yaml'
phonon_name : str, optional
Name of Phonopy file including the frequencies and
eigenvectors
phonon_format : {'yaml', 'hdf5'} str, optional, default None
phonon_format : {'yaml', 'hdf5'} str, optional
Format of the phonon_name file if it isn't obvious from the
phonon_name extension
summary_name : str, optional, default 'phonopy.yaml'
summary_name : str, optional
Name of Phonopy summary file to read the crystal information
from. Crystal information in the phonon_name file takes
priority, but if it isn't present, crystal information is
Expand Down
8 changes: 4 additions & 4 deletions euphonic/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def broaden(self, x_width, shape='gauss'):
----------
x_width : float Quantity
The broadening FWHM
shape : {'gauss', 'lorentz'}, optional, default 'gauss'
shape : {'gauss', 'lorentz'}, optional
The broadening shape
Returns
Expand Down Expand Up @@ -253,11 +253,11 @@ def broaden(self, x_width=None, y_width=None, shape='gauss'):
Parameters
----------
x_width : float Quantity, optional, default None
x_width : float Quantity, optional
The broadening FWHM in x
y_width : float Quantity, optional, default None
y_width : float Quantity, optional
The broadening FWHM in y
shape : {'gauss', 'lorentz'}, optional, default 'gauss'
shape : {'gauss', 'lorentz'}, optional
The broadening shape
Returns
Expand Down
4 changes: 2 additions & 2 deletions euphonic/structure_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def calculate_sqw_map(self, e_bins, calc_bose=True, temperature=None):
----------
e_bins : (n_e_bins + 1,) float Quantity
The energy bin edges
calc_bose : boolean, optional, default True
calc_bose : boolean, optional
Whether to calculate and apply the Bose population factor
temperature : float Quantity, default None
temperature : float Quantity, optional
The temperature to use to calculate the Bose factor. Is only
required if StructureFactor.temperature = None, otherwise
the temperature stored in StructureFactor will be used
Expand Down
8 changes: 4 additions & 4 deletions euphonic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def get_all_origins(max_xyz, min_xyz=[0, 0, 0], step=1):
----------
max_xyz : (3,) int ndarray
The number of cells to count to in each direction
min_xyz : (3,) int ndarray, optional, default [0,0,0]
min_xyz : (3,) int ndarray, optional
The cell number to count from in each direction
step : integer, optional, default 1
step : integer, optional
The step between cells
Returns
Expand Down Expand Up @@ -194,7 +194,7 @@ def _recip_space_labels(crystal, qpts, symmetry_labels=True):
The crystal to get high-symmetry labels for
qpts : (n_qpts, 3) float ndarray
The q-points to get labels for
symmetry_labels : boolean, optional, default True
symmetry_labels : boolean, optional
Whether to use high-symmetry point labels (e.g. GAMMA, X, L).
Otherwise just uses generic labels (e.g. '0 0 0')
Expand Down Expand Up @@ -465,7 +465,7 @@ def _ensure_contiguous_attrs(obj, required_attrs, opt_attrs=[]):
required_attrs : list of strings
The attributes of obj to be checked. They should all be Numpy
arrays
opt_attrs : list of strings, default []
opt_attrs : list of strings, optional
The attributes of obj to be checked, but if they don't exist
will not throw an error. e.g. Depending on the material
ForceConstants objects may or may not have 'born' defined
Expand Down

0 comments on commit 6ca7dd6

Please sign in to comment.