From d647e9710f014a527149777a4a8e924ce6524632 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:34:42 -0400 Subject: [PATCH] yapf fix --- mathgenerator/__init__.py | 3 ++- mathgenerator/funcs/angle_btw_vectors.py | 3 ++- .../funcs/arithmetic_progression_sum.py | 10 +++++---- .../funcs/arithmetic_progression_term.py | 10 +++++---- mathgenerator/funcs/base_conversion.py | 22 +++++++++++++------ mathgenerator/funcs/bcd_to_decimal.py | 3 ++- mathgenerator/funcs/binary_to_hex.py | 4 ++-- mathgenerator/funcs/celsius_to_fahrenheit.py | 6 +++-- mathgenerator/funcs/complex_to_polar.py | 4 ++-- mathgenerator/funcs/compound_interest.py | 4 +++- mathgenerator/funcs/cube_root.py | 5 +++-- .../funcs/curved_surface_area_cylinder.py | 8 ++++--- mathgenerator/funcs/data_summary.py | 2 +- mathgenerator/funcs/decimal_to_octal.py | 3 ++- .../funcs/decimal_to_roman_numerals.py | 18 +++++++++++---- mathgenerator/funcs/definite_integral.py | 9 ++++---- mathgenerator/funcs/degree_to_rad.py | 4 ++-- mathgenerator/funcs/differentiation.py | 5 +++-- mathgenerator/funcs/distance_two_points.py | 7 +++--- mathgenerator/funcs/euclidian_norm.py | 11 ++++++---- mathgenerator/funcs/geometric_mean.py | 7 +++--- mathgenerator/funcs/invert_matrix.py | 5 +++-- mathgenerator/funcs/is_prime.py | 4 ++-- mathgenerator/funcs/midpoint_of_two_points.py | 3 ++- mathgenerator/funcs/nth_fibonacci_number.py | 3 ++- .../funcs/power_rule_differentiation.py | 4 ++-- mathgenerator/funcs/radian_to_deg.py | 4 ++-- mathgenerator/funcs/sector_area.py | 4 ++-- mathgenerator/funcs/set_operation.py | 11 ++++++---- mathgenerator/mathgen.py | 1 - setup.py | 6 +---- 31 files changed, 117 insertions(+), 76 deletions(-) diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 090e18a..45ca62f 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -11,7 +11,8 @@ class Generator: self.generalSol = generalSol self.func = func - (filename, line_number, function_name, text) = traceback.extract_stack()[-2] + (filename, line_number, function_name, + text) = traceback.extract_stack()[-2] funcname = filename[filename.rfind('/'):].strip() funcname = funcname[1:-3] # print(funcname) diff --git a/mathgenerator/funcs/angle_btw_vectors.py b/mathgenerator/funcs/angle_btw_vectors.py index f3b8a65..1553435 100644 --- a/mathgenerator/funcs/angle_btw_vectors.py +++ b/mathgenerator/funcs/angle_btw_vectors.py @@ -10,7 +10,8 @@ def angleBtwVectorsFunc(maxEltAmt=20): for j in v2: s += i * j - mags = math.sqrt(sum([i**2 for i in v1])) * math.sqrt(sum([i**2 for i in v2])) + mags = math.sqrt(sum([i**2 + for i in v1])) * math.sqrt(sum([i**2 for i in v2])) problem = f"angle between the vectors {v1} and {v2} is:" solution = '' try: diff --git a/mathgenerator/funcs/arithmetic_progression_sum.py b/mathgenerator/funcs/arithmetic_progression_sum.py index e376c3f..d698354 100644 --- a/mathgenerator/funcs/arithmetic_progression_sum.py +++ b/mathgenerator/funcs/arithmetic_progression_sum.py @@ -8,11 +8,13 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100): a3 = a2 + d n = random.randint(4, maxn) apString = str(a1) + ', ' + str(a2) + ', ' + str(a3) + ' ... ' - problem = 'Find the sum of first ' + str(n) + ' terms of the AP series: ' + apString + problem = 'Find the sum of first ' + str( + n) + ' terms of the AP series: ' + apString solution = n * ((2 * a1) + ((n - 1) * d)) / 2 return problem, solution -arithmetic_progression_sum = Generator("AP Sum Calculation", 83, - "Find the sum of first n terms of the AP series: a1, a2, a3 ...", - "Sum", arithmeticProgressionSumFunc) +arithmetic_progression_sum = Generator( + "AP Sum Calculation", 83, + "Find the sum of first n terms of the AP series: a1, a2, a3 ...", "Sum", + arithmeticProgressionSumFunc) diff --git a/mathgenerator/funcs/arithmetic_progression_term.py b/mathgenerator/funcs/arithmetic_progression_term.py index 8468921..cdf1f9b 100644 --- a/mathgenerator/funcs/arithmetic_progression_term.py +++ b/mathgenerator/funcs/arithmetic_progression_term.py @@ -8,11 +8,13 @@ def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100): a3 = a2 + d n = random.randint(4, maxn) apString = str(a1) + ', ' + str(a2) + ', ' + str(a3) + ' ... ' - problem = 'Find the term number ' + str(n) + ' of the AP series: ' + apString + problem = 'Find the term number ' + str( + n) + ' of the AP series: ' + apString solution = a1 + ((n - 1) * d) return problem, solution -arithmetic_progression_term = Generator("AP Term Calculation", 82, - "Find the term number n of the AP series: a1, a2, a3 ...", - "a-n", arithmeticProgressionTermFunc) +arithmetic_progression_term = Generator( + "AP Term Calculation", 82, + "Find the term number n of the AP series: a1, a2, a3 ...", "a-n", + arithmeticProgressionTermFunc) diff --git a/mathgenerator/funcs/base_conversion.py b/mathgenerator/funcs/base_conversion.py index c9ef48f..02746ff 100644 --- a/mathgenerator/funcs/base_conversion.py +++ b/mathgenerator/funcs/base_conversion.py @@ -5,7 +5,9 @@ alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" def fromBaseTenTo(n, toBase): - assert type(toBase) == int and toBase >= 2 and toBase <= 36, "toBase({}) must be >=2 and <=36" + assert type( + toBase + ) == int and toBase >= 2 and toBase <= 36, "toBase({}) must be >=2 and <=36" # trivial cases if toBase == 2: return bin(n)[2:] @@ -16,12 +18,13 @@ def fromBaseTenTo(n, toBase): elif toBase == 16: return hex(n)[2:].upper() res = alpha[n % toBase] - n = n//toBase + n = n // toBase while n > 0: res = alpha[n % toBase] + res - n = n//toBase + n = n // toBase return res + # Useful to check answers, but not needed here # def toBaseTen(n,fromBase): # return int(n,fromBase) @@ -29,12 +32,16 @@ def fromBaseTenTo(n, toBase): def baseConversionFunc(maxNum=60000, maxBase=16): assert type( - maxNum) == int and maxNum >= 100 and maxNum <= 65536, "maxNum({}) must be >=100 and <=65536".format(maxNum) + maxNum + ) == int and maxNum >= 100 and maxNum <= 65536, "maxNum({}) must be >=100 and <=65536".format( + maxNum) assert type( - maxBase) == int and maxBase >= 2 and maxBase <= 36, "maxBase({}) must be >= 2 and <=36".format(maxBase) + maxBase + ) == int and maxBase >= 2 and maxBase <= 36, "maxBase({}) must be >= 2 and <=36".format( + maxBase) n = random.randint(40, maxNum) - dist = [10]*10+[2]*5+[16]*5+[i for i in range(2, maxBase+1)] + dist = [10] * 10 + [2] * 5 + [16] * 5 + [i for i in range(2, maxBase + 1)] # set this way since converting to/from bases 2,10,16 are more common -- can be changed if needed. bases = random.choices(dist, k=2) while bases[0] == bases[1]: @@ -46,5 +53,6 @@ def baseConversionFunc(maxNum=60000, maxBase=16): return problem, ans -base_conversion = Generator("Base Conversion", 94, "Convert 152346 from base 8 to base 10.", "54502", +base_conversion = Generator("Base Conversion", 94, + "Convert 152346 from base 8 to base 10.", "54502", baseConversionFunc) diff --git a/mathgenerator/funcs/bcd_to_decimal.py b/mathgenerator/funcs/bcd_to_decimal.py index fc356d0..ec48176 100644 --- a/mathgenerator/funcs/bcd_to_decimal.py +++ b/mathgenerator/funcs/bcd_to_decimal.py @@ -21,4 +21,5 @@ def BCDtoDecimalFunc(maxNumber=10000): bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, - "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) + "Integer of Binary Coded Decimal b is ", "n", + BCDtoDecimalFunc) diff --git a/mathgenerator/funcs/binary_to_hex.py b/mathgenerator/funcs/binary_to_hex.py index 77b03b1..bb3d993 100644 --- a/mathgenerator/funcs/binary_to_hex.py +++ b/mathgenerator/funcs/binary_to_hex.py @@ -11,5 +11,5 @@ def binaryToHexFunc(max_dig=10): return problem, solution -binary_to_hex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", "b", - binaryToHexFunc) +binary_to_hex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", + "b", binaryToHexFunc) diff --git a/mathgenerator/funcs/celsius_to_fahrenheit.py b/mathgenerator/funcs/celsius_to_fahrenheit.py index 45122d0..f314883 100644 --- a/mathgenerator/funcs/celsius_to_fahrenheit.py +++ b/mathgenerator/funcs/celsius_to_fahrenheit.py @@ -4,10 +4,12 @@ from .__init__ import * def celsiustofahrenheitFunc(maxTemp=100): celsius = random.randint(-50, maxTemp) fahrenheit = (celsius * (9 / 5)) + 32 - problem = "Convert " + str(celsius) + " degrees Celsius to degrees Fahrenheit =" + problem = "Convert " + str( + celsius) + " degrees Celsius to degrees Fahrenheit =" solution = str(fahrenheit) return problem, solution celsius_to_fahrenheit = Generator("Celsius To Fahrenheit", 81, - "(C +(9/5))+32=", "F", celsiustofahrenheitFunc) + "(C +(9/5))+32=", "F", + celsiustofahrenheitFunc) diff --git a/mathgenerator/funcs/complex_to_polar.py b/mathgenerator/funcs/complex_to_polar.py index ecab5ec..90fb72d 100644 --- a/mathgenerator/funcs/complex_to_polar.py +++ b/mathgenerator/funcs/complex_to_polar.py @@ -14,5 +14,5 @@ def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20): return problem, solution -complex_to_polar = Generator("Complex To Polar Form", 92, - "rexp(itheta) = ", "plr", complexToPolarFunc) +complex_to_polar = Generator("Complex To Polar Form", 92, "rexp(itheta) = ", + "plr", complexToPolarFunc) diff --git a/mathgenerator/funcs/compound_interest.py b/mathgenerator/funcs/compound_interest.py index 8f7d48d..0ff034c 100644 --- a/mathgenerator/funcs/compound_interest.py +++ b/mathgenerator/funcs/compound_interest.py @@ -14,4 +14,6 @@ def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10): compound_interest = Generator( - "Compound Interest", 78, "Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ", "d dollars", compoundInterestFunc) + "Compound Interest", 78, + "Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ", + "d dollars", compoundInterestFunc) diff --git a/mathgenerator/funcs/cube_root.py b/mathgenerator/funcs/cube_root.py index 041d492..06a6a8d 100644 --- a/mathgenerator/funcs/cube_root.py +++ b/mathgenerator/funcs/cube_root.py @@ -10,5 +10,6 @@ def cubeRootFunc(minNo=1, maxNo=1000): return problem, solution -cube_root = Generator("Cube Root", 47, "Cuberoot of a upto 2 decimal places is", - "b", cubeRootFunc) +cube_root = Generator("Cube Root", 47, + "Cuberoot of a upto 2 decimal places is", "b", + cubeRootFunc) diff --git a/mathgenerator/funcs/curved_surface_area_cylinder.py b/mathgenerator/funcs/curved_surface_area_cylinder.py index 58f9d83..0a02325 100644 --- a/mathgenerator/funcs/curved_surface_area_cylinder.py +++ b/mathgenerator/funcs/curved_surface_area_cylinder.py @@ -5,11 +5,13 @@ def curvedSurfaceAreaCylinderFunc(maxRadius=49, maxHeight=99): r = random.randint(1, maxRadius) h = random.randint(1, maxHeight) problem = f"What is the curved surface area of a cylinder of radius, {r} and height, {h}?" - csa = float(2*math.pi*r*h) + csa = float(2 * math.pi * r * h) formatted_float = round(csa, 2) # "{:.5f}".format(csa) solution = f"CSA of cylinder = {formatted_float}" return problem, solution -curved_surface_area_cylinder = Generator("Curved surface area of a cylinder", 95, - "What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder", curvedSurfaceAreaCylinderFunc) +curved_surface_area_cylinder = Generator( + "Curved surface area of a cylinder", 95, + "What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder", + curvedSurfaceAreaCylinderFunc) diff --git a/mathgenerator/funcs/data_summary.py b/mathgenerator/funcs/data_summary.py index a84a91c..f74bf8e 100644 --- a/mathgenerator/funcs/data_summary.py +++ b/mathgenerator/funcs/data_summary.py @@ -16,7 +16,7 @@ def dataSummaryFunc(number_values=15, minval=5, maxval=50): var += (random_list[i] - mean)**2 standardDeviation = var / number_values - variance = (var / number_values) ** 0.5 + variance = (var / number_values)**0.5 problem = "Find the mean,standard deviation and variance for the data" + \ str(random_list) diff --git a/mathgenerator/funcs/decimal_to_octal.py b/mathgenerator/funcs/decimal_to_octal.py index 5a89b99..e6a2ca9 100644 --- a/mathgenerator/funcs/decimal_to_octal.py +++ b/mathgenerator/funcs/decimal_to_octal.py @@ -9,4 +9,5 @@ def decimalToOctalFunc(maxDecimal=4096): decimal_to_octal = Generator("Converts decimal to octal", 84, - "What's the octal representation of 98?", "0o142", decimalToOctalFunc) + "What's the octal representation of 98?", "0o142", + decimalToOctalFunc) diff --git a/mathgenerator/funcs/decimal_to_roman_numerals.py b/mathgenerator/funcs/decimal_to_roman_numerals.py index 63b64f2..ee66ff6 100644 --- a/mathgenerator/funcs/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/decimal_to_roman_numerals.py @@ -4,7 +4,15 @@ from .__init__ import * def decimalToRomanNumeralsFunc(maxDecimal=4000): x = random.randint(0, maxDecimal) problem = "The number " + str(x) + " in Roman Numerals is: " - roman_dict = {1: "I", 5: "V", 10: "X", 50: "L", 100: "C", 500: "D", 1000: "M"} + roman_dict = { + 1: "I", + 5: "V", + 10: "X", + 50: "L", + 100: "C", + 500: "D", + 1000: "M" + } divisor = 1 while x >= divisor: divisor *= 10 @@ -17,7 +25,8 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): 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) @@ -25,5 +34,6 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): return problem, solution -decimal_to_roman_numerals = Generator("Converts decimal to Roman Numerals", - 85, "Convert 20 into Roman Numerals", "XX", decimalToRomanNumeralsFunc) +decimal_to_roman_numerals = Generator("Converts decimal to Roman Numerals", 85, + "Convert 20 into Roman Numerals", "XX", + decimalToRomanNumeralsFunc) diff --git a/mathgenerator/funcs/definite_integral.py b/mathgenerator/funcs/definite_integral.py index 6e8453f..7a46027 100644 --- a/mathgenerator/funcs/definite_integral.py +++ b/mathgenerator/funcs/definite_integral.py @@ -4,9 +4,8 @@ from scipy.integrate import quad def definiteIntegralFunc(max_coeff=100): - def integrand(x, a, b, c): - return a * x ** 2 + b * x + c + return a * x**2 + b * x + c a = random.randint(0, max_coeff) b = random.randint(0, max_coeff) @@ -23,5 +22,7 @@ def definiteIntegralFunc(max_coeff=100): return problem, solution -definite_integral = Generator("Definite Integral of Quadratic Equation", 89, - "The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", "S", definiteIntegralFunc) +definite_integral = Generator( + "Definite Integral of Quadratic Equation", 89, + "The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", + "S", definiteIntegralFunc) diff --git a/mathgenerator/funcs/degree_to_rad.py b/mathgenerator/funcs/degree_to_rad.py index dc63f10..a17d72f 100644 --- a/mathgenerator/funcs/degree_to_rad.py +++ b/mathgenerator/funcs/degree_to_rad.py @@ -13,5 +13,5 @@ def degreeToRadFunc(max_deg=360): return problem, solution -degree_to_rad = Generator("Degrees to Radians", 86, - "Angle a in radians is = ", "b", degreeToRadFunc) +degree_to_rad = Generator("Degrees to Radians", 86, "Angle a in radians is = ", + "b", degreeToRadFunc) diff --git a/mathgenerator/funcs/differentiation.py b/mathgenerator/funcs/differentiation.py index 2b40dea..1c0205d 100644 --- a/mathgenerator/funcs/differentiation.py +++ b/mathgenerator/funcs/differentiation.py @@ -49,5 +49,6 @@ def differentiationFunc(diff_lvl=2): return problem, solution -differentiation = Generator( - "Differentiation", 88, "differentiate w.r.t x : d(f(x))/dx", "g(x)", differentiationFunc) +differentiation = Generator("Differentiation", 88, + "differentiate w.r.t x : d(f(x))/dx", "g(x)", + differentiationFunc) diff --git a/mathgenerator/funcs/distance_two_points.py b/mathgenerator/funcs/distance_two_points.py index 6dc6b7d..7277702 100644 --- a/mathgenerator/funcs/distance_two_points.py +++ b/mathgenerator/funcs/distance_two_points.py @@ -14,6 +14,7 @@ def distanceTwoPointsFunc(maxValXY=20, minValXY=-20): return problem, solution -distance_two_points = Generator("Distance between 2 points", 24, - "Find the distance between (x1,y1) and (x2,y2)", - "sqrt(distanceSquared)", distanceTwoPointsFunc) +distance_two_points = Generator( + "Distance between 2 points", 24, + "Find the distance between (x1,y1) and (x2,y2)", "sqrt(distanceSquared)", + distanceTwoPointsFunc) diff --git a/mathgenerator/funcs/euclidian_norm.py b/mathgenerator/funcs/euclidian_norm.py index cfd178c..017fa74 100644 --- a/mathgenerator/funcs/euclidian_norm.py +++ b/mathgenerator/funcs/euclidian_norm.py @@ -2,12 +2,15 @@ from .__init__ import * def euclidianNormFunc(maxEltAmt=20): - vec = [random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt))] + vec = [ + random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt)) + ] problem = f"Euclidian norm or L2 norm of the vector{vec} is:" solution = math.sqrt(sum([i**2 for i in vec])) return problem, solution -eucldian_norm = Generator("Euclidian norm or L2 norm of a vector", 69, - "Euclidian Norm of a vector V:[v1, v2, ......., vn]", - "sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc) +eucldian_norm = Generator( + "Euclidian norm or L2 norm of a vector", 69, + "Euclidian Norm of a vector V:[v1, v2, ......., vn]", + "sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc) diff --git a/mathgenerator/funcs/geometric_mean.py b/mathgenerator/funcs/geometric_mean.py index 034ddf2..606269e 100644 --- a/mathgenerator/funcs/geometric_mean.py +++ b/mathgenerator/funcs/geometric_mean.py @@ -27,6 +27,7 @@ def geometricMeanFunc(maxValue=100, maxNum=4): return problem, solution -geometric_mean = Generator("Geometric Mean of N Numbers", 67, - "Geometric mean of n numbers A1 , A2 , ... , An = ", - "(A1*A2*...An)^(1/n) = ans", geometricMeanFunc) +geometric_mean = Generator( + "Geometric Mean of N Numbers", 67, + "Geometric mean of n numbers A1 , A2 , ... , An = ", + "(A1*A2*...An)^(1/n) = ans", geometricMeanFunc) diff --git a/mathgenerator/funcs/invert_matrix.py b/mathgenerator/funcs/invert_matrix.py index 7a196c5..f089c3c 100644 --- a/mathgenerator/funcs/invert_matrix.py +++ b/mathgenerator/funcs/invert_matrix.py @@ -78,5 +78,6 @@ def matrixInversion(SquareMatrixDimension=3, return problem, solution -invert_matrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", - "A^(-1)", matrixInversion) +invert_matrix = Generator("Inverse of a Matrix", 74, + "Inverse of a matrix A is", "A^(-1)", + matrixInversion) diff --git a/mathgenerator/funcs/is_prime.py b/mathgenerator/funcs/is_prime.py index 143f4d3..ac3ede5 100644 --- a/mathgenerator/funcs/is_prime.py +++ b/mathgenerator/funcs/is_prime.py @@ -18,5 +18,5 @@ def isprime(max_a=100): return (problem, solution) -is_prime = Generator('isprime', 90, 'a any positive integer', - 'True/False', isprime) +is_prime = Generator('isprime', 90, 'a any positive integer', 'True/False', + isprime) diff --git a/mathgenerator/funcs/midpoint_of_two_points.py b/mathgenerator/funcs/midpoint_of_two_points.py index 2b021aa..9e458a4 100644 --- a/mathgenerator/funcs/midpoint_of_two_points.py +++ b/mathgenerator/funcs/midpoint_of_two_points.py @@ -13,5 +13,6 @@ def MidPointOfTwoPointFunc(maxValue=20): midPoint_of_two_points = Generator("Midpoint of the two point", 20, - "((X1,Y1),(X2,Y2))=", "((X1+X2)/2,(Y1+Y2)/2)", + "((X1,Y1),(X2,Y2))=", + "((X1+X2)/2,(Y1+Y2)/2)", MidPointOfTwoPointFunc) diff --git a/mathgenerator/funcs/nth_fibonacci_number.py b/mathgenerator/funcs/nth_fibonacci_number.py index cfb7e8a..3d28655 100644 --- a/mathgenerator/funcs/nth_fibonacci_number.py +++ b/mathgenerator/funcs/nth_fibonacci_number.py @@ -5,7 +5,8 @@ def nthFibonacciNumberFunc(maxN=100): 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))) solution = f"{ans}" return problem, solution diff --git a/mathgenerator/funcs/power_rule_differentiation.py b/mathgenerator/funcs/power_rule_differentiation.py index cdc8c76..25a85c2 100644 --- a/mathgenerator/funcs/power_rule_differentiation.py +++ b/mathgenerator/funcs/power_rule_differentiation.py @@ -18,6 +18,6 @@ def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5): return problem, solution -power_rule_differentiation = Generator("Power Rule Differentiation", 7, "nx^m=", - "(n*m)x^(m-1)", +power_rule_differentiation = Generator("Power Rule Differentiation", 7, + "nx^m=", "(n*m)x^(m-1)", powerRuleDifferentiationFunc) diff --git a/mathgenerator/funcs/radian_to_deg.py b/mathgenerator/funcs/radian_to_deg.py index e48acc0..0281b82 100644 --- a/mathgenerator/funcs/radian_to_deg.py +++ b/mathgenerator/funcs/radian_to_deg.py @@ -14,5 +14,5 @@ def radianToDegFunc(max_rad=3): return problem, solution -radian_to_deg = Generator("Radians to Degrees", 87, - "Angle a in degrees is = ", "b", radianToDegFunc) +radian_to_deg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ", + "b", radianToDegFunc) diff --git a/mathgenerator/funcs/sector_area.py b/mathgenerator/funcs/sector_area.py index 9a14728..12692fb 100644 --- a/mathgenerator/funcs/sector_area.py +++ b/mathgenerator/funcs/sector_area.py @@ -12,5 +12,5 @@ def sectorAreaFunc(maxRadius=49, maxAngle=359): sector_area = Generator("Area of a Sector", 75, - "Area of a sector with radius, r and angle, a ", "Area", - sectorAreaFunc) + "Area of a sector with radius, r and angle, a ", + "Area", sectorAreaFunc) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index f328368..263b548 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -14,11 +14,14 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5): b = set(b) problem = "Given the two sets a=" + \ str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" - solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str( - a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) + solution = "Union is " + str(a.union(b)) + ",Intersection is " + str( + a.intersection(b)) + ", a-b is " + str( + a.difference(b)) + ",b-a is " + str( + b.difference(a)) + ", Symmetric difference is " + str( + a.symmetric_difference(b)) return problem, solution set_operation = Generator("Union,Intersection,Difference of Two Sets", 93, - "Union,intersection,difference", - "aUb,a^b,a-b,b-a,", set_operation) + "Union,intersection,difference", "aUb,a^b,a-b,b-a,", + set_operation) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 2a969fa..1a09015 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -1,7 +1,6 @@ from .funcs import * from .__init__ import getGenList - genList = getGenList() diff --git a/setup.py b/setup.py index 7b022b4..23e337e 100644 --- a/setup.py +++ b/setup.py @@ -8,9 +8,5 @@ setup(name='mathgenerator', author_email='lukew25073@gmail.com', license='MIT', packages=find_packages(), - install_requires=[ - 'sympy', - 'numpy', - 'scipy' - ], + install_requires=['sympy', 'numpy', 'scipy'], entry_points={})