From 6e4d57a1d4ddc4f176dacb266ea68792082b8695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 11 Apr 2024 16:57:00 +0200 Subject: [PATCH] fix some typos (found by codespell) --- pySecDec/algebra.py | 28 +++++++++---------- pySecDec/code_writer/make_package.py | 14 +++++----- pySecDec/code_writer/sum_package.py | 4 +-- .../templates/make_package/codegen/sector.h | 2 +- .../templates/make_package/pylink/pylink.cpp | 2 +- pySecDec/decomposition/common.py | 2 +- pySecDec/decomposition/geometric.py | 4 +-- pySecDec/decomposition/iterative.py | 2 +- pySecDec/decomposition/splitting.py | 2 +- pySecDec/disteval.py | 2 +- pySecDec/integral_interface.py | 8 +++--- pySecDec/make_package.py | 8 +++--- pySecDec/make_regions.py | 2 +- pySecDec/matrix_sort.py | 2 +- pySecDec/misc.py | 10 +++---- pySecDec/polytope.py | 6 ++-- pySecDec/subtraction.py | 4 +-- pySecDec/test_algebra.py | 4 +-- pySecDec/test_misc.py | 2 +- 19 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pySecDec/algebra.py b/pySecDec/algebra.py index f73e4c72..a620f827 100644 --- a/pySecDec/algebra.py +++ b/pySecDec/algebra.py @@ -271,7 +271,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' derivative = self.derivatives[index] @@ -513,7 +513,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derivative by ``x`` --> have ``x`` coded in ``expolist`` and can have ``x`` in coeffs @@ -581,7 +581,7 @@ def _sub_or_add(self, other, sub): ''' if type(other) is Polynomial: - assert self.number_of_variables == other.number_of_variables, 'Number of varibales must be equal for both polynomials in +' + assert self.number_of_variables == other.number_of_variables, 'Number of variables must be equal for both polynomials in +' sum_expolist = np.vstack([self.expolist, other.expolist]) sum_coeffs = np.hstack([self.coeffs, -other.coeffs if sub else other.coeffs]) @@ -599,7 +599,7 @@ def _sub_or_add(self, other, sub): def __mul__(self, other): 'multiplication operator' if type(other) is Polynomial: - assert self.number_of_variables == other.number_of_variables, 'Number of varibales must be equal for both factors in *' + assert self.number_of_variables == other.number_of_variables, 'Number of variables must be equal for both factors in *' product_expolist = np.vstack([other.expolist + term for term in self.expolist]) product_coeffs = np.hstack([other.coeffs * term for term in self.coeffs]) @@ -858,7 +858,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derive an expression of the form "poly**exponent" @@ -1025,7 +1025,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derive an expression of the form "log(poly)" @@ -1161,7 +1161,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derivative(p1 + p2 + ...) = derivative(p1) + derivative(p2) + ... @@ -1283,7 +1283,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' return ProductRule(*self.factors, copy=False).derive(index) @@ -1362,7 +1362,7 @@ def __init__(self, *expressions, **kwargs): # The `factorlist` is a 3 dimensional array. Its first # index denotes the terms of the sum :math:`i`. The # second index denotes the factor :math:`j`. The last - # index denotes the varible to take the derivative with + # index denotes the variable to take the derivative with # respect to. The value of ``factorlist[i,j,k]`` denotes # how many derivatives :math:`n_{ijk}` are to be taken. # If not given, a product of the `expressions` without @@ -1403,7 +1403,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # product rule: derivative( * x**k) = * k * x**(k-1) + derivative() * x**k @@ -1431,7 +1431,7 @@ def derive(self, index): lower_derivative_multiindex = tuple(lower_derivative_multiindex) lower_derivative = expression[lower_derivative_multiindex] expression[derivative_multiindex] = lower_derivative.derive(index).simplify() # automatically simplify cache - # set the coefficent to zero if the derivative is zero, so that it doesn't get outputted in str() + # set the coefficient to zero if the derivative is zero, so that it doesn't get outputted in str() if new_coeffs[n] != 0 and isinstance(expression[derivative_multiindex], Polynomial) and not np.any(expression[derivative_multiindex].expolist): if sympify_expression(expression[derivative_multiindex]).simplify() == 0: new_coeffs[n] = 0 @@ -1606,7 +1606,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derive an expression of the form "base**exponent" @@ -1697,7 +1697,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' # derivative(log(arg)) = 1/arg * derivative(arg) = arg**-1 * derivative(arg) @@ -1765,7 +1765,7 @@ def derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' return Product(self, self.arg.derive(index), copy=False) diff --git a/pySecDec/code_writer/make_package.py b/pySecDec/code_writer/make_package.py index ed29b707..b4bd948e 100644 --- a/pySecDec/code_writer/make_package.py +++ b/pySecDec/code_writer/make_package.py @@ -727,7 +727,7 @@ def super_derive(self, index): :param index: integer; - The index of the paramater to derive by. + The index of the parameter to derive by. ''' derivative = self.derivatives[index] @@ -1135,7 +1135,7 @@ def is_constant(poly): for item in after_ibp: subtracted.extend( integrate_pole_part(item, *integration_variable_indices) ) - # intialize expansion + # initialize expansion pole_parts = [s.factors[1].simplify() for s in subtracted] regular_parts = [Product( *([s.factors[0]] + s.factors[2:]), copy=False ) for s in subtracted] @@ -1348,7 +1348,7 @@ def update_derivatives(basename, derivative_tracker, full_expression, derivative for name in ordered_decomposed_derivative_names ) - # generate list over all occuring orders in the regulators + # generate list over all occurring orders in the regulators regulator_powers = list( rangecomb(np.zeros_like(required_orders), required_orders + highest_poles_current_sector) ) number_of_orders = len(regulator_powers) @@ -1456,13 +1456,13 @@ def make_package(name, integration_variables, regulators, requested_orders, :param name: string; - The name of the c++ namepace and the output + The name of the c++ namespace and the output directory. :param integration_variables: iterable of strings or sympy symbols; The variables that are to be integrated. The - intgration region depends on the chosen + integration region depends on the chosen `decomposition_method`. :param regulators: @@ -1534,7 +1534,7 @@ def make_package(name, integration_variables, regulators, requested_orders, :param functions: iterable of strings or sympy symbols, optional; - Function symbols occuring in `remainder_expression`, + Function symbols occurring in `remainder_expression`, e.g.``['f']``. .. note:: @@ -1818,7 +1818,7 @@ def make_package(name, integration_variables, regulators, requested_orders, # make a copy of the `integration_variables` for later reference all_integration_variables = list(integration_variables) - # intialize the c++ declarations of the `functions` + # initialize the c++ declarations of the `functions` function_declarations = set() have_dummy_functions = True if functions else False diff --git a/pySecDec/code_writer/sum_package.py b/pySecDec/code_writer/sum_package.py index 13e4bded..210d1c67 100644 --- a/pySecDec/code_writer/sum_package.py +++ b/pySecDec/code_writer/sum_package.py @@ -184,14 +184,14 @@ def sum_package(name, package_generators, regulators, requested_orders, .. math:: \sum_j c_{ij} \ \int f_j - Generate a c++ package with an optmized algorithm to + Generate a c++ package with an optimized algorithm to evaluate the integrals numerically. It writes the names of the integrals in the file `"integral_names.txt"`. For the format of the file see :class:`~pySecDec.amplitude_interface.Parser`. :param name: string; - The name of the c++ namepace and the output + The name of the c++ namespace and the output directory. :param package_generators: diff --git a/pySecDec/code_writer/templates/make_package/codegen/sector.h b/pySecDec/code_writer/templates/make_package/codegen/sector.h index 975c18a2..c54507f7 100644 --- a/pySecDec/code_writer/templates/make_package/codegen/sector.h +++ b/pySecDec/code_writer/templates/make_package/codegen/sector.h @@ -51,7 +51,7 @@ CFunctions log, exp, SecDecInternalPow, SecDecInternalDenominator; AutoDeclare Symbols SecDecInternalLabel; * The integrand may be longer than FORM can read in one go. -* We use python to split the the expression if neccessary. +* We use python to split the the expression if necessary. * Define a procedure that defines the "integrand" expression #procedure defineExpansion Global expansion = SecDecInternalsDUMMYIntegrand; diff --git a/pySecDec/code_writer/templates/make_package/pylink/pylink.cpp b/pySecDec/code_writer/templates/make_package/pylink/pylink.cpp index 9501f6d3..86cc4487 100644 --- a/pySecDec/code_writer/templates/make_package/pylink/pylink.cpp +++ b/pySecDec/code_writer/templates/make_package/pylink/pylink.cpp @@ -20,7 +20,7 @@ #include // The python-C binding is general and therefore contained in the util #include -// delegate some template instatiations to separate translation units +// delegate some template instantiations to separate translation units #ifdef SECDEC_WITH_CUDA #define EXTERN_NONE_QMC_SEPARATE() \ extern template class secdecutil::integrators::Qmc< \ diff --git a/pySecDec/decomposition/common.py b/pySecDec/decomposition/common.py index 2724a1d5..74515a81 100644 --- a/pySecDec/decomposition/common.py +++ b/pySecDec/decomposition/common.py @@ -581,7 +581,7 @@ def squash_symmetry_redundant_sectors_sort(sectors, sort_function, indices=None) If two sectors only differ by a permutation of the polysymbols (to be interpreted as integration - variables over some inteval), then the two sectors + variables over some interval), then the two sectors integrate to the same value. Thus we can drop one of them and count the other twice. The multiple counting of a sector is accounted for by increasing diff --git a/pySecDec/decomposition/geometric.py b/pySecDec/decomposition/geometric.py index 2890ff21..7ecbb5a9 100644 --- a/pySecDec/decomposition/geometric.py +++ b/pySecDec/decomposition/geometric.py @@ -49,7 +49,7 @@ def generate_fan(*polynomials): considered. :param polynomials: - abritrarily many instances of :class:`.Polynomial` where + arbitrarily many instances of :class:`.Polynomial` where all of these have an equal number of variables; The polynomials to calculate the fan for. ''' @@ -230,7 +230,7 @@ def make_sector(cone_indices, cone): for cone_indices in incidence_lists.values(): cone = transformation[:,cone_indices].T - # triangluate where neccessary + # triangulate where necessary if len(cone_indices) != dim: # assert len(cone) > dim # --> this check is done by `triangulate` triangular_cones = triangulate(cone, normaliz, workdir) diff --git a/pySecDec/decomposition/iterative.py b/pySecDec/decomposition/iterative.py index e43ca3f4..d6f918ee 100644 --- a/pySecDec/decomposition/iterative.py +++ b/pySecDec/decomposition/iterative.py @@ -148,7 +148,7 @@ def remap_parameters(singular_parameters, Jacobian, *polynomials): The Jacobian determinant is multiplied to this polynomial. :param polynomials: - abritrarily many instances of :class:`.algebra.Polynomial` + arbitrarily many instances of :class:`.algebra.Polynomial` where all of these have an equal number of variables; The polynomials of Feynman parameters to be remapped. These are typically :math:`F` and :math:`U`. diff --git a/pySecDec/decomposition/splitting.py b/pySecDec/decomposition/splitting.py index c6b230d5..4b53b546 100644 --- a/pySecDec/decomposition/splitting.py +++ b/pySecDec/decomposition/splitting.py @@ -144,7 +144,7 @@ def split_recursively(sector, indices, splitting_point): yield sector.copy() return - # We call this function recusively and pop the first index/splitting_value in each iteration + # We call this function recursively and pop the first index/splitting_value in each iteration index = indices[0] remaining_indices = indices[1:] splitting_value = splitting_point[0] diff --git a/pySecDec/disteval.py b/pySecDec/disteval.py index c860858d..be688d6c 100644 --- a/pySecDec/disteval.py +++ b/pySecDec/disteval.py @@ -6,7 +6,7 @@ Options: --epsabs=X stop if this absolute precision is reached (default: 1e-10) --epsrel=X stop if this relative precision is reached (default: 1e-4) - --timeout=X stop after at most this many seconds (defaul: inf) + --timeout=X stop after at most this many seconds (default: inf) --points=X begin integration with this lattice size (default: 1e4) --presamples=X use this many points for presampling (default: 1e4) --shifts=X use this many lattice shifts per integral (default: 32) diff --git a/pySecDec/integral_interface.py b/pySecDec/integral_interface.py index 62e0f5d6..31d8b32a 100644 --- a/pySecDec/integral_interface.py +++ b/pySecDec/integral_interface.py @@ -21,7 +21,7 @@ def _parse_series_coefficient(text): """ Parse a textual representation of a single coefficient - in a series. Retrun a float, a complex number, a tuple + in a series. Return a float, a complex number, a tuple consisting of the mean and the standard deviation if it is given, or a tuple of three elements (via _parse_series) if the coefficient is a nested series. @@ -450,7 +450,7 @@ class MultiIntegrator(CPPIntegrator): .. warning:: The `integral_library` passed to the integrators must be the same for all of them. Furthermore, an integrator can only be - used to integrate the `integral_library` it has beeen + used to integrate the `integral_library` it has been constructed with. .. warning:: @@ -1344,7 +1344,7 @@ def __call__( integration_thread.daemon = True # daemonize worker to have it killed when the main thread is killed integration_thread.start() while integration_thread.is_alive(): # keep joining worker until it is finished - integration_thread.join(5) # call `join` with `timeout` to keep the main thread interruptable + integration_thread.join(5) # call `join` with `timeout` to keep the main thread interruptible return_value = return_value_queue.get() if return_value != 0: raise RuntimeError("Integration failed, see error message above.") @@ -1438,7 +1438,7 @@ def _call_implementation( if compute_integral_return_value != 0: return - # convert c++ stings to python strings or bytes (depending on whether we use python2 or python3) + # convert c++ strings to python strings or bytes (depending on whether we use python2 or python3) str_integral_without_prefactor = self.c_lib.string2charptr(cpp_str_integral_without_prefactor) str_prefactor = self.c_lib.string2charptr(cpp_str_prefactor) str_integral_with_prefactor = self.c_lib.string2charptr(cpp_str_integral_with_prefactor) diff --git a/pySecDec/make_package.py b/pySecDec/make_package.py index 57b8e1d0..597380e4 100644 --- a/pySecDec/make_package.py +++ b/pySecDec/make_package.py @@ -36,13 +36,13 @@ def make_package(name, integration_variables, regulators, requested_orders, :param name: string; - The name of the c++ namepace and the output + The name of the c++ namespace and the output directory. :param integration_variables: iterable of strings or sympy symbols; The variables that are to be integrated. The - intgration region depends on the chosen + integration region depends on the chosen `decomposition_method`. :param regulators: @@ -114,7 +114,7 @@ def make_package(name, integration_variables, regulators, requested_orders, :param functions: iterable of strings or sympy symbols, optional; - Function symbols occuring in `remainder_expression`, + Function symbols occurring in `remainder_expression`, e.g.``['f']``. .. note:: @@ -318,7 +318,7 @@ def make_package(name, integration_variables, regulators, requested_orders, :param form_executable: string or None, optional; - The path to the form exectuable. The argument is passed + The path to the form executable. The argument is passed to :meth:`.Coefficient.process`. If ``None``, then either ``$FORM``, ``$SECDEC_CONTRIB/bin/form``, or just ``form`` is used, depending on which environment variable is set. diff --git a/pySecDec/make_regions.py b/pySecDec/make_regions.py index 1a04607c..82912452 100644 --- a/pySecDec/make_regions.py +++ b/pySecDec/make_regions.py @@ -373,7 +373,7 @@ def make_regions(name, integration_variables, regulators, requested_orders, smal :param name: string; - The name of the c++ namepace and the output + The name of the c++ namespace and the output directory. :param integration_variables: diff --git a/pySecDec/matrix_sort.py b/pySecDec/matrix_sort.py index a5e4d55f..614b9598 100644 --- a/pySecDec/matrix_sort.py +++ b/pySecDec/matrix_sort.py @@ -31,7 +31,7 @@ def iterative_sort(matrix): # keep sorting the 2D matrix (in place) along both dimensions # until it no longer changes - # initilize sort keys such that we enter the while loop at least once + # initialize sort keys such that we enter the while loop at least once sort_key_axis_0 = None sort_key_axis_1 = None diff --git a/pySecDec/misc.py b/pySecDec/misc.py index ab0605f7..c8b4455e 100644 --- a/pySecDec/misc.py +++ b/pySecDec/misc.py @@ -59,7 +59,7 @@ def powerset(iterable, min_length=0, stride=1): def rangecomb(low, high): ''' - Return an iterator over the occuring orders in a + Return an iterator over the occurring orders in a multivariate series expansion between `low` and `high`. @@ -181,7 +181,7 @@ def sub_indices(i): sub_indices.remove(i) return sub_indices - # resolve the first row of the matix + # resolve the first row of the matrix sub_Ms = (M[[[k] for k in range(1,D)],sub_indices(i)] for i in range(D)) sub_dets = pool.imap(det, sub_Ms) result = 0 @@ -219,7 +219,7 @@ def sub_indices(i): sub_indices.remove(i) return sub_indices - # resolve the first row of the matix + # resolve the first row of the matrix for i in range(D): sub_M = M[[[k] for k in range(1,D)],sub_indices(i)] term = M[0,i] * det(sub_M) # recursion @@ -271,7 +271,7 @@ def argsort_2D_array(array): The idea is to bring identical rows together. .. seealso:: - If your array is not two dimesional + If your array is not two dimensional use :func:`.argsort_ND_array`. Example: @@ -492,7 +492,7 @@ def lowest_order(expression, variable): The variable in which to expand. ''' - # convert to sympy if neccessary + # convert to sympy if necessary variable = sympify_symbols([variable], '`variable` must be a symbol')[0] if not isinstance(expression, sp.Expr): expression = sympify_expression(expression) diff --git a/pySecDec/polytope.py b/pySecDec/polytope.py index d473ea25..952fda1a 100644 --- a/pySecDec/polytope.py +++ b/pySecDec/polytope.py @@ -23,7 +23,7 @@ def convex_hull(*polynomials): of the product of all input polynomials. :param polynomials: - abritrarily many instances of :class:`.Polynomial` where + arbitrarily many instances of :class:`.Polynomial` where all of these have an equal number of variables; The polynomials to calculate the convex hull for. @@ -346,8 +346,8 @@ def complete_representation(self, normaliz=None, workdir='normaliz_tmp', keep_wo def vertex_incidence_lists(self): ''' Return for each vertex the list of facets it - lies in (as dictonary). The keys of the output - dictonary are the vertices while the values + lies in (as dictionary). The keys of the output + dictionary are the vertices while the values are the indices of the facets in ``self.facets``. ''' diff --git a/pySecDec/subtraction.py b/pySecDec/subtraction.py index 25700250..8eabf3b1 100644 --- a/pySecDec/subtraction.py +++ b/pySecDec/subtraction.py @@ -169,7 +169,7 @@ def integrate_pole_part(polyprod, *indices): :class:`.algebra.Product` of the form ``**(a_j + ...)> * * ``; - The input product as decribed above. + The input product as described above. The **(a_j + ...)> should be a :class:`pySecDec.algebra.Product` of **(a_j + ...). @@ -311,7 +311,7 @@ def integrate_by_parts(polyprod, power_goals, indices): :class:`.algebra.Product` of the form ``**(a_j + ...)> * * ``; - The input product as decribed above. + The input product as described above. The **(a_j + ...)> should be a :class:`pySecDec.algebra.Product` of **(a_j + ...). diff --git a/pySecDec/test_algebra.py b/pySecDec/test_algebra.py index b8a1df99..9be6789d 100644 --- a/pySecDec/test_algebra.py +++ b/pySecDec/test_algebra.py @@ -470,7 +470,7 @@ def test_simplify(self): assert polynomial.expolist.shape == (5,2) def test_mul(self): - with pytest.raises(AssertionError, match=r'Number of varibales must be equal for both factors in *'): + with pytest.raises(AssertionError, match=r'Number of variables must be equal for both factors in *'): self.p0 * Polynomial([(0,0,3)],[4]) poly = Polynomial([(0,2),(1,0)],[1,'C']) @@ -509,7 +509,7 @@ def test_mul(self): np.testing.assert_array_equal(sorted_prod_coeffs, sorted_target_prod_coeffs) def test_add(self): - with pytest.raises(AssertionError, match=r'Number of varibales must be equal for both polynomials in +'): + with pytest.raises(AssertionError, match=r'Number of variables must be equal for both polynomials in +'): self.p0 + Polynomial([(0,0,3)],[4]) assert str(10 + Polynomial([(1,0)],[1])) == ' + (10) + (1)*x0' diff --git a/pySecDec/test_misc.py b/pySecDec/test_misc.py index e5eb7794..8f74de2f 100644 --- a/pySecDec/test_misc.py +++ b/pySecDec/test_misc.py @@ -364,7 +364,7 @@ def test_lowest_order_one_variable_constant(self): / pi / 2 * (-1) * eps * 2**(-4*eps) * 4**(1+eps) * 64 ''' expression_lowest_eps_order = lowest_order(expression, 'eps') - assert expression_lowest_eps_order == 0 # no pole, expasion starts at constant order + assert expression_lowest_eps_order == 0 # no pole, expansion starts at constant order #@pytest.mark.active def test_lowest_order_one_variable_simple_pole(self):