From 966419d04c92195d13d567b146990a3c1f5bba8d Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 2 Jun 2023 10:31:59 -0400 Subject: [PATCH] yapf lint --- mathgenerator/_gen_list.py | 2 +- mathgenerator/algebra.py | 58 +++++++++++++++---------------- mathgenerator/basic_math.py | 16 ++++----- mathgenerator/calculus.py | 8 ++--- mathgenerator/computer_science.py | 35 +++++++++++-------- mathgenerator/geometry.py | 22 +++++------- mathgenerator/misc.py | 49 +++++++++++++------------- mathgenerator/statistics.py | 6 ++-- scripts/addFuture.py | 6 ++-- scripts/adoptGenerator.py | 8 +++-- scripts/makeReadme.py | 2 +- scripts/nextId.py | 2 +- scripts/unmodule.py | 2 +- 13 files changed, 108 insertions(+), 108 deletions(-) diff --git a/mathgenerator/_gen_list.py b/mathgenerator/_gen_list.py index 2ccef8e..99af06b 100644 --- a/mathgenerator/_gen_list.py +++ b/mathgenerator/_gen_list.py @@ -131,5 +131,5 @@ gen_list = [ ("area_of_trapezoid", "geometry"), ("tribonacci_series", "computer_science"), ("nth_tribonacci_number", "computer_science"), - ("velocity_of_object","misc"), + ("velocity_of_object", "misc"), ] diff --git a/mathgenerator/algebra.py b/mathgenerator/algebra.py index 54e9cb1..c6f299a 100644 --- a/mathgenerator/algebra.py +++ b/mathgenerator/algebra.py @@ -45,10 +45,12 @@ def combine_like_terms(max_coef=10, max_exp=20, max_terms=10): numTerms = random.randint(1, max_terms) coefs = [random.randint(1, max_coef) for _ in range(numTerms)] - exponents = [random.randint(1, max(max_exp - 1, 2)) - for _ in range(numTerms)] + exponents = [ + random.randint(1, max(max_exp - 1, 2)) for _ in range(numTerms) + ] - problem = " + ".join([f"{coefs[i]}x^{{{exponents[i]}}}" for i in range(numTerms)]) + problem = " + ".join( + [f"{coefs[i]}x^{{{exponents[i]}}}" for i in range(numTerms)]) d = {} for i in range(numTerms): if exponents[i] in d: @@ -133,9 +135,7 @@ def complex_quadratic(prob_type=0, max_range=10): return problem, solution -def compound_interest(max_principle=10000, - max_rate=10, - max_time=10): +def compound_interest(max_principle=10000, max_rate=10, max_time=10): r"""Compound Interest | Ex. Problem | Ex. Solution | @@ -165,17 +165,14 @@ def distance_two_points(max_val_xy=20, min_val_xy=-20): point2X = random.randint(min_val_xy, max_val_xy + 1) point2Y = random.randint(min_val_xy, max_val_xy + 1) - distanceSq = (point1X - point2X) ** 2 + (point1Y - point2Y) ** 2 + distanceSq = (point1X - point2X)**2 + (point1Y - point2Y)**2 solution = rf"$\sqrt{{{distanceSq}}}$" problem = f"Find the distance between $({point1X}, {point1Y})$ and $({point2X}, {point2Y})$" return problem, solution -def expanding(range_x1=10, - range_x2=10, - range_a=10, - range_b=10): +def expanding(range_x1=10, range_x2=10, range_a=10, range_b=10): r"""Expanding Factored Binomial | Ex. Problem | Ex. Solution | @@ -340,10 +337,10 @@ def intersection_of_two_lines(min_m=-10, x = rf"\frac{{{x.numerator}}}{{{x.denominator}}}" return x - m1 = (random.randint(min_m, - max_m), random.randint(min_denominator, max_denominator)) - m2 = (random.randint(min_m, - max_m), random.randint(min_denominator, max_denominator)) + m1 = (random.randint(min_m, max_m), + random.randint(min_denominator, max_denominator)) + m2 = (random.randint(min_m, max_m), + random.randint(min_denominator, max_denominator)) b1 = random.randint(min_b, max_b) b2 = random.randint(min_b, max_b) @@ -409,7 +406,8 @@ def invert_matrix(square_matrix_dimension=3, for i in range(1, square_matrix_dimension - 1): Mat[i] = [ - sum(i) for i in zip(Mat[square_matrix_dimension - 1], Mat[i]) + sum(i) + for i in zip(Mat[square_matrix_dimension - 1], Mat[i]) ] isItOk = True @@ -437,7 +435,8 @@ def invert_matrix(square_matrix_dimension=3, square_matrix_dimension * square_matrix_dimension) randomlist = list(set(randomlist) - set(plist)) n_list = random.sample( - randomlist, square_matrix_dimension * (square_matrix_dimension - 1)) + randomlist, + square_matrix_dimension * (square_matrix_dimension - 1)) Mat = list() for i in range(0, square_matrix_dimension): z = list() @@ -504,7 +503,9 @@ def line_equation_from_2_points(max_val=20): y2 = random.randint(-max_val, max_val) m1 = (y2 - y1) // math.gcd(y2 - y1, x2 - x1) m2 = (x2 - x1) // math.gcd(y2 - y1, x2 - x1) - c1 = (y1 * (x2 - x1) - (y2 - y1) * x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1, (x2 - x1)) + c1 = (y1 * (x2 - x1) - + (y2 - y1) * x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1, + (x2 - x1)) c2 = (x2 - x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1, (x2 - x1)) c = rf"{'+' if c1 >= 0 else '-'}\frac{{{abs(c1)}}}{{{c2}}}" if c1 != 0 else "" if c2 < 0: @@ -605,10 +606,12 @@ def multiply_complex_numbers(min_real_imaginary_num=-20, | --- | --- | | $(14+18j) * (14+15j) = $ | $(-74+462j)$ | """ - num1 = complex(random.randint(min_real_imaginary_num, max_real_imaginary_num), - random.randint(min_real_imaginary_num, max_real_imaginary_num)) - num2 = complex(random.randint(min_real_imaginary_num, max_real_imaginary_num), - random.randint(min_real_imaginary_num, max_real_imaginary_num)) + num1 = complex( + random.randint(min_real_imaginary_num, max_real_imaginary_num), + random.randint(min_real_imaginary_num, max_real_imaginary_num)) + num2 = complex( + random.randint(min_real_imaginary_num, max_real_imaginary_num), + random.randint(min_real_imaginary_num, max_real_imaginary_num)) product = num1 * num2 problem = f"${num1} * {num2} = $" @@ -652,7 +655,8 @@ def quadratic_equation(max_val=100): a = random.randint(1, max_val) c = random.randint(1, max_val) b = random.randint( - round(math.sqrt(4 * a * c)) + 1, round(math.sqrt(4 * max_val * max_val))) + round(math.sqrt(4 * a * c)) + 1, + round(math.sqrt(4 * max_val * max_val))) D = math.sqrt(b * b - 4 * a * c) res = {round((-b + D) / (2 * a), 2), round((-b - D) / (2 * a), 2)} @@ -661,9 +665,7 @@ def quadratic_equation(max_val=100): return problem, solution -def simple_interest(max_principle=10000, - max_rate=10, - max_time=10): +def simple_interest(max_principle=10000, max_rate=10, max_time=10): r"""Simple Interest | Ex. Problem | Ex. Solution | @@ -680,9 +682,7 @@ def simple_interest(max_principle=10000, return problem, solution -def system_of_equations(range_x=10, - range_y=10, - coeff_mult_range=10): +def system_of_equations(range_x=10, range_y=10, coeff_mult_range=10): r"""Solve a System of Equations in R^2 | Ex. Problem | Ex. Solution | diff --git a/mathgenerator/basic_math.py b/mathgenerator/basic_math.py index b6f9622..1ddc212 100644 --- a/mathgenerator/basic_math.py +++ b/mathgenerator/basic_math.py @@ -75,7 +75,9 @@ def cube_root(min_no=1, max_no=1000): b = random.randint(min_no, max_no) a = b**(1 / 3) - return (rf"What is the cube root of: $\sqrt[3]{{{b}}}=$ to 2 decimal places?", f"${round(a, 2)}$") + return ( + rf"What is the cube root of: $\sqrt[3]{{{b}}}=$ to 2 decimal places?", + f"${round(a, 2)}$") def divide_fractions(max_val=10): @@ -215,7 +217,6 @@ def greatest_common_divisor(numbers_count=2, max_num=10**3): | --- | --- | | $GCD(488075608, 75348096)=$ | $8$ | """ - def greatestCommonDivisorOfTwoNumbers(number1, number2): number1 = abs(number1) number2 = abs(number2) @@ -224,8 +225,7 @@ def greatest_common_divisor(numbers_count=2, max_num=10**3): return number1 numbers_count = max(numbers_count, 2) - numbers = [random.randint(0, max_num) - for _ in range(numbers_count)] + numbers = [random.randint(0, max_num) for _ in range(numbers_count)] greatestCommonDivisor = greatestCommonDivisorOfTwoNumbers( numbers[0], numbers[1]) @@ -373,7 +373,7 @@ def square(max_square_num=20): | $17^2=$ | $289$ | """ a = random.randint(1, max_square_num) - b = a ** 2 + b = a**2 return f'${a}^2=$', f'${b}$' @@ -386,7 +386,7 @@ def square_root(min_no=1, max_no=12): | $\sqrt{64}=$ | $8$ | """ b = random.randint(min_no, max_no) - a = b ** 2 + a = b**2 return rf'$\sqrt{{{a}}}=$', f'${b}$' @@ -412,9 +412,9 @@ def simplify_square_root(max_variable=100): a = b = 1 for i in factors.keys(): if factors[i] & 1 == 0: - a *= i ** (factors[i] // 2) + a *= i**(factors[i] // 2) else: - a *= i ** ((factors[i] - 1) // 2) + a *= i**((factors[i] - 1) // 2) b *= i if a == 1 or b == 1: return simplify_square_root(max_variable) diff --git a/mathgenerator/calculus.py b/mathgenerator/calculus.py index 796ff1f..42196c3 100644 --- a/mathgenerator/calculus.py +++ b/mathgenerator/calculus.py @@ -24,9 +24,7 @@ def definite_integral(max_coef=100): return problem, f'${solution}$' -def power_rule_differentiation(max_coef=10, - max_exp=10, - max_terms=5): +def power_rule_differentiation(max_coef=10, max_exp=10, max_terms=5): r"""Power Rule Differentiation | Ex. Problem | Ex. Solution | @@ -50,9 +48,7 @@ def power_rule_differentiation(max_coef=10, return problem + '$', solution + '$' -def power_rule_integration(max_coef=10, - max_exp=10, - max_terms=5): +def power_rule_integration(max_coef=10, max_exp=10, max_terms=5): r"""Power Rule Integration | Ex. Problem | Ex. Solution | diff --git a/mathgenerator/computer_science.py b/mathgenerator/computer_science.py index 9c3b23c..b772511 100644 --- a/mathgenerator/computer_science.py +++ b/mathgenerator/computer_science.py @@ -67,8 +67,9 @@ def binary_complement_1s(maxDigits=10): | --- | --- | | $1111001 = $ | $0000110$ | """ - question = ''.join([str(random.randint(0, 1)) - for _ in range(random.randint(1, maxDigits))]) + question = ''.join([ + str(random.randint(0, 1)) for _ in range(random.randint(1, maxDigits)) + ]) answer = ''.join(["0" if digit == "1" else "1" for digit in question]) problem = f'${question} = $' @@ -82,8 +83,8 @@ def binary_to_decimal(max_dig=10): | --- | --- | | $000110$ | $6$ | """ - problem = ''.join([str(random.randint(0, 1)) - for _ in range(random.randint(1, max_dig))]) + problem = ''.join( + [str(random.randint(0, 1)) for _ in range(random.randint(1, max_dig))]) solution = f'${int(problem, 2)}$' return f'${problem}$', solution @@ -95,8 +96,8 @@ def binary_to_hex(max_dig=10): | --- | --- | | $010101$ | $0x15$ | """ - problem = ''.join([str(random.randint(0, 1)) - for _ in range(random.randint(1, max_dig))]) + problem = ''.join( + [str(random.randint(0, 1)) for _ in range(random.randint(1, max_dig))]) solution = f'${hex(int(problem, 2))}$' return f'${problem}$', solution @@ -232,16 +233,17 @@ def nth_tribonacci_number(min_length=1, max_length=80): | --- | --- | | What is the 14th Tribonacci number? | $504$ | """ - - tribDict = {0:0, 1:0, 2:1} + + tribDict = {0: 0, 1: 0, 2: 1} + def recTrib(i): if i not in tribDict: - tribDict[i] = recTrib(i-1) + recTrib(i-2) + recTrib(i-3) + tribDict[i] = recTrib(i - 1) + recTrib(i - 2) + recTrib(i - 3) return tribDict[i] - + n = random.randint(min_length, max_length) problem = f"What is the {n}th Tribonacci number?" - solution = recTrib(n-1) + solution = recTrib(n - 1) return problem, f'${solution}$' @@ -252,16 +254,19 @@ def tribonacci_series(min_length=1, max_length=80): | --- | --- | | The Tribonacci Series of the first $8$ numbers is ? | $0, 0, 1, 1, 2, 4, 7, 13$ | """ - - tribDict = {0:0, 1:0, 2:1} + + tribDict = {0: 0, 1: 0, 2: 1} + def createTribSeries(i): tribSeries = [] for idx in range(i): if idx not in tribDict: - tribDict[idx] = tribDict[idx-1] + tribDict[idx-2] + tribDict[idx-3] + tribDict[idx] = tribDict[idx - + 1] + tribDict[idx - + 2] + tribDict[idx - 3] tribSeries.append(tribDict[idx]) return tribSeries - + n = random.randint(min_length, max_length) tribSeries = createTribSeries(n) problem = "The Tribonacci Series of the first ${n}$ numbers is ?" diff --git a/mathgenerator/geometry.py b/mathgenerator/geometry.py index ad8c6ee..0725233 100644 --- a/mathgenerator/geometry.py +++ b/mathgenerator/geometry.py @@ -166,8 +166,10 @@ def basic_trigonometry(angles=[0, 30, 45, 60, 90], 1.73: r"\sqrt{3}", } - solution = result_fraction_map[round(eval(expression), 2)] if round( - eval(expression), 2) <= 99999 else r"\infty" # for handling the ∞ condition + solution = result_fraction_map[round( + eval(expression), + 2)] if round(eval(expression), + 2) <= 99999 else r"\infty" # for handling the ∞ condition return problem, f'${solution}$' @@ -346,7 +348,7 @@ def pythagorean_theorem(max_length=20): """ a = random.randint(1, max_length) b = random.randint(1, max_length) - c = round((a ** 2 + b ** 2) ** 0.5, 2) + c = round((a**2 + b**2)**0.5, 2) problem = f"What is the hypotenuse of a right triangle given the other two sides have lengths ${a}$ and ${b}$?" solution = f"${c}$" @@ -420,7 +422,7 @@ def surface_area_cube(max_side=20, unit='m'): | Surface area of cube with side $= 6m$ is | $216 m^2$ | """ a = random.randint(1, max_side) - ans = 6 * (a ** 2) + ans = 6 * (a**2) problem = f"Surface area of cube with side $= {a}{unit}$ is" solution = f"${ans} {unit}^2$" @@ -468,14 +470,8 @@ def surface_area_pyramid(unit='m'): | Surface area of pyramid with base length $= 30m$, base width $= 40m$, and height $= 25m$ is | $2400 m^2$ | """ # List of Pythagorean triplets - _PYTHAGOREAN = [(3, 4, 5), - (6, 8, 10), - (9, 12, 15), - (12, 16, 20), - (15, 20, 25), - (5, 12, 13), - (10, 24, 26), - (7, 24, 25)] + _PYTHAGOREAN = [(3, 4, 5), (6, 8, 10), (9, 12, 15), (12, 16, 20), + (15, 20, 25), (5, 12, 13), (10, 24, 26), (7, 24, 25)] # Generate first triplet height, half_width, triangle_height_1 = random.sample( @@ -628,7 +624,7 @@ def volume_cone_frustum(max_r1=20, max_r2=20, max_height=50, unit='m'): h = random.randint(1, max_height) r1 = random.randint(1, max_r1) r2 = random.randint(1, max_r2) - ans = round(((math.pi * h) * (r1 ** 2 + r2 ** 2 + r1 * r2)) / 3, 2) + ans = round(((math.pi * h) * (r1**2 + r2**2 + r1 * r2)) / 3, 2) problem = f"Volume of frustum with height $= {h}{unit}$ and $r1 = {r1}{unit}$ is and $r2 = {r2}{unit}$ is " solution = f"${ans} {unit}^3$" diff --git a/mathgenerator/misc.py b/mathgenerator/misc.py index 96dc575..d0e1e33 100644 --- a/mathgenerator/misc.py +++ b/mathgenerator/misc.py @@ -3,9 +3,7 @@ import math import numpy as np -def arithmetic_progression_sum(max_d=100, - max_a=100, - max_n=100): +def arithmetic_progression_sum(max_d=100, max_a=100, max_n=100): """Arithmetic Progression Sum | Ex. Problem | Ex. Solution | @@ -25,9 +23,7 @@ def arithmetic_progression_sum(max_d=100, return problem, f'${solution}$' -def arithmetic_progression_term(max_d=100, - max_a=100, - max_n=100): +def arithmetic_progression_term(max_d=100, max_a=100, max_n=100): """Arithmetic Progression Term | Ex. Problem | Ex. Solution | @@ -175,16 +171,16 @@ def common_factors(max_val=100): return problem, solution -def complex_to_polar(min_real_imaginary_num=-20, - max_real_imaginary_num=20): +def complex_to_polar(min_real_imaginary_num=-20, max_real_imaginary_num=20): r"""Complex to polar form | Ex. Problem | Ex. Solution | | --- | --- | | $19.42(-19.0\theta + i-4.0\theta)$ | $-2.93$ | """ - num = complex(random.randint(min_real_imaginary_num, max_real_imaginary_num), - random.randint(min_real_imaginary_num, max_real_imaginary_num)) + num = complex( + random.randint(min_real_imaginary_num, max_real_imaginary_num), + random.randint(min_real_imaginary_num, max_real_imaginary_num)) a = num.real b = num.imag r = round(math.hypot(a, b), 2) @@ -224,7 +220,8 @@ def decimal_to_roman_numerals(max_decimal=4000): elif last_value == 4: solution += (roman_dict[div] + roman_dict[div * 5]) elif 5 <= last_value <= 8: - solution += (roman_dict[div * 5] + (roman_dict[div] * (last_value - 5))) + solution += (roman_dict[div * 5] + (roman_dict[div] * + (last_value - 5))) elif last_value == 9: solution += (roman_dict[div] + roman_dict[div * 10]) x = math.floor(x % div) @@ -288,7 +285,7 @@ def geometric_mean(max_value=100, max_count=4): nums = [random.randint(1, max_value) for i in range(count)] product = np.prod(nums) - ans = round(product ** (1 / count), 2) + ans = round(product**(1 / count), 2) problem = f"Geometric mean of ${count}$ numbers ${nums} = $" # solution = rf"$({'*'.join(map(str, nums))}^{{\frac{{1}}{{{count}}}}} = {ans}$" solution = f"${ans}$" @@ -436,10 +433,14 @@ def product_of_scientific_notations(min_exp_val=-100, max_exp_val=100): | --- | --- | | Product of scientific notations $5.11 \times 10^{67}$ and $3.64 \times 10^{-59} = $ | $1.86 \times 10^{9}$ | """ - a = [round(random.uniform(1, 10), 2), - random.randint(min_exp_val, max_exp_val)] - b = [round(random.uniform(1, 10), 2), - random.randint(min_exp_val, max_exp_val)] + a = [ + round(random.uniform(1, 10), 2), + random.randint(min_exp_val, max_exp_val) + ] + b = [ + round(random.uniform(1, 10), 2), + random.randint(min_exp_val, max_exp_val) + ] c = [a[0] * b[0], a[1] + b[1]] if c[0] >= 10: @@ -482,7 +483,7 @@ def quotient_of_power_same_base(max_base=50, max_power=10): power1 = random.randint(1, max_power) power2 = random.randint(1, max_power) step = power1 - power2 - solution = base ** step + solution = base**step problem = f"The Quotient of ${base}^{{{power1}}}$ and ${base}^{{{power2}}} = " \ f"{base}^{{{power1}-{power2}}} = {base}^{{{step}}}$" @@ -500,7 +501,7 @@ def quotient_of_power_same_power(max_base=50, max_power=10): base2 = random.randint(1, max_base) power = random.randint(1, max_power) step = base1 / base2 - solution = round(step ** power, 2) + solution = round(step**power, 2) problem = f"The quotient of ${base1}^{{{power}}}$ and ${base2}^{{{power}}} = " \ f"({base1}/{base2})^{power} = {step}^{{{power}}}$" @@ -574,8 +575,7 @@ def surds_comparison(max_value=100, max_root=10): return problem, f'${solution}$' -def velocity_of_object(max_displacement=1000,max_time=100): - +def velocity_of_object(max_displacement=1000, max_time=100): """Velocity of object | Ex. Problem | Ex. Solution | @@ -583,10 +583,9 @@ def velocity_of_object(max_displacement=1000,max_time=100): | An object travels at uniform velocity a distance of $100 m$ in $4$ seconds. What is the velocity of the car? | $25 m/s$ | """ - - displacement = random.randint(1,max_displacement) + displacement = random.randint(1, max_displacement) time_taken = random.randint(1, max_time) - velocity = "${} m/s$".format(round(displacement/time_taken, 2)) - + velocity = "${} m/s$".format(round(displacement / time_taken, 2)) + problem = f"An object travels at uniform velocity a distance of ${displacement} m$ in ${time_taken}$ seconds. What is the velocity of the car? " - return problem , velocity + return problem, velocity diff --git a/mathgenerator/statistics.py b/mathgenerator/statistics.py index a598fa6..4dae6e2 100644 --- a/mathgenerator/statistics.py +++ b/mathgenerator/statistics.py @@ -12,8 +12,8 @@ def combinations(max_lengthgth=20): a = random.randint(10, max_lengthgth) b = random.randint(0, 9) - solution = int(math.factorial( - a) / (math.factorial(b) * math.factorial(a - b))) + solution = int( + math.factorial(a) / (math.factorial(b) * math.factorial(a - b))) problem = f"Find the number of combinations from ${a}$ objects picked ${b}$ at a time." return problem, f'${solution}$' @@ -108,7 +108,7 @@ def data_summary(number_values=15, min_val=5, max_val=50): var += (random_list[i] - mean)**2 standardDeviation = round(var / number_values, 2) - variance = round((var / number_values) ** 0.5, 2) + variance = round((var / number_values)**0.5, 2) problem = f"Find the mean,standard deviation and variance for the data ${', '.join(map(str, random_list))}$" solution = f"The Mean is ${mean}$, Standard Deviation is ${standardDeviation}$, Variance is ${variance}$" diff --git a/scripts/addFuture.py b/scripts/addFuture.py index 47f0fde..baa24a2 100644 --- a/scripts/addFuture.py +++ b/scripts/addFuture.py @@ -1,6 +1,7 @@ import os -print("You are about to add a new generator to the table in futureGenerators.md") +print( + "You are about to add a new generator to the table in futureGenerators.md") print("Please fill out the following:") title = input("> Title: ") example_problem = input("> Example Problem: ") @@ -14,4 +15,5 @@ else: with open(file, 'a') as f: f.writelines( - f'| {title} | {example_problem} | {example_solution} | {further_explanation} |\n') + f'| {title} | {example_problem} | {example_solution} | {further_explanation} |\n' + ) diff --git a/scripts/adoptGenerator.py b/scripts/adoptGenerator.py index f05d86a..fa66959 100644 --- a/scripts/adoptGenerator.py +++ b/scripts/adoptGenerator.py @@ -18,15 +18,17 @@ def get_filepaths(subject_name): # Join the two strings in order to form the full filepath. filepath = os.path.join(root, filename) - front_len = 24+len(subject_name) + front_len = 24 + len(subject_name) filename = filepath[front_len:-3] file_paths.append(filename) # Add it to the list. return file_paths -subjects = ['algebra', 'basic_math', 'calculus', - 'computer_science', 'geometry', 'misc', 'statistics'] +subjects = [ + 'algebra', 'basic_math', 'calculus', 'computer_science', 'geometry', + 'misc', 'statistics' +] for subject in subjects: full_file_paths = get_filepaths(subject) full_file_paths.sort() diff --git a/scripts/makeReadme.py b/scripts/makeReadme.py index 8370440..262576f 100644 --- a/scripts/makeReadme.py +++ b/scripts/makeReadme.py @@ -142,7 +142,7 @@ def main(): for write_line in write_list: lines.append(write_line) - with open('../README.md', "w", encoding = 'utf-8') as g: + with open('../README.md', "w", encoding='utf-8') as g: g.writelines(lines) print("New README.md table generated") diff --git a/scripts/nextId.py b/scripts/nextId.py index d2f42e9..ae1a9b8 100644 --- a/scripts/nextId.py +++ b/scripts/nextId.py @@ -1,4 +1,4 @@ # Use this file to determine which ID to use for the next generator that you add from mathgenerator import mathgen -print(mathgen.getGenList()[-1][0]+1) +print(mathgen.getGenList()[-1][0] + 1) diff --git a/scripts/unmodule.py b/scripts/unmodule.py index d0df3f7..0662ef1 100644 --- a/scripts/unmodule.py +++ b/scripts/unmodule.py @@ -1,7 +1,7 @@ import os name = 'computer_science' -with open (f'/home/luke/src/mathgenerator/mathgenerator/{name}.py', 'w') as f: +with open(f'/home/luke/src/mathgenerator/mathgenerator/{name}.py', 'w') as f: source_dir_path = f'/home/luke/src/mathgenerator/mathgenerator/{name}' files = os.listdir(source_dir_path) for file in sorted(files):