From 1b5054f6d3dd776616d33dada0df05c8bbcd89bf Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 6 Oct 2021 02:25:45 -0400 Subject: [PATCH] lint fixes --- makeReadme.py | 12 ++++++++---- mathgenerator/__init__.py | 6 ++---- mathgenerator/funcs/algebra/basic_algebra.py | 5 ++--- mathgenerator/funcs/algebra/combine_like_terms.py | 3 ++- mathgenerator/funcs/algebra/complex_quadratic.py | 7 +++---- mathgenerator/funcs/algebra/compound_interest.py | 8 +++++--- mathgenerator/funcs/algebra/distance_two_points.py | 8 ++++---- mathgenerator/funcs/algebra/expanding.py | 11 ++++++++--- .../funcs/algebra/intersection_of_two_lines.py | 6 ++++-- mathgenerator/funcs/algebra/invert_matrix.py | 7 ++++--- mathgenerator/funcs/algebra/log.py | 3 +-- .../funcs/algebra/midpoint_of_two_points.py | 3 +-- .../funcs/algebra/multiply_complex_numbers.py | 6 +++--- .../funcs/algebra/multiply_int_to_22_matrix.py | 3 ++- mathgenerator/funcs/algebra/quadratic_equation.py | 10 ++++------ mathgenerator/funcs/algebra/simple_interest.py | 10 ++++++---- mathgenerator/funcs/algebra/system_of_equations.py | 11 +++++++---- mathgenerator/funcs/algebra/vector_cross.py | 3 +-- mathgenerator/funcs/algebra/vector_dot.py | 3 +-- .../funcs/basic_math/absolute_difference.py | 9 +++------ mathgenerator/funcs/basic_math/compare_fractions.py | 12 ++++++------ mathgenerator/funcs/basic_math/complex_division.py | 5 ++--- mathgenerator/funcs/basic_math/cube_root.py | 11 ++++------- mathgenerator/funcs/basic_math/divide_fractions.py | 3 +-- mathgenerator/funcs/basic_math/division.py | 5 ++--- mathgenerator/funcs/basic_math/exponentiation.py | 6 ++---- mathgenerator/funcs/basic_math/factorial.py | 3 +-- .../funcs/basic_math/fraction_multiplication.py | 3 +-- mathgenerator/funcs/basic_math/is_prime.py | 4 +--- mathgenerator/funcs/basic_math/multiplication.py | 3 +-- mathgenerator/funcs/basic_math/square_root.py | 2 +- mathgenerator/funcs/basic_math/subtraction.py | 2 +- mathgenerator/funcs/calculus/definite_integral.py | 6 ++---- mathgenerator/funcs/calculus/differentiation.py | 3 +-- .../funcs/calculus/power_rule_differentiation.py | 11 +++++++---- .../funcs/calculus/power_rule_integration.py | 7 +++++-- mathgenerator/funcs/calculus/stationary_points.py | 7 +++---- .../funcs/computer_science/bcd_to_decimal.py | 3 +-- .../funcs/computer_science/binary_2s_complement.py | 3 +-- .../funcs/computer_science/binary_complement_1s.py | 3 +-- .../funcs/computer_science/binary_to_decimal.py | 3 +-- .../funcs/computer_science/decimal_to_bcd.py | 3 +-- .../funcs/computer_science/decimal_to_binary.py | 3 +-- .../funcs/computer_science/decimal_to_octal.py | 3 +-- .../funcs/computer_science/fibonacci_series.py | 8 ++++---- .../funcs/computer_science/nth_fibonacci_number.py | 6 +++--- mathgenerator/funcs/geometry/angle_btw_vectors.py | 5 ++--- .../funcs/geometry/angle_regular_polygon.py | 7 +++---- mathgenerator/funcs/geometry/area_of_triangle.py | 3 +-- mathgenerator/funcs/geometry/basic_trigonometry.py | 8 +++++--- .../funcs/geometry/curved_surface_area_cylinder.py | 7 +++---- .../funcs/geometry/fourth_angle_of_quadrilateral.py | 7 +++---- .../funcs/geometry/perimeter_of_polygons.py | 7 +++---- mathgenerator/funcs/geometry/pythagorean_theorem.py | 7 +++---- .../funcs/geometry/sum_of_polygon_angles.py | 3 +-- mathgenerator/funcs/geometry/surface_area_cone.py | 6 ++---- mathgenerator/funcs/geometry/surface_area_cube.py | 3 +-- mathgenerator/funcs/geometry/surface_area_cuboid.py | 6 ++---- .../funcs/geometry/surface_area_cylinder.py | 7 +++---- mathgenerator/funcs/geometry/surface_area_sphere.py | 6 ++---- .../funcs/geometry/third_angle_of_triangle.py | 3 +-- mathgenerator/funcs/geometry/valid_triangle.py | 3 +-- mathgenerator/funcs/geometry/volume_cone.py | 6 ++---- mathgenerator/funcs/geometry/volume_cube.py | 5 ++--- mathgenerator/funcs/geometry/volume_cuboid.py | 6 ++---- mathgenerator/funcs/geometry/volume_cylinder.py | 6 ++---- mathgenerator/funcs/geometry/volume_sphere.py | 5 ++--- .../funcs/misc/arithmetic_progression_sum.py | 13 +++++++------ .../funcs/misc/arithmetic_progression_term.py | 12 +++++++----- mathgenerator/funcs/misc/base_conversion.py | 6 +++--- mathgenerator/funcs/misc/celsius_to_fahrenheit.py | 3 +-- mathgenerator/funcs/misc/common_factors.py | 3 +-- mathgenerator/funcs/misc/complex_to_polar.py | 9 ++++++--- .../funcs/misc/decimal_to_roman_numerals.py | 3 ++- mathgenerator/funcs/misc/euclidian_norm.py | 5 ++--- mathgenerator/funcs/misc/geometric_mean.py | 5 ++--- mathgenerator/funcs/misc/geometric_progression.py | 10 +++++----- mathgenerator/funcs/misc/harmonic_mean.py | 3 +-- mathgenerator/funcs/misc/hcf.py | 3 +-- mathgenerator/funcs/misc/is_leap_year.py | 3 +-- mathgenerator/funcs/misc/lcm.py | 4 +--- mathgenerator/funcs/misc/minutes_to_hours.py | 3 +-- mathgenerator/funcs/misc/prime_factors.py | 2 +- mathgenerator/funcs/misc/profit_loss_percent.py | 7 +++---- mathgenerator/funcs/statistics/combinations.py | 5 ++--- .../funcs/statistics/conditional_probability.py | 5 ++--- .../funcs/statistics/confidence_interval.py | 3 +-- mathgenerator/funcs/statistics/data_summary.py | 3 ++- .../funcs/statistics/dice_sum_probability.py | 3 +-- mathgenerator/funcs/statistics/mean_median.py | 3 +-- mathgenerator/funcs/statistics/permutation.py | 4 +--- 91 files changed, 227 insertions(+), 271 deletions(-) diff --git a/makeReadme.py b/makeReadme.py index cb59549..cab6a16 100644 --- a/makeReadme.py +++ b/makeReadme.py @@ -1,8 +1,10 @@ from mathgenerator.mathgen import * write_list = [] -subjects = ['algebra', 'basic_math', 'calculus', - 'computer_science', 'geometry', 'misc', 'statistics'] +subjects = [ + 'algebra', 'basic_math', 'calculus', 'computer_science', 'geometry', + 'misc', 'statistics' +] wList = getGenList() @@ -71,12 +73,14 @@ def gen_to_row_string(item): kwargs_list = myGen.kwargs for kwarg in kwargs_list: kwargs += '`' + kwarg + '` ' - title = '[' + myGen.title + '](https://github.com/lukew3/mathgenerator/blob/main/mathgenerator/funcs/' + item[4] + '/' + func_name + '.py)' + title = '[' + myGen.title + '](https://github.com/lukew3/mathgenerator/blob/main/mathgenerator/funcs/' + item[ + 4] + '/' + func_name + '.py)' row = [myGen.id, title, prob, solu, func_name, kwargs] # tableLine = "| " + str(row[0]) + " | " + str(row[1]) + " | " + str( # row[2]) + " | " + str(row[3]) + " | " + str(row[4]) + " |\n" tableLine = "| " + str(row[0]) + " | " + str(row[1]) + " | " + str( - row[2]) + " | " + str(row[3]) + " | " + str(row[4]) + " | " + str(row[5]) + " |\n" + row[2]) + " | " + str(row[3]) + " | " + str(row[4]) + " | " + str( + row[5]) + " |\n" print('added', item[1], '-', func_name, 'to the README.md') return tableLine diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 9476ee7..d42c0fe 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -26,12 +26,10 @@ class Generator: genList.append([id, title, self, funcname, subjectname, kwargs]) def __str__(self): - return str( - self.id - ) + " " + self.title + return str(self.id) + " " + self.title def __call__(self, *args, **kwargs): - return self.func(*args, **kwargs) + return self.func(*args, **kwargs) def getGenList(): diff --git a/mathgenerator/funcs/algebra/basic_algebra.py b/mathgenerator/funcs/algebra/basic_algebra.py index 90c36c7..c935b9a 100644 --- a/mathgenerator/funcs/algebra/basic_algebra.py +++ b/mathgenerator/funcs/algebra/basic_algebra.py @@ -32,6 +32,5 @@ def basicAlgebraFunc(maxVariable=10, format='string'): return a, b, c, x - -basic_algebra = Generator("Basic Algebra", 11, - basicAlgebraFunc, ["maxVariable=10"]) +basic_algebra = Generator("Basic Algebra", 11, basicAlgebraFunc, + ["maxVariable=10"]) diff --git a/mathgenerator/funcs/algebra/combine_like_terms.py b/mathgenerator/funcs/algebra/combine_like_terms.py index 36d18ed..bb93073 100644 --- a/mathgenerator/funcs/algebra/combine_like_terms.py +++ b/mathgenerator/funcs/algebra/combine_like_terms.py @@ -44,4 +44,5 @@ def combineTerms(string): return final_string -combine_like_terms = Generator("Combine Like terms", 105,likeTermCombineFunc, ["maxCoef=10", "maxExp=20", "maxTerms=10"]) +combine_like_terms = Generator("Combine Like terms", 105, likeTermCombineFunc, + ["maxCoef=10", "maxExp=20", "maxTerms=10"]) diff --git a/mathgenerator/funcs/algebra/complex_quadratic.py b/mathgenerator/funcs/algebra/complex_quadratic.py index 0bae10a..803cd46 100644 --- a/mathgenerator/funcs/algebra/complex_quadratic.py +++ b/mathgenerator/funcs/algebra/complex_quadratic.py @@ -68,7 +68,6 @@ def complexQuadraticFunc(prob_type=0, max_range=10, format='string'): return problem, solution -complex_quadratic = Generator( - "complex Quadratic Equation", 100, - complexQuadraticFunc, - ["prob_type=0", "max_range=10"]) +complex_quadratic = Generator("complex Quadratic Equation", 100, + complexQuadraticFunc, + ["prob_type=0", "max_range=10"]) diff --git a/mathgenerator/funcs/algebra/compound_interest.py b/mathgenerator/funcs/algebra/compound_interest.py index bff8333..4efd60f 100644 --- a/mathgenerator/funcs/algebra/compound_interest.py +++ b/mathgenerator/funcs/algebra/compound_interest.py @@ -1,7 +1,10 @@ from .__init__ import * -def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, format='string'): +def compoundInterestFunc(maxPrinciple=10000, + maxRate=10, + maxTime=10, + format='string'): p = random.randint(1000, maxPrinciple) r = random.randint(1, maxRate) n = random.randint(1, maxTime) @@ -17,6 +20,5 @@ def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, format='str compound_interest = Generator( - "Compound Interest", 78, - compoundInterestFunc, + "Compound Interest", 78, compoundInterestFunc, ["maxPrinciple=10000", "maxRate=10", "maxTime=10"]) diff --git a/mathgenerator/funcs/algebra/distance_two_points.py b/mathgenerator/funcs/algebra/distance_two_points.py index dc7d54c..3f26c75 100644 --- a/mathgenerator/funcs/algebra/distance_two_points.py +++ b/mathgenerator/funcs/algebra/distance_two_points.py @@ -16,7 +16,7 @@ def distanceTwoPointsFunc(maxValXY=20, minValXY=-20, format='string'): else: return point1X, point1Y, point2X, point2Y, distanceSq -distance_two_points = Generator( - "Distance between 2 points", 24, - distanceTwoPointsFunc, - ["maxValXY=20", "minValXY=-20"]) + +distance_two_points = Generator("Distance between 2 points", 24, + distanceTwoPointsFunc, + ["maxValXY=20", "minValXY=-20"]) diff --git a/mathgenerator/funcs/algebra/expanding.py b/mathgenerator/funcs/algebra/expanding.py index 17f2ef5..2301d27 100644 --- a/mathgenerator/funcs/algebra/expanding.py +++ b/mathgenerator/funcs/algebra/expanding.py @@ -1,7 +1,11 @@ from .__init__ import * -def expandingFunc(range_x1=10, range_x2=10, range_a=10, range_b=10, format='string'): +def expandingFunc(range_x1=10, + range_x2=10, + range_a=10, + range_b=10, + format='string'): x1 = random.randint(-range_x1, range_x1) x2 = random.randint(-range_x2, range_x2) a = random.randint(-range_a, range_a) @@ -48,5 +52,6 @@ def expandingFunc(range_x1=10, range_x2=10, range_a=10, range_b=10, format='stri return p1, p2, p3, p4, c1, c2, c3 -expanding = Generator("Expanding Factored Binomial", 111, expandingFunc, - ["range_x1=10", "range_x2=10", "range_a=10", "range_b=10"]) +expanding = Generator( + "Expanding Factored Binomial", 111, expandingFunc, + ["range_x1=10", "range_x2=10", "range_a=10", "range_b=10"]) diff --git a/mathgenerator/funcs/algebra/intersection_of_two_lines.py b/mathgenerator/funcs/algebra/intersection_of_two_lines.py index b26605d..bc4b5a7 100644 --- a/mathgenerator/funcs/algebra/intersection_of_two_lines.py +++ b/mathgenerator/funcs/algebra/intersection_of_two_lines.py @@ -73,5 +73,7 @@ def intersectionOfTwoLinesFunc(minM=-10, intersection_of_two_lines = Generator( - "Intersection of Two Lines", 41, intersectionOfTwoLinesFunc, - ["minM=-10", "maxM=10", "minB=-10", "maxB=10", "minDenominator=1", "maxDenominator=6"]) + "Intersection of Two Lines", 41, intersectionOfTwoLinesFunc, [ + "minM=-10", "maxM=10", "minB=-10", "maxB=10", "minDenominator=1", + "maxDenominator=6" + ]) diff --git a/mathgenerator/funcs/algebra/invert_matrix.py b/mathgenerator/funcs/algebra/invert_matrix.py index e40120b..6879b89 100644 --- a/mathgenerator/funcs/algebra/invert_matrix.py +++ b/mathgenerator/funcs/algebra/invert_matrix.py @@ -83,6 +83,7 @@ def matrixInversion(SquareMatrixDimension=3, return Mat, sympy.Matrix.inv(Mat) -invert_matrix = Generator("Inverse of a Matrix", 74, - matrixInversion, - ["SquareMatrixDimension=3", "MaxMatrixElement=99", "OnlyIntegerElementsInInvertedMatrix=False"]) +invert_matrix = Generator("Inverse of a Matrix", 74, matrixInversion, [ + "SquareMatrixDimension=3", "MaxMatrixElement=99", + "OnlyIntegerElementsInInvertedMatrix=False" +]) diff --git a/mathgenerator/funcs/algebra/log.py b/mathgenerator/funcs/algebra/log.py index 816a90d..4960382 100644 --- a/mathgenerator/funcs/algebra/log.py +++ b/mathgenerator/funcs/algebra/log.py @@ -19,5 +19,4 @@ def logFunc(maxBase=3, maxVal=8, format='string'): return b, c, a -log = Generator("Logarithm", 12, logFunc, - ["maxBase=3", "maxVal=8"]) +log = Generator("Logarithm", 12, logFunc, ["maxBase=3", "maxVal=8"]) diff --git a/mathgenerator/funcs/algebra/midpoint_of_two_points.py b/mathgenerator/funcs/algebra/midpoint_of_two_points.py index 063610c..1191cf4 100644 --- a/mathgenerator/funcs/algebra/midpoint_of_two_points.py +++ b/mathgenerator/funcs/algebra/midpoint_of_two_points.py @@ -18,5 +18,4 @@ def MidPointOfTwoPointFunc(maxValue=20, format='string'): midPoint_of_two_points = Generator("Midpoint of the two point", 20, - MidPointOfTwoPointFunc, - ["maxValue=20"]) + MidPointOfTwoPointFunc, ["maxValue=20"]) diff --git a/mathgenerator/funcs/algebra/multiply_complex_numbers.py b/mathgenerator/funcs/algebra/multiply_complex_numbers.py index a9f8400..e98622a 100644 --- a/mathgenerator/funcs/algebra/multiply_complex_numbers.py +++ b/mathgenerator/funcs/algebra/multiply_complex_numbers.py @@ -17,6 +17,6 @@ def multiplyComplexNumbersFunc(minRealImaginaryNum=-20, return num1, num2, product -multiply_complex_numbers = Generator("Multiplication of 2 complex numbers", 65, - multiplyComplexNumbersFunc, - ["minRealImaginaryNum=-20", "maxRealImaginaryNum=20"]) +multiply_complex_numbers = Generator( + "Multiplication of 2 complex numbers", 65, multiplyComplexNumbersFunc, + ["minRealImaginaryNum=-20", "maxRealImaginaryNum=20"]) diff --git a/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py b/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py index 0f3e723..4e8efec 100644 --- a/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py +++ b/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py @@ -20,7 +20,8 @@ def multiplyIntToMatrix22(maxMatrixVal=10, maxRes=100, format='string'): return problem, solution elif style == 'latex': problem = "\\(" + str(constant) + "\\cdot\\begin{bmatrix}" + str( - a) + "&" + str(b) + "\\\\" + str(c) + "&" + str(d) + "\\end{bmatrix}=\\)" + a) + "&" + str(b) + "\\\\" + str(c) + "&" + str( + d) + "\\end{bmatrix}=\\)" solution = "\\(\\begin{bmatrix}" + str(a1) + "&" + str(b1) + \ "\\\\" + str(c1) + "&" + str(d1) + "\\end{bmatrix}\\)" return problem, solution diff --git a/mathgenerator/funcs/algebra/quadratic_equation.py b/mathgenerator/funcs/algebra/quadratic_equation.py index b3f3dbf..6c26771 100644 --- a/mathgenerator/funcs/algebra/quadratic_equation.py +++ b/mathgenerator/funcs/algebra/quadratic_equation.py @@ -11,16 +11,14 @@ def quadraticEquation(maxVal=100, format='string'): D = math.sqrt(b * b - 4 * a * c) res = [round((-b + D) / (2 * a), 2), round((-b - D) / (2 * a), 2)] - if format == 'string': - problem = "Zeros of the Quadratic Equation {}x^2+{}x+{}=0".format(a, b, c) + problem = "Zeros of the Quadratic Equation {}x^2+{}x+{}=0".format( + a, b, c) solution = str(res) return problem, solution else: return a, b, c, res -quadratic_equation = Generator( - "Quadratic Equation", 50, - quadraticEquation, - ["maxVal=100"]) +quadratic_equation = Generator("Quadratic Equation", 50, quadraticEquation, + ["maxVal=100"]) diff --git a/mathgenerator/funcs/algebra/simple_interest.py b/mathgenerator/funcs/algebra/simple_interest.py index e9152b1..ffa9ab9 100644 --- a/mathgenerator/funcs/algebra/simple_interest.py +++ b/mathgenerator/funcs/algebra/simple_interest.py @@ -1,7 +1,10 @@ from .__init__ import * -def simpleInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, format='string'): +def simpleInterestFunc(maxPrinciple=10000, + maxRate=10, + maxTime=10, + format='string'): a = random.randint(1000, maxPrinciple) b = random.randint(1, maxRate) c = random.randint(1, maxTime) @@ -18,6 +21,5 @@ def simpleInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, format='strin return a, b, c, d -simple_interest = Generator( - "Simple Interest", 45, simpleInterestFunc, - ["maxPrinciple=10000", "maxRate=10", "maxTime=10"]) +simple_interest = Generator("Simple Interest", 45, simpleInterestFunc, + ["maxPrinciple=10000", "maxRate=10", "maxTime=10"]) diff --git a/mathgenerator/funcs/algebra/system_of_equations.py b/mathgenerator/funcs/algebra/system_of_equations.py index e4a6cb1..c3a78aa 100644 --- a/mathgenerator/funcs/algebra/system_of_equations.py +++ b/mathgenerator/funcs/algebra/system_of_equations.py @@ -1,7 +1,10 @@ from .__init__ import * -def systemOfEquationsFunc(range_x=10, range_y=10, coeff_mult_range=10, format='string'): +def systemOfEquationsFunc(range_x=10, + range_y=10, + coeff_mult_range=10, + format='string'): # Generate solution point first x = random.randint(-range_x, range_x) y = random.randint(-range_y, range_y) @@ -50,6 +53,6 @@ def systemOfEquationsFunc(range_x=10, range_y=10, coeff_mult_range=10, format='s # Add random (non-zero) multiple of equations to each other -system_of_equations = Generator("Solve a System of Equations in R^2", 23, - systemOfEquationsFunc, - ["range_x=10", "range_y=10", "coeff_mult_range=10"]) +system_of_equations = Generator( + "Solve a System of Equations in R^2", 23, systemOfEquationsFunc, + ["range_x=10", "range_y=10", "coeff_mult_range=10"]) diff --git a/mathgenerator/funcs/algebra/vector_cross.py b/mathgenerator/funcs/algebra/vector_cross.py index e71c79c..a428060 100644 --- a/mathgenerator/funcs/algebra/vector_cross.py +++ b/mathgenerator/funcs/algebra/vector_cross.py @@ -17,6 +17,5 @@ def vectorCrossFunc(minVal=-20, maxVal=20, format='string'): return a, b, c -vector_cross = Generator("Cross Product of 2 Vectors", 43, - vectorCrossFunc, +vector_cross = Generator("Cross Product of 2 Vectors", 43, vectorCrossFunc, ["minVal=-20", "maxVal=20"]) diff --git a/mathgenerator/funcs/algebra/vector_dot.py b/mathgenerator/funcs/algebra/vector_dot.py index 3487787..4d3180c 100644 --- a/mathgenerator/funcs/algebra/vector_dot.py +++ b/mathgenerator/funcs/algebra/vector_dot.py @@ -14,6 +14,5 @@ def vectorDotFunc(minVal=-20, maxVal=20, format='string'): return a, b, c -vector_dot = Generator("Dot Product of 2 Vectors", 72, - vectorDotFunc, +vector_dot = Generator("Dot Product of 2 Vectors", 72, vectorDotFunc, ["minVal=-20", "maxVal=20"]) diff --git a/mathgenerator/funcs/basic_math/absolute_difference.py b/mathgenerator/funcs/basic_math/absolute_difference.py index 4a7c34e..091348f 100644 --- a/mathgenerator/funcs/basic_math/absolute_difference.py +++ b/mathgenerator/funcs/basic_math/absolute_difference.py @@ -9,13 +9,10 @@ def main(maxA=100, maxB=100, format='string'): if format == "string": return "|" + str(a) + "-" + str(b) + "|=", absDiff elif format == 'latex': - return ("\\(|" + str(a) + "-" + str(b) + "|=\\)", - f"\\({absDiff}\\)") + return ("\\(|" + str(a) + "-" + str(b) + "|=\\)", f"\\({absDiff}\\)") else: return a, b, absDiff -absolute_difference = Generator( - "Absolute difference between two numbers", 71, - main, - ["maxA=100", "maxB=100"]) +absolute_difference = Generator("Absolute difference between two numbers", 71, + main, ["maxA=100", "maxB=100"]) diff --git a/mathgenerator/funcs/basic_math/compare_fractions.py b/mathgenerator/funcs/basic_math/compare_fractions.py index 3c8b0c3..a2da776 100644 --- a/mathgenerator/funcs/basic_math/compare_fractions.py +++ b/mathgenerator/funcs/basic_math/compare_fractions.py @@ -23,16 +23,16 @@ def compareFractionsFunc(maxVal=10, format='string'): solution = "=" if format == "string": - return (f"Which symbol represents the comparison between {a}/{b} and {c}/{d}?", + return ( + f"Which symbol represents the comparison between {a}/{b} and {c}/{d}?", solution) elif format == 'latex': - return (f"Which symbol represents the comparison between \\(\\frac{{{a}}}{{{b}}}\\) and \\(\\frac{{{c}}}{{{d}}}\\)?", + return ( + f"Which symbol represents the comparison between \\(\\frac{{{a}}}{{{b}}}\\) and \\(\\frac{{{c}}}{{{d}}}\\)?", solution) else: return a, b, c, d, solution -compare_fractions = Generator( - "Compare Fractions", 44, - compareFractionsFunc, - ["maxVal=10"]) +compare_fractions = Generator("Compare Fractions", 44, compareFractionsFunc, + ["maxVal=10"]) diff --git a/mathgenerator/funcs/basic_math/complex_division.py b/mathgenerator/funcs/basic_math/complex_division.py index da0dc5a..b962661 100644 --- a/mathgenerator/funcs/basic_math/complex_division.py +++ b/mathgenerator/funcs/basic_math/complex_division.py @@ -8,11 +8,10 @@ def complexDivisionFunc(maxRes=99, maxDivid=99, format='string'): c = round(c, 2) if format == "string": - return (str(a) + "/" + str(b) + "=", - str(c)) + return (str(a) + "/" + str(b) + "=", str(c)) elif format == 'latex': return ("\\(" + str(a) + "\\div" + str(b) + "=\\)", - "\\(" + str(c) + "\\)") + "\\(" + str(c) + "\\)") else: return a, b, c diff --git a/mathgenerator/funcs/basic_math/cube_root.py b/mathgenerator/funcs/basic_math/cube_root.py index 5c07726..d38c84a 100644 --- a/mathgenerator/funcs/basic_math/cube_root.py +++ b/mathgenerator/funcs/basic_math/cube_root.py @@ -6,15 +6,12 @@ def cubeRootFunc(minNo=1, maxNo=1000, format='string'): a = b**(1 / 3) if format == 'string': - return ("What is the cube root of " + str(b) + " up to 2 decimal places?", - str(round(a, 2))) + return ("What is the cube root of " + str(b) + + " up to 2 decimal places?", str(round(a, 2))) elif format == 'latex': - return (f"\\(\\sqrt[3]{{{b}}}=\\)", - "\\(" + str(round(a, 2)) + "\\)") + return (f"\\(\\sqrt[3]{{{b}}}=\\)", "\\(" + str(round(a, 2)) + "\\)") else: return b, a -cube_root = Generator("Cube Root", 47, - cubeRootFunc, - ["minNo=1", "maxNo=1000"]) +cube_root = Generator("Cube Root", 47, cubeRootFunc, ["minNo=1", "maxNo=1000"]) diff --git a/mathgenerator/funcs/basic_math/divide_fractions.py b/mathgenerator/funcs/basic_math/divide_fractions.py index f387f2b..d1d8eb6 100644 --- a/mathgenerator/funcs/basic_math/divide_fractions.py +++ b/mathgenerator/funcs/basic_math/divide_fractions.py @@ -44,6 +44,5 @@ def divideFractionsFunc(maxVal=10, format='string'): return a, b, c, d, x -divide_fractions = Generator("Fraction Division", 16, - divideFractionsFunc, +divide_fractions = Generator("Fraction Division", 16, divideFractionsFunc, ["maxVal=10"]) diff --git a/mathgenerator/funcs/basic_math/division.py b/mathgenerator/funcs/basic_math/division.py index 078a338..a381615 100644 --- a/mathgenerator/funcs/basic_math/division.py +++ b/mathgenerator/funcs/basic_math/division.py @@ -13,10 +13,9 @@ def divisionToIntFunc(maxA=25, maxB=25, format='string'): return f"{divisor}/{dividend}=", str(quotient) elif format == 'latex': return ("\\(" + str(divisor) + "\\div" + str(dividend) + "=\\)", - "\\(" + str(quotient) + "\\)") + "\\(" + str(quotient) + "\\)") else: return divisor, dividend, quotient -division = Generator("Division", 3, - divisionToIntFunc, ["maxA=25", "maxB=25"]) +division = Generator("Division", 3, divisionToIntFunc, ["maxA=25", "maxB=25"]) diff --git a/mathgenerator/funcs/basic_math/exponentiation.py b/mathgenerator/funcs/basic_math/exponentiation.py index b332c68..f6fe824 100644 --- a/mathgenerator/funcs/basic_math/exponentiation.py +++ b/mathgenerator/funcs/basic_math/exponentiation.py @@ -6,14 +6,12 @@ def exponentiationFunc(maxBase=20, maxExpo=10, format='string'): expo = random.randint(1, maxExpo) if format == 'string': - return (f"{base}^{expo} =", - str(base**expo)) + return (f"{base}^{expo} =", str(base**expo)) elif format == 'latex': return f"\\({base}^{{{expo}}}\\)", "\\(" + str(base**expo) + "\\)" else: return base, expo, base**expo -exponentiation = Generator("Exponentiation", 53, - exponentiationFunc, +exponentiation = Generator("Exponentiation", 53, exponentiationFunc, ["maxBase=20", "maxExpo=10"]) diff --git a/mathgenerator/funcs/basic_math/factorial.py b/mathgenerator/funcs/basic_math/factorial.py index b372ed7..8bf8540 100644 --- a/mathgenerator/funcs/basic_math/factorial.py +++ b/mathgenerator/funcs/basic_math/factorial.py @@ -15,5 +15,4 @@ def factorialFunc(maxInput=6, format='string'): return a, b -factorial = Generator("Factorial", 31, - factorialFunc, ["maxInput=6"]) +factorial = Generator("Factorial", 31, factorialFunc, ["maxInput=6"]) diff --git a/mathgenerator/funcs/basic_math/fraction_multiplication.py b/mathgenerator/funcs/basic_math/fraction_multiplication.py index da6d603..d609bc9 100644 --- a/mathgenerator/funcs/basic_math/fraction_multiplication.py +++ b/mathgenerator/funcs/basic_math/fraction_multiplication.py @@ -41,5 +41,4 @@ def multiplyFractionsFunc(maxVal=10, format='string'): fraction_multiplication = Generator("Fraction Multiplication", 28, - multiplyFractionsFunc, - ["maxVal=10"]) + multiplyFractionsFunc, ["maxVal=10"]) diff --git a/mathgenerator/funcs/basic_math/is_prime.py b/mathgenerator/funcs/basic_math/is_prime.py index 608ae4e..b13d648 100644 --- a/mathgenerator/funcs/basic_math/is_prime.py +++ b/mathgenerator/funcs/basic_math/is_prime.py @@ -22,6 +22,4 @@ def isprime(max_num=100, format='string'): return a, solution -is_prime = Generator('isprime', 90, - isprime, - ["max_num=100"]) +is_prime = Generator('isprime', 90, isprime, ["max_num=100"]) diff --git a/mathgenerator/funcs/basic_math/multiplication.py b/mathgenerator/funcs/basic_math/multiplication.py index 91932bb..2412ad6 100644 --- a/mathgenerator/funcs/basic_math/multiplication.py +++ b/mathgenerator/funcs/basic_math/multiplication.py @@ -17,6 +17,5 @@ def multiplicationFunc(maxMulti=12, format='string'): return a, b, c -multiplication = Generator("Multiplication", 2, - multiplicationFunc, +multiplication = Generator("Multiplication", 2, multiplicationFunc, ["maxMulti=12"]) diff --git a/mathgenerator/funcs/basic_math/square_root.py b/mathgenerator/funcs/basic_math/square_root.py index fed358c..42c295d 100644 --- a/mathgenerator/funcs/basic_math/square_root.py +++ b/mathgenerator/funcs/basic_math/square_root.py @@ -18,4 +18,4 @@ def squareRootFunc(minNo=1, maxNo=12, format='string'): square_root = Generator("Square Root", 6, squareRootFunc, - ["minNo=1", "maxNo=12"]) + ["minNo=1", "maxNo=12"]) diff --git a/mathgenerator/funcs/basic_math/subtraction.py b/mathgenerator/funcs/basic_math/subtraction.py index c6a40a2..1368265 100644 --- a/mathgenerator/funcs/basic_math/subtraction.py +++ b/mathgenerator/funcs/basic_math/subtraction.py @@ -15,4 +15,4 @@ def subtractionFunc(maxMinuend=99, maxDiff=99, format='string'): subtraction = Generator("Subtraction", 1, subtractionFunc, - ["maxMinuend=99", "maxDiff=99"]) + ["maxMinuend=99", "maxDiff=99"]) diff --git a/mathgenerator/funcs/calculus/definite_integral.py b/mathgenerator/funcs/calculus/definite_integral.py index b3152c5..cb50bad 100644 --- a/mathgenerator/funcs/calculus/definite_integral.py +++ b/mathgenerator/funcs/calculus/definite_integral.py @@ -23,7 +23,5 @@ def definiteIntegralFunc(max_coeff=100, format='string'): return a, b, c, S -definite_integral = Generator( - "Definite Integral of Quadratic Equation", 89, - definiteIntegralFunc, - ["max_coeff=100"]) +definite_integral = Generator("Definite Integral of Quadratic Equation", 89, + definiteIntegralFunc, ["max_coeff=100"]) diff --git a/mathgenerator/funcs/calculus/differentiation.py b/mathgenerator/funcs/calculus/differentiation.py index 12e9ba3..87f9f61 100644 --- a/mathgenerator/funcs/calculus/differentiation.py +++ b/mathgenerator/funcs/calculus/differentiation.py @@ -51,6 +51,5 @@ def differentiationFunc(diff_lvl=2, format='string'): return problem, solution -differentiation = Generator("Differentiation", 88, - differentiationFunc, +differentiation = Generator("Differentiation", 88, differentiationFunc, ["diff_lvl=2"]) diff --git a/mathgenerator/funcs/calculus/power_rule_differentiation.py b/mathgenerator/funcs/calculus/power_rule_differentiation.py index dc383d9..7259a54 100644 --- a/mathgenerator/funcs/calculus/power_rule_differentiation.py +++ b/mathgenerator/funcs/calculus/power_rule_differentiation.py @@ -1,7 +1,10 @@ from .__init__ import * -def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5, format='string'): +def powerRuleDifferentiationFunc(maxCoef=10, + maxExp=10, + maxTerms=5, + format='string'): numTerms = random.randint(1, maxTerms) problem = "" solution = "" @@ -22,6 +25,6 @@ def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5, format='stri return problem, solution -power_rule_differentiation = Generator("Power Rule Differentiation", 7, - powerRuleDifferentiationFunc, - ["maxCoef=10", "maxExp=10", "maxTerms=5"]) +power_rule_differentiation = Generator( + "Power Rule Differentiation", 7, powerRuleDifferentiationFunc, + ["maxCoef=10", "maxExp=10", "maxTerms=5"]) diff --git a/mathgenerator/funcs/calculus/power_rule_integration.py b/mathgenerator/funcs/calculus/power_rule_integration.py index 8f77194..234ad7c 100644 --- a/mathgenerator/funcs/calculus/power_rule_integration.py +++ b/mathgenerator/funcs/calculus/power_rule_integration.py @@ -1,7 +1,10 @@ from .__init__ import * -def powerRuleIntegrationFunc(maxCoef=10, maxExp=10, maxTerms=5, format='string'): +def powerRuleIntegrationFunc(maxCoef=10, + maxExp=10, + maxTerms=5, + format='string'): numTerms = random.randint(1, maxTerms) problem = "" solution = "" @@ -26,5 +29,5 @@ def powerRuleIntegrationFunc(maxCoef=10, maxExp=10, maxTerms=5, format='string') power_rule_integration = Generator("Power Rule Integration", 48, - powerRuleIntegrationFunc, + powerRuleIntegrationFunc, ["maxCoef=10", "maxExp=10", "maxTerms=5"]) diff --git a/mathgenerator/funcs/calculus/stationary_points.py b/mathgenerator/funcs/calculus/stationary_points.py index a43cdc0..726c76a 100644 --- a/mathgenerator/funcs/calculus/stationary_points.py +++ b/mathgenerator/funcs/calculus/stationary_points.py @@ -12,10 +12,9 @@ def stationaryPointsFunc(maxExp=3, maxCoef=10, format='string'): solution = sympy.stationary_points(problem, x) #if len(solution) != 0: - solution = ','.join('({},{})'.format( - str(p), - sympy.sympify(problem.replace(x, p)) - ) for p in solution) + solution = ','.join( + '({},{})'.format(str(p), sympy.sympify(problem.replace(x, p))) + for p in solution) problem = 'f(x)=' + str(problem).replace('**', '^') if format == 'string': return problem, solution diff --git a/mathgenerator/funcs/computer_science/bcd_to_decimal.py b/mathgenerator/funcs/computer_science/bcd_to_decimal.py index e5ab574..09a8aa9 100644 --- a/mathgenerator/funcs/computer_science/bcd_to_decimal.py +++ b/mathgenerator/funcs/computer_science/bcd_to_decimal.py @@ -24,5 +24,4 @@ def BCDtoDecimalFunc(maxNumber=10000, format='string'): bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, - BCDtoDecimalFunc, - ["maxNumber=10000"]) + BCDtoDecimalFunc, ["maxNumber=10000"]) diff --git a/mathgenerator/funcs/computer_science/binary_2s_complement.py b/mathgenerator/funcs/computer_science/binary_2s_complement.py index cb8c514..b8202ed 100644 --- a/mathgenerator/funcs/computer_science/binary_2s_complement.py +++ b/mathgenerator/funcs/computer_science/binary_2s_complement.py @@ -32,5 +32,4 @@ def binary2sComplementFunc(maxDigits=10, format='string'): binary_2s_complement = Generator("Binary 2's Complement", 73, - binary2sComplementFunc, - ["maxDigits=10"]) + binary2sComplementFunc, ["maxDigits=10"]) diff --git a/mathgenerator/funcs/computer_science/binary_complement_1s.py b/mathgenerator/funcs/computer_science/binary_complement_1s.py index d38ac51..0e39d7c 100644 --- a/mathgenerator/funcs/computer_science/binary_complement_1s.py +++ b/mathgenerator/funcs/computer_science/binary_complement_1s.py @@ -18,5 +18,4 @@ def binaryComplement1sFunc(maxDigits=10, format='string'): binary_complement_1s = Generator("Binary Complement 1s", 4, - binaryComplement1sFunc, - ["maxDigits=10"]) + binaryComplement1sFunc, ["maxDigits=10"]) diff --git a/mathgenerator/funcs/computer_science/binary_to_decimal.py b/mathgenerator/funcs/computer_science/binary_to_decimal.py index fbab9fc..81e9873 100644 --- a/mathgenerator/funcs/computer_science/binary_to_decimal.py +++ b/mathgenerator/funcs/computer_science/binary_to_decimal.py @@ -15,6 +15,5 @@ def binaryToDecimalFunc(max_dig=10, format='string'): return problem, solution -binary_to_decimal = Generator("Binary to Decimal", 15, - binaryToDecimalFunc, +binary_to_decimal = Generator("Binary to Decimal", 15, binaryToDecimalFunc, ["max_dig=10"]) diff --git a/mathgenerator/funcs/computer_science/decimal_to_bcd.py b/mathgenerator/funcs/computer_science/decimal_to_bcd.py index a7ee973..52a273f 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_bcd.py +++ b/mathgenerator/funcs/computer_science/decimal_to_bcd.py @@ -17,5 +17,4 @@ def DecimalToBCDFunc(maxNumber=10000, format='string'): decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 103, - DecimalToBCDFunc, - ["maxNumber=10000"]) + DecimalToBCDFunc, ["maxNumber=10000"]) diff --git a/mathgenerator/funcs/computer_science/decimal_to_binary.py b/mathgenerator/funcs/computer_science/decimal_to_binary.py index a550e96..f47ce75 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_binary.py +++ b/mathgenerator/funcs/computer_science/decimal_to_binary.py @@ -11,6 +11,5 @@ def DecimalToBinaryFunc(max_dec=99, format='string'): return problem, solution -decimal_to_binary = Generator("Decimal to Binary", 14, - DecimalToBinaryFunc, +decimal_to_binary = Generator("Decimal to Binary", 14, DecimalToBinaryFunc, ["max_dec=99"]) diff --git a/mathgenerator/funcs/computer_science/decimal_to_octal.py b/mathgenerator/funcs/computer_science/decimal_to_octal.py index a4156e9..fc1b5f9 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_octal.py +++ b/mathgenerator/funcs/computer_science/decimal_to_octal.py @@ -13,5 +13,4 @@ def decimalToOctalFunc(maxDecimal=4096, format='string'): decimal_to_octal = Generator("Converts decimal to octal", 84, - decimalToOctalFunc, - ["maxDecimal=4096"]) + decimalToOctalFunc, ["maxDecimal=4096"]) diff --git a/mathgenerator/funcs/computer_science/fibonacci_series.py b/mathgenerator/funcs/computer_science/fibonacci_series.py index 2228a14..93a84e3 100644 --- a/mathgenerator/funcs/computer_science/fibonacci_series.py +++ b/mathgenerator/funcs/computer_science/fibonacci_series.py @@ -17,12 +17,12 @@ def fibonacciSeriesFunc(minNo=1, format='string'): fibList = createFibList(n) if format == 'string': - problem = "The Fibonacci Series of the first " + str(n) + " numbers is ?" + problem = "The Fibonacci Series of the first " + str( + n) + " numbers is ?" return problem, fibList else: return n, fibList -fibonacci_series = Generator( - "Fibonacci Series", 56, fibonacciSeriesFunc, - ["minNo=1"]) +fibonacci_series = Generator("Fibonacci Series", 56, fibonacciSeriesFunc, + ["minNo=1"]) diff --git a/mathgenerator/funcs/computer_science/nth_fibonacci_number.py b/mathgenerator/funcs/computer_science/nth_fibonacci_number.py index c333fd0..80d7ad0 100644 --- a/mathgenerator/funcs/computer_science/nth_fibonacci_number.py +++ b/mathgenerator/funcs/computer_science/nth_fibonacci_number.py @@ -7,7 +7,8 @@ def nthFibonacciNumberFunc(maxN=100, format='string'): golden_ratio = (1 + math.sqrt(5)) / 2 n = random.randint(1, maxN) problem = f"What is the {n}th Fibonacci number?" - ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / (math.sqrt(5))) + ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / + (math.sqrt(5))) if format == 'string': solution = f"{ans}" @@ -17,5 +18,4 @@ def nthFibonacciNumberFunc(maxN=100, format='string'): nth_fibonacci_number = Generator("nth Fibonacci number", 62, - nthFibonacciNumberFunc, - ["maxN=100"]) + nthFibonacciNumberFunc, ["maxN=100"]) diff --git a/mathgenerator/funcs/geometry/angle_btw_vectors.py b/mathgenerator/funcs/geometry/angle_btw_vectors.py index bf7c643..aade7ed 100644 --- a/mathgenerator/funcs/geometry/angle_btw_vectors.py +++ b/mathgenerator/funcs/geometry/angle_btw_vectors.py @@ -25,6 +25,5 @@ def angleBtwVectorsFunc(maxEltAmt=20, format='string'): return problem, solution -angle_btw_vectors = Generator( - "Angle between 2 vectors", 70, angleBtwVectorsFunc, - ["maxEltAmt=20"]) +angle_btw_vectors = Generator("Angle between 2 vectors", 70, + angleBtwVectorsFunc, ["maxEltAmt=20"]) diff --git a/mathgenerator/funcs/geometry/angle_regular_polygon.py b/mathgenerator/funcs/geometry/angle_regular_polygon.py index b09fc4b..b0ce535 100644 --- a/mathgenerator/funcs/geometry/angle_regular_polygon.py +++ b/mathgenerator/funcs/geometry/angle_regular_polygon.py @@ -14,7 +14,6 @@ def regularPolygonAngleFunc(minVal=3, maxVal=20, format='string'): return sideNum, solution -angle_regular_polygon = Generator( - "Angle of a Regular Polygon", 29, - regularPolygonAngleFunc, - ["minVal=3", "maxVal=20"]) +angle_regular_polygon = Generator("Angle of a Regular Polygon", 29, + regularPolygonAngleFunc, + ["minVal=3", "maxVal=20"]) diff --git a/mathgenerator/funcs/geometry/area_of_triangle.py b/mathgenerator/funcs/geometry/area_of_triangle.py index 676ed11..b223104 100644 --- a/mathgenerator/funcs/geometry/area_of_triangle.py +++ b/mathgenerator/funcs/geometry/area_of_triangle.py @@ -18,6 +18,5 @@ def areaOfTriangleFunc(maxA=20, maxB=20, maxC=20, format='string'): return a, b, c, area -area_of_triangle = Generator("Area of Triangle", 18, - areaOfTriangleFunc, +area_of_triangle = Generator("Area of Triangle", 18, areaOfTriangleFunc, ["maxA=20", "maxB=20", "maxC=20"]) diff --git a/mathgenerator/funcs/geometry/basic_trigonometry.py b/mathgenerator/funcs/geometry/basic_trigonometry.py index 55c601d..ae9b0a5 100644 --- a/mathgenerator/funcs/geometry/basic_trigonometry.py +++ b/mathgenerator/funcs/geometry/basic_trigonometry.py @@ -5,7 +5,8 @@ import math # Handles degrees in quadrant one def basicTrigonometryFunc(angles=[0, 30, 45, 60, 90], - functions=["sin", "cos", "tan"], format='string'): + functions=["sin", "cos", "tan"], + format='string'): angle = random.choice(angles) function = random.choice(functions) @@ -31,5 +32,6 @@ def basicTrigonometryFunc(angles=[0, 30, 45, 60, 90], return function, angle, solution -basic_trigonometry = Generator("Trigonometric Values", 57, basicTrigonometryFunc, - ["angles=[0, 30, 45, 60, 90]", "functions=['sin', 'cos', 'tan']"]) +basic_trigonometry = Generator( + "Trigonometric Values", 57, basicTrigonometryFunc, + ["angles=[0, 30, 45, 60, 90]", "functions=['sin', 'cos', 'tan']"]) diff --git a/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py b/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py index 6007316..7d8375c 100644 --- a/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py +++ b/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py @@ -15,7 +15,6 @@ def curvedSurfaceAreaCylinderFunc(maxRadius=49, maxHeight=99, format='string'): return r, h, formatted_float -curved_surface_area_cylinder = Generator( - "Curved surface area of a cylinder", 95, - curvedSurfaceAreaCylinderFunc, - ["maxRadius=49", "maxHeight=99"]) +curved_surface_area_cylinder = Generator("Curved surface area of a cylinder", + 95, curvedSurfaceAreaCylinderFunc, + ["maxRadius=49", "maxHeight=99"]) diff --git a/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py b/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py index b8b76c9..27a7677 100644 --- a/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py +++ b/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py @@ -17,7 +17,6 @@ def fourthAngleOfQuadriFunc(maxAngle=180, format='string'): return angle1, angle2, angle3, angle4 -fourth_angle_of_quadrilateral = Generator( - "Fourth Angle of Quadrilateral", 49, - fourthAngleOfQuadriFunc, - ["maxAngle=180"]) +fourth_angle_of_quadrilateral = Generator("Fourth Angle of Quadrilateral", 49, + fourthAngleOfQuadriFunc, + ["maxAngle=180"]) diff --git a/mathgenerator/funcs/geometry/perimeter_of_polygons.py b/mathgenerator/funcs/geometry/perimeter_of_polygons.py index 33c45d2..72948ac 100644 --- a/mathgenerator/funcs/geometry/perimeter_of_polygons.py +++ b/mathgenerator/funcs/geometry/perimeter_of_polygons.py @@ -18,7 +18,6 @@ def perimeterOfPolygons(maxSides=12, maxLength=120, format='string'): return size_of_sides, sides, solution -perimeter_of_polygons = Generator( - "Perimeter of Polygons", 96, - perimeterOfPolygons, - ["maxSides=12", "maxLength=120"]) +perimeter_of_polygons = Generator("Perimeter of Polygons", 96, + perimeterOfPolygons, + ["maxSides=12", "maxLength=120"]) diff --git a/mathgenerator/funcs/geometry/pythagorean_theorem.py b/mathgenerator/funcs/geometry/pythagorean_theorem.py index 3103b6c..5021aa3 100644 --- a/mathgenerator/funcs/geometry/pythagorean_theorem.py +++ b/mathgenerator/funcs/geometry/pythagorean_theorem.py @@ -11,9 +11,8 @@ def pythagoreanTheoremFunc(maxLength=20, format='string'): solution = f"{c:.0f}" if c.is_integer() else f"{c:.2f}" return problem, solution else: - return a, b, round(c,2) + return a, b, round(c, 2) -pythagorean_theorem = Generator( - "Pythagorean Theorem", 25, pythagoreanTheoremFunc, - ["maxLength=20"]) +pythagorean_theorem = Generator("Pythagorean Theorem", 25, + pythagoreanTheoremFunc, ["maxLength=20"]) diff --git a/mathgenerator/funcs/geometry/sum_of_polygon_angles.py b/mathgenerator/funcs/geometry/sum_of_polygon_angles.py index f5b13fe..3bf4c71 100644 --- a/mathgenerator/funcs/geometry/sum_of_polygon_angles.py +++ b/mathgenerator/funcs/geometry/sum_of_polygon_angles.py @@ -13,5 +13,4 @@ def sumOfAnglesOfPolygonFunc(maxSides=12, format='string'): sum_of_polygon_angles = Generator("Sum of Angles of Polygon", 58, - sumOfAnglesOfPolygonFunc, - ["maxSides=12"]) + sumOfAnglesOfPolygonFunc, ["maxSides=12"]) diff --git a/mathgenerator/funcs/geometry/surface_area_cone.py b/mathgenerator/funcs/geometry/surface_area_cone.py index df57259..0efb53f 100644 --- a/mathgenerator/funcs/geometry/surface_area_cone.py +++ b/mathgenerator/funcs/geometry/surface_area_cone.py @@ -16,7 +16,5 @@ def surfaceAreaCone(maxRadius=20, maxHeight=50, unit='m', format='string'): return a, b, ans, unit -surface_area_cone = Generator( - "Surface Area of cone", 38, - surfaceAreaCone, - ["maxRadius=20", "maxHeight=50", "unit='m'"]) +surface_area_cone = Generator("Surface Area of cone", 38, surfaceAreaCone, + ["maxRadius=20", "maxHeight=50", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/surface_area_cube.py b/mathgenerator/funcs/geometry/surface_area_cube.py index 76e0c79..6306439 100644 --- a/mathgenerator/funcs/geometry/surface_area_cube.py +++ b/mathgenerator/funcs/geometry/surface_area_cube.py @@ -13,6 +13,5 @@ def surfaceAreaCube(maxSide=20, unit='m', format='string'): return a, ans, unit -surface_area_cube = Generator("Surface Area of Cube", 32, - surfaceAreaCube, +surface_area_cube = Generator("Surface Area of Cube", 32, surfaceAreaCube, ["maxSide=20", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/surface_area_cuboid.py b/mathgenerator/funcs/geometry/surface_area_cuboid.py index 7a42b47..c6c3108 100644 --- a/mathgenerator/funcs/geometry/surface_area_cuboid.py +++ b/mathgenerator/funcs/geometry/surface_area_cuboid.py @@ -15,7 +15,5 @@ def surfaceAreaCuboid(maxSide=20, unit='m', format='string'): return a, b, c, ans, unit -surface_area_cuboid = Generator( - "Surface Area of Cuboid", 33, - surfaceAreaCuboid, - ["maxSide=20", "unit='m'"]) +surface_area_cuboid = Generator("Surface Area of Cuboid", 33, + surfaceAreaCuboid, ["maxSide=20", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/surface_area_cylinder.py b/mathgenerator/funcs/geometry/surface_area_cylinder.py index 4b04fba..63a3dcb 100644 --- a/mathgenerator/funcs/geometry/surface_area_cylinder.py +++ b/mathgenerator/funcs/geometry/surface_area_cylinder.py @@ -14,7 +14,6 @@ def surfaceAreaCylinder(maxRadius=20, maxHeight=50, unit='m', format='string'): return a, b, ans, unit -surface_area_cylinder = Generator( - "Surface Area of Cylinder", 34, - surfaceAreaCylinder, - ["maxRadius=20", "maxHeight=50", "unit='m'"]) +surface_area_cylinder = Generator("Surface Area of Cylinder", 34, + surfaceAreaCylinder, + ["maxRadius=20", "maxHeight=50", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/surface_area_sphere.py b/mathgenerator/funcs/geometry/surface_area_sphere.py index bc07beb..51828e2 100644 --- a/mathgenerator/funcs/geometry/surface_area_sphere.py +++ b/mathgenerator/funcs/geometry/surface_area_sphere.py @@ -13,7 +13,5 @@ def surfaceAreaSphere(maxSide=20, unit='m', format='string'): return r, ans, unit -surface_area_sphere = Generator( - "Surface Area of Sphere", 60, - surfaceAreaSphere, - ["maxSide=20", "unit='m'"]) +surface_area_sphere = Generator("Surface Area of Sphere", 60, + surfaceAreaSphere, ["maxSide=20", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/third_angle_of_triangle.py b/mathgenerator/funcs/geometry/third_angle_of_triangle.py index 8aa8f50..4aeb6c4 100644 --- a/mathgenerator/funcs/geometry/third_angle_of_triangle.py +++ b/mathgenerator/funcs/geometry/third_angle_of_triangle.py @@ -14,5 +14,4 @@ def thirdAngleOfTriangleFunc(maxAngle=89, format='string'): third_angle_of_triangle = Generator("Third Angle of Triangle", 22, - thirdAngleOfTriangleFunc, - ["maxAngle=89"]) + thirdAngleOfTriangleFunc, ["maxAngle=89"]) diff --git a/mathgenerator/funcs/geometry/valid_triangle.py b/mathgenerator/funcs/geometry/valid_triangle.py index 7aaa7eb..145edc1 100644 --- a/mathgenerator/funcs/geometry/valid_triangle.py +++ b/mathgenerator/funcs/geometry/valid_triangle.py @@ -23,6 +23,5 @@ def isTriangleValidFunc(maxSideLength=50, format='string'): return sideA, sideB, sideC, exists -valid_triangle = Generator("Triangle exists check", 19, - isTriangleValidFunc, +valid_triangle = Generator("Triangle exists check", 19, isTriangleValidFunc, ["maxSideLength=50"]) diff --git a/mathgenerator/funcs/geometry/volume_cone.py b/mathgenerator/funcs/geometry/volume_cone.py index fb8abfd..de50796 100644 --- a/mathgenerator/funcs/geometry/volume_cone.py +++ b/mathgenerator/funcs/geometry/volume_cone.py @@ -14,7 +14,5 @@ def volumeCone(maxRadius=20, maxHeight=50, unit='m', format='string'): return a, b, ans, unit -volume_cone = Generator( - "Volume of cone", 39, - volumeCone, - ["maxRadius=20", "maxHeight=50", "unit='m'"]) +volume_cone = Generator("Volume of cone", 39, volumeCone, + ["maxRadius=20", "maxHeight=50", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/volume_cube.py b/mathgenerator/funcs/geometry/volume_cube.py index eb5d62f..69ce7d3 100644 --- a/mathgenerator/funcs/geometry/volume_cube.py +++ b/mathgenerator/funcs/geometry/volume_cube.py @@ -3,7 +3,7 @@ from .__init__ import * def volumeCube(maxSide=20, unit='m', format='string'): a = random.randint(1, maxSide) - ans = a ** 3 + ans = a**3 if format == 'string': problem = f"Volume of cube with side = {a}{unit} is" @@ -13,6 +13,5 @@ def volumeCube(maxSide=20, unit='m', format='string'): return a, ans, unit -volume_cube = Generator("Volum of Cube", 35, - volumeCube, +volume_cube = Generator("Volum of Cube", 35, volumeCube, ["maxSide=20", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/volume_cuboid.py b/mathgenerator/funcs/geometry/volume_cuboid.py index e3d47ef..3f17efc 100644 --- a/mathgenerator/funcs/geometry/volume_cuboid.py +++ b/mathgenerator/funcs/geometry/volume_cuboid.py @@ -15,7 +15,5 @@ def volumeCuboid(maxSide=20, unit='m', format='string'): return a, b, c, ans, unit -volume_cuboid = Generator( - "Volume of Cuboid", 36, - volumeCuboid, - ["maxSide=20", "unit='m'"]) +volume_cuboid = Generator("Volume of Cuboid", 36, volumeCuboid, + ["maxSide=20", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/volume_cylinder.py b/mathgenerator/funcs/geometry/volume_cylinder.py index 7bb7006..e08a688 100644 --- a/mathgenerator/funcs/geometry/volume_cylinder.py +++ b/mathgenerator/funcs/geometry/volume_cylinder.py @@ -14,7 +14,5 @@ def volumeCylinder(maxRadius=20, maxHeight=50, unit='m', format='string'): return a, b, ans, unit -volume_cylinder = Generator( - "Volume of cylinder", 37, - volumeCylinder, - ["maxRadius=20", "maxHeight=50", "unit='m'"]) +volume_cylinder = Generator("Volume of cylinder", 37, volumeCylinder, + ["maxRadius=20", "maxHeight=50", "unit='m'"]) diff --git a/mathgenerator/funcs/geometry/volume_sphere.py b/mathgenerator/funcs/geometry/volume_sphere.py index 616b5a2..ed922b1 100644 --- a/mathgenerator/funcs/geometry/volume_sphere.py +++ b/mathgenerator/funcs/geometry/volume_sphere.py @@ -3,7 +3,7 @@ from .__init__ import * def volumeSphereFunc(maxRadius=100, format='string'): r = random.randint(1, maxRadius) - ans = (4 * math.pi / 3) * r ** 3 + ans = (4 * math.pi / 3) * r**3 if format == 'string': problem = f"Volume of sphere with radius {r} m = " @@ -13,6 +13,5 @@ def volumeSphereFunc(maxRadius=100, format='string'): return r, ans -volume_sphere = Generator("Volume of Sphere", 61, - volumeSphereFunc, +volume_sphere = Generator("Volume of Sphere", 61, volumeSphereFunc, ["maxRadius=100"]) diff --git a/mathgenerator/funcs/misc/arithmetic_progression_sum.py b/mathgenerator/funcs/misc/arithmetic_progression_sum.py index 218b979..c32b915 100644 --- a/mathgenerator/funcs/misc/arithmetic_progression_sum.py +++ b/mathgenerator/funcs/misc/arithmetic_progression_sum.py @@ -1,7 +1,10 @@ from .__init__ import * -def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100, format='string'): +def arithmeticProgressionSumFunc(maxd=100, + maxa=100, + maxn=100, + format='string'): d = random.randint(-1 * maxd, maxd) a1 = random.randint(-1 * maxa, maxa) a2 = a1 + d @@ -11,7 +14,6 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100, format='string'): an = a1 + (n - 1) * d solution = n * (a1 + an) / 2 - if format == 'string': problem = 'Find the sum of first ' + \ str(n) + ' terms of the AP series: ' + apString @@ -20,7 +22,6 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100, format='string'): return n, apString, solution -arithmetic_progression_sum = Generator( - "AP Sum Calculation", 83, - arithmeticProgressionSumFunc, - ["maxd=100", "maxa=100", "maxn=100"]) +arithmetic_progression_sum = Generator("AP Sum Calculation", 83, + arithmeticProgressionSumFunc, + ["maxd=100", "maxa=100", "maxn=100"]) diff --git a/mathgenerator/funcs/misc/arithmetic_progression_term.py b/mathgenerator/funcs/misc/arithmetic_progression_term.py index 68588e4..1ad47a2 100644 --- a/mathgenerator/funcs/misc/arithmetic_progression_term.py +++ b/mathgenerator/funcs/misc/arithmetic_progression_term.py @@ -1,7 +1,10 @@ from .__init__ import * -def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100, format='string'): +def arithmeticProgressionTermFunc(maxd=100, + maxa=100, + maxn=100, + format='string'): d = random.randint(-1 * maxd, maxd) a1 = random.randint(-1 * maxa, maxa) a2 = a1 + d @@ -18,7 +21,6 @@ def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100, format='string') return n, apString, solution -arithmetic_progression_term = Generator( - "AP Term Calculation", 82, - arithmeticProgressionTermFunc, - ["maxd=100", "maxa=100", "maxn=100"]) +arithmetic_progression_term = Generator("AP Term Calculation", 82, + arithmeticProgressionTermFunc, + ["maxd=100", "maxa=100", "maxn=100"]) diff --git a/mathgenerator/funcs/misc/base_conversion.py b/mathgenerator/funcs/misc/base_conversion.py index 82a3162..5ad2294 100644 --- a/mathgenerator/funcs/misc/base_conversion.py +++ b/mathgenerator/funcs/misc/base_conversion.py @@ -53,9 +53,9 @@ def baseConversionFunc(maxNum=60000, maxBase=16, format='string'): ans = fromBaseTenTo(n, bases[1]) return problem, ans else: - return fromBaseTenTo(n, bases[0]), bases[0], bases[1], fromBaseTenTo(n, bases[1]) + return fromBaseTenTo(n, bases[0]), bases[0], bases[1], fromBaseTenTo( + n, bases[1]) -base_conversion = Generator("Base Conversion", 94, - baseConversionFunc, +base_conversion = Generator("Base Conversion", 94, baseConversionFunc, ["maxNum=60000", "maxBase=16"]) diff --git a/mathgenerator/funcs/misc/celsius_to_fahrenheit.py b/mathgenerator/funcs/misc/celsius_to_fahrenheit.py index 2cb1260..f80ad6b 100644 --- a/mathgenerator/funcs/misc/celsius_to_fahrenheit.py +++ b/mathgenerator/funcs/misc/celsius_to_fahrenheit.py @@ -15,5 +15,4 @@ def celsiustofahrenheitFunc(maxTemp=100, format='string'): celsius_to_fahrenheit = Generator("Celsius To Fahrenheit", 81, - celsiustofahrenheitFunc, - ["maxTemp=100"]) + celsiustofahrenheitFunc, ["maxTemp=100"]) diff --git a/mathgenerator/funcs/misc/common_factors.py b/mathgenerator/funcs/misc/common_factors.py index 0d46fae..62e8710 100644 --- a/mathgenerator/funcs/misc/common_factors.py +++ b/mathgenerator/funcs/misc/common_factors.py @@ -27,6 +27,5 @@ def commonFactorsFunc(maxVal=100, format='string'): return a, b, arr -common_factors = Generator("Common Factors", 40, - commonFactorsFunc, +common_factors = Generator("Common Factors", 40, commonFactorsFunc, ["maxVal=100"]) diff --git a/mathgenerator/funcs/misc/complex_to_polar.py b/mathgenerator/funcs/misc/complex_to_polar.py index 77d8c8d..c57f045 100644 --- a/mathgenerator/funcs/misc/complex_to_polar.py +++ b/mathgenerator/funcs/misc/complex_to_polar.py @@ -3,7 +3,9 @@ from .__init__ import * import math -def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20, format='string'): +def complexToPolarFunc(minRealImaginaryNum=-20, + maxRealImaginaryNum=20, + format='string'): num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum)) a = num.real @@ -18,5 +20,6 @@ def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20, format=' return r, a, b, theta -complex_to_polar = Generator("Complex To Polar Form", 92, complexToPolarFunc, - ["minRealImaginaryNum=-20, maxRealImaginaryNum=20"]) +complex_to_polar = Generator( + "Complex To Polar Form", 92, complexToPolarFunc, + ["minRealImaginaryNum=-20, maxRealImaginaryNum=20"]) diff --git a/mathgenerator/funcs/misc/decimal_to_roman_numerals.py b/mathgenerator/funcs/misc/decimal_to_roman_numerals.py index ade0866..0c238cf 100644 --- a/mathgenerator/funcs/misc/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/misc/decimal_to_roman_numerals.py @@ -26,7 +26,8 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000, format='string'): elif last_value == 4: solution += (roman_dict[divisor] + roman_dict[divisor * 5]) elif 5 <= last_value <= 8: - solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5))) + solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * + (last_value - 5))) elif last_value == 9: solution += (roman_dict[divisor] + roman_dict[divisor * 10]) x = math.floor(x % divisor) diff --git a/mathgenerator/funcs/misc/euclidian_norm.py b/mathgenerator/funcs/misc/euclidian_norm.py index ef1ad25..b46efa5 100644 --- a/mathgenerator/funcs/misc/euclidian_norm.py +++ b/mathgenerator/funcs/misc/euclidian_norm.py @@ -16,6 +16,5 @@ def euclidianNormFunc(maxEltAmt=20, format='string'): return vec, solution -eucldian_norm = Generator( - "Euclidian norm or L2 norm of a vector", 69, euclidianNormFunc, - ["maxEltAmt=20"]) +eucldian_norm = Generator("Euclidian norm or L2 norm of a vector", 69, + euclidianNormFunc, ["maxEltAmt=20"]) diff --git a/mathgenerator/funcs/misc/geometric_mean.py b/mathgenerator/funcs/misc/geometric_mean.py index 0f0b333..cb17de4 100644 --- a/mathgenerator/funcs/misc/geometric_mean.py +++ b/mathgenerator/funcs/misc/geometric_mean.py @@ -27,6 +27,5 @@ def geometricMeanFunc(maxValue=100, maxNum=4, format='string'): return problem, solution -geometric_mean = Generator( - "Geometric Mean of N Numbers", 67, geometricMeanFunc, - ["maxValue=100", "maxNum=4"]) +geometric_mean = Generator("Geometric Mean of N Numbers", 67, + geometricMeanFunc, ["maxValue=100", "maxNum=4"]) diff --git a/mathgenerator/funcs/misc/geometric_progression.py b/mathgenerator/funcs/misc/geometric_progression.py index e538d34..effffe1 100644 --- a/mathgenerator/funcs/misc/geometric_progression.py +++ b/mathgenerator/funcs/misc/geometric_progression.py @@ -20,7 +20,8 @@ def geomProgrFunc(number_values=6, if format == 'string': problem = "For the given GP " + str( GP) + " ,Find the value of a,common ratio," + str( - n_term) + "th term value, sum upto " + str(sum_term) + "th term" + n_term) + "th term value, sum upto " + str( + sum_term) + "th term" solution = "The value of a is {}, common ratio is {} , {}th term is {} , sum upto {}th term is {}".format( a, r, n_term, value_nth_term, sum_term, sum_till_nth_term) return problem, solution @@ -28,7 +29,6 @@ def geomProgrFunc(number_values=6, return GP, n_term, sum_term, a, r, n_term, value_nth_term, sum_term, sum_till_nth_term - -geometric_progression = Generator( - "Geometric Progression", 66, geomProgrFunc, - ["number_values=6", "min_value=2", "max_value=12", "n_term=7", "sum_term=5"]) +geometric_progression = Generator("Geometric Progression", 66, geomProgrFunc, [ + "number_values=6", "min_value=2", "max_value=12", "n_term=7", "sum_term=5" +]) diff --git a/mathgenerator/funcs/misc/harmonic_mean.py b/mathgenerator/funcs/misc/harmonic_mean.py index fd36ebe..44a8e5f 100644 --- a/mathgenerator/funcs/misc/harmonic_mean.py +++ b/mathgenerator/funcs/misc/harmonic_mean.py @@ -28,6 +28,5 @@ def harmonicMeanFunc(maxValue=100, maxNum=4, format='string'): return problem, solution -harmonic_mean = Generator("Harmonic Mean of N Numbers", 68, - harmonicMeanFunc, +harmonic_mean = Generator("Harmonic Mean of N Numbers", 68, harmonicMeanFunc, ["maxValue=100", "maxNum=4"]) diff --git a/mathgenerator/funcs/misc/hcf.py b/mathgenerator/funcs/misc/hcf.py index ee4ee01..996f05a 100644 --- a/mathgenerator/funcs/misc/hcf.py +++ b/mathgenerator/funcs/misc/hcf.py @@ -16,5 +16,4 @@ def hcfFunc(maxVal=20, format='string'): return a, b, x -hcf = Generator("HCF (Highest Common Factor)", 51, hcfFunc, - ["maxVal=20"]) +hcf = Generator("HCF (Highest Common Factor)", 51, hcfFunc, ["maxVal=20"]) diff --git a/mathgenerator/funcs/misc/is_leap_year.py b/mathgenerator/funcs/misc/is_leap_year.py index 75d9c36..3092a45 100644 --- a/mathgenerator/funcs/misc/is_leap_year.py +++ b/mathgenerator/funcs/misc/is_leap_year.py @@ -25,6 +25,5 @@ def IsLeapYear(minNumber=1900, maxNumber=2099, format='string'): return year, ans -is_leap_year = Generator("Leap Year or Not", 101, - IsLeapYear, +is_leap_year = Generator("Leap Year or Not", 101, IsLeapYear, ["minNumber=1900", "maxNumber=2099"]) diff --git a/mathgenerator/funcs/misc/lcm.py b/mathgenerator/funcs/misc/lcm.py index 1266f44..e47fdfd 100644 --- a/mathgenerator/funcs/misc/lcm.py +++ b/mathgenerator/funcs/misc/lcm.py @@ -19,6 +19,4 @@ def lcmFunc(maxVal=20, format='string'): return a, b, d -lcm = Generator("LCM (Least Common Multiple)", 9, - lcmFunc, - ["maxVal=20"]) +lcm = Generator("LCM (Least Common Multiple)", 9, lcmFunc, ["maxVal=20"]) diff --git a/mathgenerator/funcs/misc/minutes_to_hours.py b/mathgenerator/funcs/misc/minutes_to_hours.py index f0a02e1..6a7410b 100644 --- a/mathgenerator/funcs/misc/minutes_to_hours.py +++ b/mathgenerator/funcs/misc/minutes_to_hours.py @@ -15,5 +15,4 @@ def minutesToHoursFunc(maxMinutes=999, format='string'): minutes_to_hours = Generator("Minute to Hour conversion", 102, - minutesToHoursFunc, - ["maxMinutes=999"]) + minutesToHoursFunc, ["maxMinutes=999"]) diff --git a/mathgenerator/funcs/misc/prime_factors.py b/mathgenerator/funcs/misc/prime_factors.py index 971cdc5..3747305 100644 --- a/mathgenerator/funcs/misc/prime_factors.py +++ b/mathgenerator/funcs/misc/prime_factors.py @@ -25,5 +25,5 @@ def primeFactorsFunc(minVal=1, maxVal=200, format='string'): return a, factors -prime_factors = Generator("Prime Factorisation", 27,primeFactorsFunc, +prime_factors = Generator("Prime Factorisation", 27, primeFactorsFunc, ["minVal=1", "maxVal=200"]) diff --git a/mathgenerator/funcs/misc/profit_loss_percent.py b/mathgenerator/funcs/misc/profit_loss_percent.py index c586fd4..a9fc293 100644 --- a/mathgenerator/funcs/misc/profit_loss_percent.py +++ b/mathgenerator/funcs/misc/profit_loss_percent.py @@ -18,7 +18,6 @@ def profitLossPercentFunc(maxCP=1000, maxSP=1000, format='string'): return profitOrLoss, cP, sP, percent -profit_loss_percent = Generator( - "Profit or Loss Percent", 63, - profitLossPercentFunc, - ["maxCP=1000", "maxSP=1000"]) +profit_loss_percent = Generator("Profit or Loss Percent", 63, + profitLossPercentFunc, + ["maxCP=1000", "maxSP=1000"]) diff --git a/mathgenerator/funcs/statistics/combinations.py b/mathgenerator/funcs/statistics/combinations.py index faf1f3e..b4a4786 100644 --- a/mathgenerator/funcs/statistics/combinations.py +++ b/mathgenerator/funcs/statistics/combinations.py @@ -21,6 +21,5 @@ def combinationsFunc(maxlength=20, format='string'): return a, b, solution -combinations = Generator( - "Combinations of Objects", 30, combinationsFunc, - ["maxlength=20"]) +combinations = Generator("Combinations of Objects", 30, combinationsFunc, + ["maxlength=20"]) diff --git a/mathgenerator/funcs/statistics/conditional_probability.py b/mathgenerator/funcs/statistics/conditional_probability.py index 1dc9778..7d184ac 100644 --- a/mathgenerator/funcs/statistics/conditional_probability.py +++ b/mathgenerator/funcs/statistics/conditional_probability.py @@ -28,6 +28,5 @@ def conditionalProbFunc(format='string'): return P_disease, true_positive, true_negative, answer -conditional_probability = Generator("Conditional Probability", - 107, conditionalProbFunc, - [""]) +conditional_probability = Generator("Conditional Probability", 107, + conditionalProbFunc, [""]) diff --git a/mathgenerator/funcs/statistics/confidence_interval.py b/mathgenerator/funcs/statistics/confidence_interval.py index 3f5198d..4449ff3 100644 --- a/mathgenerator/funcs/statistics/confidence_interval.py +++ b/mathgenerator/funcs/statistics/confidence_interval.py @@ -39,5 +39,4 @@ def confidenceIntervalFunc(format='string'): confidence_interval = Generator("Confidence interval For sample S", 54, - confidenceIntervalFunc, - [""]) + confidenceIntervalFunc, [""]) diff --git a/mathgenerator/funcs/statistics/data_summary.py b/mathgenerator/funcs/statistics/data_summary.py index 2aaaa7c..d07546a 100644 --- a/mathgenerator/funcs/statistics/data_summary.py +++ b/mathgenerator/funcs/statistics/data_summary.py @@ -27,5 +27,6 @@ def dataSummaryFunc(number_values=15, minval=5, maxval=50, format='string'): return random_list, mean, standardDeviation, variance -data_summary = Generator("Mean,Standard Deviation,Variance", 59, dataSummaryFunc, +data_summary = Generator("Mean,Standard Deviation,Variance", 59, + dataSummaryFunc, ["number_values=15", "minval=5", "maxval=50"]) diff --git a/mathgenerator/funcs/statistics/dice_sum_probability.py b/mathgenerator/funcs/statistics/dice_sum_probability.py index 98382bb..cdfe309 100644 --- a/mathgenerator/funcs/statistics/dice_sum_probability.py +++ b/mathgenerator/funcs/statistics/dice_sum_probability.py @@ -30,5 +30,4 @@ def DiceSumProbFunc(maxDice=3, format='string'): dice_sum_probability = Generator( "Probability of a certain sum appearing on faces of dice", 52, - DiceSumProbFunc, - ["maxDice=3"]) + DiceSumProbFunc, ["maxDice=3"]) diff --git a/mathgenerator/funcs/statistics/mean_median.py b/mathgenerator/funcs/statistics/mean_median.py index 2b60716..187dc28 100644 --- a/mathgenerator/funcs/statistics/mean_median.py +++ b/mathgenerator/funcs/statistics/mean_median.py @@ -19,5 +19,4 @@ def meanMedianFunc(maxlen=10, format='string'): return randomlist, mean, median -mean_median = Generator("Mean and Median", 76, meanMedianFunc, - ["maxlen=10"]) +mean_median = Generator("Mean and Median", 76, meanMedianFunc, ["maxlen=10"]) diff --git a/mathgenerator/funcs/statistics/permutation.py b/mathgenerator/funcs/statistics/permutation.py index b097775..6c1891b 100644 --- a/mathgenerator/funcs/statistics/permutation.py +++ b/mathgenerator/funcs/statistics/permutation.py @@ -16,6 +16,4 @@ def permutationFunc(maxlength=20, format='string'): return a, b, answer -permutation = Generator( - "Permutations", 42, permutationFunc, - ["maxlength=20"]) +permutation = Generator("Permutations", 42, permutationFunc, ["maxlength=20"])