diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 4e562cc..c726148 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -1,37 +1,10 @@ -import os -import traceback +from .funcs import * +from .generator import getGenList + +genList = getGenList() -genList = [] - -SEP = os.sep - - -class Generator: - def __init__(self, title, id, func, kwargs): - self.title = title - self.id = id - self.func = func - self.kwargs = kwargs - - (filename, line_number, function_name, - text) = traceback.extract_stack()[-2] - funcname = filename[filename.rfind(SEP):].strip() - funcname = funcname[1:-3] - subjectname = filename[:filename.rfind(SEP)].strip() - subjectname = subjectname[subjectname.rfind(SEP):].strip() - subjectname = subjectname[1:] - genList.append([id, title, self, funcname, subjectname, kwargs]) - - def __str__(self): - return str(self.id) + " " + self.title - - def __call__(self, *args, **kwargs): - return self.func(*args, **kwargs) - - -def getGenList(): - correctedList = genList[-1:] + genList[:-1] - # Orders list by id - correctedList.sort() - return correctedList +# || Non-generator Functions +def genById(id, *args, **kwargs): + generator = genList[id][2] + return (generator(*args, **kwargs)) diff --git a/mathgenerator/funcs/algebra/basic_algebra.py b/mathgenerator/funcs/algebra/basic_algebra.py index 1ef0b21..2585fcf 100644 --- a/mathgenerator/funcs/algebra/basic_algebra.py +++ b/mathgenerator/funcs/algebra/basic_algebra.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/combine_like_terms.py b/mathgenerator/funcs/algebra/combine_like_terms.py index ff12459..da1c96a 100644 --- a/mathgenerator/funcs/algebra/combine_like_terms.py +++ b/mathgenerator/funcs/algebra/combine_like_terms.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/complex_quadratic.py b/mathgenerator/funcs/algebra/complex_quadratic.py index 30763bc..de45a68 100644 --- a/mathgenerator/funcs/algebra/complex_quadratic.py +++ b/mathgenerator/funcs/algebra/complex_quadratic.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/compound_interest.py b/mathgenerator/funcs/algebra/compound_interest.py index abe34b8..7959091 100644 --- a/mathgenerator/funcs/algebra/compound_interest.py +++ b/mathgenerator/funcs/algebra/compound_interest.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/distance_two_points.py b/mathgenerator/funcs/algebra/distance_two_points.py index 80da6ba..d38e957 100644 --- a/mathgenerator/funcs/algebra/distance_two_points.py +++ b/mathgenerator/funcs/algebra/distance_two_points.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/expanding.py b/mathgenerator/funcs/algebra/expanding.py index 7e88a9a..47d0c3d 100644 --- a/mathgenerator/funcs/algebra/expanding.py +++ b/mathgenerator/funcs/algebra/expanding.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/factoring.py b/mathgenerator/funcs/algebra/factoring.py index 02a8bc2..5f7c57b 100644 --- a/mathgenerator/funcs/algebra/factoring.py +++ b/mathgenerator/funcs/algebra/factoring.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/int_matrix_22_determinant.py b/mathgenerator/funcs/algebra/int_matrix_22_determinant.py index 15923c1..6da56f5 100644 --- a/mathgenerator/funcs/algebra/int_matrix_22_determinant.py +++ b/mathgenerator/funcs/algebra/int_matrix_22_determinant.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/intersection_of_two_lines.py b/mathgenerator/funcs/algebra/intersection_of_two_lines.py index 42f2615..c108935 100644 --- a/mathgenerator/funcs/algebra/intersection_of_two_lines.py +++ b/mathgenerator/funcs/algebra/intersection_of_two_lines.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import fractions diff --git a/mathgenerator/funcs/algebra/invert_matrix.py b/mathgenerator/funcs/algebra/invert_matrix.py index cbad277..c52f1d5 100644 --- a/mathgenerator/funcs/algebra/invert_matrix.py +++ b/mathgenerator/funcs/algebra/invert_matrix.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math import sympy diff --git a/mathgenerator/funcs/algebra/linear_equations.py b/mathgenerator/funcs/algebra/linear_equations.py index d4dd146..56f5724 100644 --- a/mathgenerator/funcs/algebra/linear_equations.py +++ b/mathgenerator/funcs/algebra/linear_equations.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/log.py b/mathgenerator/funcs/algebra/log.py index 6f5c37e..b89f793 100644 --- a/mathgenerator/funcs/algebra/log.py +++ b/mathgenerator/funcs/algebra/log.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/matrix_multiplication.py b/mathgenerator/funcs/algebra/matrix_multiplication.py index ab29b97..0ab5096 100644 --- a/mathgenerator/funcs/algebra/matrix_multiplication.py +++ b/mathgenerator/funcs/algebra/matrix_multiplication.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/midpoint_of_two_points.py b/mathgenerator/funcs/algebra/midpoint_of_two_points.py index df8b035..b18aa46 100644 --- a/mathgenerator/funcs/algebra/midpoint_of_two_points.py +++ b/mathgenerator/funcs/algebra/midpoint_of_two_points.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/multiply_complex_numbers.py b/mathgenerator/funcs/algebra/multiply_complex_numbers.py index b6f1db8..93e0dee 100644 --- a/mathgenerator/funcs/algebra/multiply_complex_numbers.py +++ b/mathgenerator/funcs/algebra/multiply_complex_numbers.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py b/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py index 56db80d..9f1a38c 100644 --- a/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py +++ b/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/quadratic_equation.py b/mathgenerator/funcs/algebra/quadratic_equation.py index b474d77..16422b0 100644 --- a/mathgenerator/funcs/algebra/quadratic_equation.py +++ b/mathgenerator/funcs/algebra/quadratic_equation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/algebra/simple_interest.py b/mathgenerator/funcs/algebra/simple_interest.py index 9c1170a..1b4d3fc 100644 --- a/mathgenerator/funcs/algebra/simple_interest.py +++ b/mathgenerator/funcs/algebra/simple_interest.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/system_of_equations.py b/mathgenerator/funcs/algebra/system_of_equations.py index 1f85975..12bad36 100644 --- a/mathgenerator/funcs/algebra/system_of_equations.py +++ b/mathgenerator/funcs/algebra/system_of_equations.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/vector_cross.py b/mathgenerator/funcs/algebra/vector_cross.py index 8b44121..939c25e 100644 --- a/mathgenerator/funcs/algebra/vector_cross.py +++ b/mathgenerator/funcs/algebra/vector_cross.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/algebra/vector_dot.py b/mathgenerator/funcs/algebra/vector_dot.py index 3561edb..033621e 100644 --- a/mathgenerator/funcs/algebra/vector_dot.py +++ b/mathgenerator/funcs/algebra/vector_dot.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/absolute_difference.py b/mathgenerator/funcs/basic_math/absolute_difference.py index 47fc1df..521a64d 100644 --- a/mathgenerator/funcs/basic_math/absolute_difference.py +++ b/mathgenerator/funcs/basic_math/absolute_difference.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/addition.py b/mathgenerator/funcs/basic_math/addition.py index c4bede1..7152075 100644 --- a/mathgenerator/funcs/basic_math/addition.py +++ b/mathgenerator/funcs/basic_math/addition.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/compare_fractions.py b/mathgenerator/funcs/basic_math/compare_fractions.py index 536d8d5..516ba01 100644 --- a/mathgenerator/funcs/basic_math/compare_fractions.py +++ b/mathgenerator/funcs/basic_math/compare_fractions.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/cube_root.py b/mathgenerator/funcs/basic_math/cube_root.py index 8cd631c..496bc65 100644 --- a/mathgenerator/funcs/basic_math/cube_root.py +++ b/mathgenerator/funcs/basic_math/cube_root.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/divide_fractions.py b/mathgenerator/funcs/basic_math/divide_fractions.py index d7ef64e..8b48cec 100644 --- a/mathgenerator/funcs/basic_math/divide_fractions.py +++ b/mathgenerator/funcs/basic_math/divide_fractions.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/division.py b/mathgenerator/funcs/basic_math/division.py index 1208a3b..06aa815 100644 --- a/mathgenerator/funcs/basic_math/division.py +++ b/mathgenerator/funcs/basic_math/division.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/exponentiation.py b/mathgenerator/funcs/basic_math/exponentiation.py index 4f699a0..fe81059 100644 --- a/mathgenerator/funcs/basic_math/exponentiation.py +++ b/mathgenerator/funcs/basic_math/exponentiation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/factorial.py b/mathgenerator/funcs/basic_math/factorial.py index d3a8fb2..6832a92 100644 --- a/mathgenerator/funcs/basic_math/factorial.py +++ b/mathgenerator/funcs/basic_math/factorial.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/fraction_multiplication.py b/mathgenerator/funcs/basic_math/fraction_multiplication.py index 070179f..a6ac743 100644 --- a/mathgenerator/funcs/basic_math/fraction_multiplication.py +++ b/mathgenerator/funcs/basic_math/fraction_multiplication.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/fraction_to_decimal.py b/mathgenerator/funcs/basic_math/fraction_to_decimal.py index 8b8555b..214e4b8 100644 --- a/mathgenerator/funcs/basic_math/fraction_to_decimal.py +++ b/mathgenerator/funcs/basic_math/fraction_to_decimal.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/greatest_common_divisor.py b/mathgenerator/funcs/basic_math/greatest_common_divisor.py index 4f69519..0c8c365 100644 --- a/mathgenerator/funcs/basic_math/greatest_common_divisor.py +++ b/mathgenerator/funcs/basic_math/greatest_common_divisor.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/is_composite.py b/mathgenerator/funcs/basic_math/is_composite.py index 43afeac..5c115a8 100644 --- a/mathgenerator/funcs/basic_math/is_composite.py +++ b/mathgenerator/funcs/basic_math/is_composite.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/is_prime.py b/mathgenerator/funcs/basic_math/is_prime.py index 4e1141b..d35b77f 100644 --- a/mathgenerator/funcs/basic_math/is_prime.py +++ b/mathgenerator/funcs/basic_math/is_prime.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/multiplication.py b/mathgenerator/funcs/basic_math/multiplication.py index b7958e9..3f26291 100644 --- a/mathgenerator/funcs/basic_math/multiplication.py +++ b/mathgenerator/funcs/basic_math/multiplication.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/percentage.py b/mathgenerator/funcs/basic_math/percentage.py index 9f73621..9ca475a 100644 --- a/mathgenerator/funcs/basic_math/percentage.py +++ b/mathgenerator/funcs/basic_math/percentage.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/percentage_difference.py b/mathgenerator/funcs/basic_math/percentage_difference.py index 9368211..8b2f403 100644 --- a/mathgenerator/funcs/basic_math/percentage_difference.py +++ b/mathgenerator/funcs/basic_math/percentage_difference.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/percentage_error.py b/mathgenerator/funcs/basic_math/percentage_error.py index a193b1e..fe579ca 100644 --- a/mathgenerator/funcs/basic_math/percentage_error.py +++ b/mathgenerator/funcs/basic_math/percentage_error.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/power_of_powers.py b/mathgenerator/funcs/basic_math/power_of_powers.py index 6989786..20d1e57 100644 --- a/mathgenerator/funcs/basic_math/power_of_powers.py +++ b/mathgenerator/funcs/basic_math/power_of_powers.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/square.py b/mathgenerator/funcs/basic_math/square.py index 916f73c..d8ebc8f 100644 --- a/mathgenerator/funcs/basic_math/square.py +++ b/mathgenerator/funcs/basic_math/square.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/square_root.py b/mathgenerator/funcs/basic_math/square_root.py index c44ce44..09389ef 100644 --- a/mathgenerator/funcs/basic_math/square_root.py +++ b/mathgenerator/funcs/basic_math/square_root.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/basic_math/subtraction.py b/mathgenerator/funcs/basic_math/subtraction.py index 29eebba..11b9915 100644 --- a/mathgenerator/funcs/basic_math/subtraction.py +++ b/mathgenerator/funcs/basic_math/subtraction.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/calculus/definite_integral.py b/mathgenerator/funcs/calculus/definite_integral.py index e6a9728..4aec425 100644 --- a/mathgenerator/funcs/calculus/definite_integral.py +++ b/mathgenerator/funcs/calculus/definite_integral.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random from scipy.integrate import quad diff --git a/mathgenerator/funcs/calculus/differentiation.py b/mathgenerator/funcs/calculus/differentiation.py index c880283..2e9311a 100644 --- a/mathgenerator/funcs/calculus/differentiation.py +++ b/mathgenerator/funcs/calculus/differentiation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import sympy diff --git a/mathgenerator/funcs/calculus/power_rule_differentiation.py b/mathgenerator/funcs/calculus/power_rule_differentiation.py index f225eec..5fc5fad 100644 --- a/mathgenerator/funcs/calculus/power_rule_differentiation.py +++ b/mathgenerator/funcs/calculus/power_rule_differentiation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/calculus/power_rule_integration.py b/mathgenerator/funcs/calculus/power_rule_integration.py index 3351b68..6b8a9c9 100644 --- a/mathgenerator/funcs/calculus/power_rule_integration.py +++ b/mathgenerator/funcs/calculus/power_rule_integration.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/calculus/stationary_points.py b/mathgenerator/funcs/calculus/stationary_points.py index ca69379..697a54d 100644 --- a/mathgenerator/funcs/calculus/stationary_points.py +++ b/mathgenerator/funcs/calculus/stationary_points.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import sympy diff --git a/mathgenerator/funcs/computer_science/bcd_to_decimal.py b/mathgenerator/funcs/computer_science/bcd_to_decimal.py index 6b2eed6..e257845 100644 --- a/mathgenerator/funcs/computer_science/bcd_to_decimal.py +++ b/mathgenerator/funcs/computer_science/bcd_to_decimal.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/binary_2s_complement.py b/mathgenerator/funcs/computer_science/binary_2s_complement.py index 60a00d2..7cd444b 100644 --- a/mathgenerator/funcs/computer_science/binary_2s_complement.py +++ b/mathgenerator/funcs/computer_science/binary_2s_complement.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/binary_complement_1s.py b/mathgenerator/funcs/computer_science/binary_complement_1s.py index 14b5094..91ea0be 100644 --- a/mathgenerator/funcs/computer_science/binary_complement_1s.py +++ b/mathgenerator/funcs/computer_science/binary_complement_1s.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/binary_to_decimal.py b/mathgenerator/funcs/computer_science/binary_to_decimal.py index 17db52e..71aca1e 100644 --- a/mathgenerator/funcs/computer_science/binary_to_decimal.py +++ b/mathgenerator/funcs/computer_science/binary_to_decimal.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/binary_to_hex.py b/mathgenerator/funcs/computer_science/binary_to_hex.py index 01a17bd..3538c86 100644 --- a/mathgenerator/funcs/computer_science/binary_to_hex.py +++ b/mathgenerator/funcs/computer_science/binary_to_hex.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/decimal_to_bcd.py b/mathgenerator/funcs/computer_science/decimal_to_bcd.py index ed6c43b..abaa7b9 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_bcd.py +++ b/mathgenerator/funcs/computer_science/decimal_to_bcd.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/decimal_to_binary.py b/mathgenerator/funcs/computer_science/decimal_to_binary.py index b187f9d..49ae9b2 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_binary.py +++ b/mathgenerator/funcs/computer_science/decimal_to_binary.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/decimal_to_hexadeci.py b/mathgenerator/funcs/computer_science/decimal_to_hexadeci.py index e11482a..44c41fb 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_hexadeci.py +++ b/mathgenerator/funcs/computer_science/decimal_to_hexadeci.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/decimal_to_octal.py b/mathgenerator/funcs/computer_science/decimal_to_octal.py index d066859..b19f064 100644 --- a/mathgenerator/funcs/computer_science/decimal_to_octal.py +++ b/mathgenerator/funcs/computer_science/decimal_to_octal.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/fibonacci_series.py b/mathgenerator/funcs/computer_science/fibonacci_series.py index 0fa62e3..ec21840 100644 --- a/mathgenerator/funcs/computer_science/fibonacci_series.py +++ b/mathgenerator/funcs/computer_science/fibonacci_series.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/modulo_division.py b/mathgenerator/funcs/computer_science/modulo_division.py index 9bdd760..6843966 100644 --- a/mathgenerator/funcs/computer_science/modulo_division.py +++ b/mathgenerator/funcs/computer_science/modulo_division.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/computer_science/nth_fibonacci_number.py b/mathgenerator/funcs/computer_science/nth_fibonacci_number.py index 4c54081..d9cb6fe 100644 --- a/mathgenerator/funcs/computer_science/nth_fibonacci_number.py +++ b/mathgenerator/funcs/computer_science/nth_fibonacci_number.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/angle_btw_vectors.py b/mathgenerator/funcs/geometry/angle_btw_vectors.py index eec8aa8..777963d 100644 --- a/mathgenerator/funcs/geometry/angle_btw_vectors.py +++ b/mathgenerator/funcs/geometry/angle_btw_vectors.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/angle_regular_polygon.py b/mathgenerator/funcs/geometry/angle_regular_polygon.py index 2da5275..894aecf 100644 --- a/mathgenerator/funcs/geometry/angle_regular_polygon.py +++ b/mathgenerator/funcs/geometry/angle_regular_polygon.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/arc_length.py b/mathgenerator/funcs/geometry/arc_length.py index 7b9db1d..1d511ed 100644 --- a/mathgenerator/funcs/geometry/arc_length.py +++ b/mathgenerator/funcs/geometry/arc_length.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/area_of_circle.py b/mathgenerator/funcs/geometry/area_of_circle.py index 1f0fff4..d5308ab 100644 --- a/mathgenerator/funcs/geometry/area_of_circle.py +++ b/mathgenerator/funcs/geometry/area_of_circle.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/area_of_circle_given_center_and_point.py b/mathgenerator/funcs/geometry/area_of_circle_given_center_and_point.py index 4d14ec4..46169d7 100644 --- a/mathgenerator/funcs/geometry/area_of_circle_given_center_and_point.py +++ b/mathgenerator/funcs/geometry/area_of_circle_given_center_and_point.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random from math import cos, sin, pi diff --git a/mathgenerator/funcs/geometry/area_of_triangle.py b/mathgenerator/funcs/geometry/area_of_triangle.py index 8fa6485..f6f086f 100644 --- a/mathgenerator/funcs/geometry/area_of_triangle.py +++ b/mathgenerator/funcs/geometry/area_of_triangle.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/basic_trigonometry.py b/mathgenerator/funcs/geometry/basic_trigonometry.py index 2401c9d..68600a0 100644 --- a/mathgenerator/funcs/geometry/basic_trigonometry.py +++ b/mathgenerator/funcs/geometry/basic_trigonometry.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/circumference.py b/mathgenerator/funcs/geometry/circumference.py index 9255daf..b433ad3 100644 --- a/mathgenerator/funcs/geometry/circumference.py +++ b/mathgenerator/funcs/geometry/circumference.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py b/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py index d195948..067ecb2 100644 --- a/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py +++ b/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/degree_to_rad.py b/mathgenerator/funcs/geometry/degree_to_rad.py index dce79e1..ed87ec5 100644 --- a/mathgenerator/funcs/geometry/degree_to_rad.py +++ b/mathgenerator/funcs/geometry/degree_to_rad.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/equation_of_line_from_two_points.py b/mathgenerator/funcs/geometry/equation_of_line_from_two_points.py index d9db817..a72cb8f 100644 --- a/mathgenerator/funcs/geometry/equation_of_line_from_two_points.py +++ b/mathgenerator/funcs/geometry/equation_of_line_from_two_points.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py b/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py index 2b02366..8fef249 100644 --- a/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py +++ b/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/perimeter_of_polygons.py b/mathgenerator/funcs/geometry/perimeter_of_polygons.py index 3b569c5..b40063d 100644 --- a/mathgenerator/funcs/geometry/perimeter_of_polygons.py +++ b/mathgenerator/funcs/geometry/perimeter_of_polygons.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/pythagorean_theorem.py b/mathgenerator/funcs/geometry/pythagorean_theorem.py index 75887a3..88a4848 100644 --- a/mathgenerator/funcs/geometry/pythagorean_theorem.py +++ b/mathgenerator/funcs/geometry/pythagorean_theorem.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/radian_to_deg.py b/mathgenerator/funcs/geometry/radian_to_deg.py index 98aa982..b70e83d 100644 --- a/mathgenerator/funcs/geometry/radian_to_deg.py +++ b/mathgenerator/funcs/geometry/radian_to_deg.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/sector_area.py b/mathgenerator/funcs/geometry/sector_area.py index 8ba7d37..bbc1b43 100644 --- a/mathgenerator/funcs/geometry/sector_area.py +++ b/mathgenerator/funcs/geometry/sector_area.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/sum_of_polygon_angles.py b/mathgenerator/funcs/geometry/sum_of_polygon_angles.py index d31c6ae..96cc0c9 100644 --- a/mathgenerator/funcs/geometry/sum_of_polygon_angles.py +++ b/mathgenerator/funcs/geometry/sum_of_polygon_angles.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/surface_area_cone.py b/mathgenerator/funcs/geometry/surface_area_cone.py index fbd336b..00dc106 100644 --- a/mathgenerator/funcs/geometry/surface_area_cone.py +++ b/mathgenerator/funcs/geometry/surface_area_cone.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/surface_area_cube.py b/mathgenerator/funcs/geometry/surface_area_cube.py index f728329..9e6711a 100644 --- a/mathgenerator/funcs/geometry/surface_area_cube.py +++ b/mathgenerator/funcs/geometry/surface_area_cube.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/surface_area_cuboid.py b/mathgenerator/funcs/geometry/surface_area_cuboid.py index 66564ab..2dd94b1 100644 --- a/mathgenerator/funcs/geometry/surface_area_cuboid.py +++ b/mathgenerator/funcs/geometry/surface_area_cuboid.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/surface_area_cylinder.py b/mathgenerator/funcs/geometry/surface_area_cylinder.py index 3b0c857..db99de2 100644 --- a/mathgenerator/funcs/geometry/surface_area_cylinder.py +++ b/mathgenerator/funcs/geometry/surface_area_cylinder.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/surface_area_pyramid.py b/mathgenerator/funcs/geometry/surface_area_pyramid.py index 216d07f..d4c983d 100644 --- a/mathgenerator/funcs/geometry/surface_area_pyramid.py +++ b/mathgenerator/funcs/geometry/surface_area_pyramid.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random # List of Pythagorean triplets diff --git a/mathgenerator/funcs/geometry/surface_area_sphere.py b/mathgenerator/funcs/geometry/surface_area_sphere.py index 140eaac..8f2aef0 100644 --- a/mathgenerator/funcs/geometry/surface_area_sphere.py +++ b/mathgenerator/funcs/geometry/surface_area_sphere.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/third_angle_of_triangle.py b/mathgenerator/funcs/geometry/third_angle_of_triangle.py index 47df5cc..452c20d 100644 --- a/mathgenerator/funcs/geometry/third_angle_of_triangle.py +++ b/mathgenerator/funcs/geometry/third_angle_of_triangle.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/valid_triangle.py b/mathgenerator/funcs/geometry/valid_triangle.py index 0b2fe81..ea5f503 100644 --- a/mathgenerator/funcs/geometry/valid_triangle.py +++ b/mathgenerator/funcs/geometry/valid_triangle.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/volume_cone.py b/mathgenerator/funcs/geometry/volume_cone.py index 1f08ee5..8175cf0 100644 --- a/mathgenerator/funcs/geometry/volume_cone.py +++ b/mathgenerator/funcs/geometry/volume_cone.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/volume_cube.py b/mathgenerator/funcs/geometry/volume_cube.py index 2f947ed..acca1d1 100644 --- a/mathgenerator/funcs/geometry/volume_cube.py +++ b/mathgenerator/funcs/geometry/volume_cube.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/volume_cuboid.py b/mathgenerator/funcs/geometry/volume_cuboid.py index 31eac5a..808ec31 100644 --- a/mathgenerator/funcs/geometry/volume_cuboid.py +++ b/mathgenerator/funcs/geometry/volume_cuboid.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/volume_cylinder.py b/mathgenerator/funcs/geometry/volume_cylinder.py index 67f9642..549886b 100644 --- a/mathgenerator/funcs/geometry/volume_cylinder.py +++ b/mathgenerator/funcs/geometry/volume_cylinder.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/volume_frustum.py b/mathgenerator/funcs/geometry/volume_frustum.py index 7d0a330..0676c5d 100644 --- a/mathgenerator/funcs/geometry/volume_frustum.py +++ b/mathgenerator/funcs/geometry/volume_frustum.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/volume_hemisphere.py b/mathgenerator/funcs/geometry/volume_hemisphere.py index 75df0f2..5425f9f 100644 --- a/mathgenerator/funcs/geometry/volume_hemisphere.py +++ b/mathgenerator/funcs/geometry/volume_hemisphere.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/geometry/volume_pyramid.py b/mathgenerator/funcs/geometry/volume_pyramid.py index 12eb4c1..e82220e 100644 --- a/mathgenerator/funcs/geometry/volume_pyramid.py +++ b/mathgenerator/funcs/geometry/volume_pyramid.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/geometry/volume_sphere.py b/mathgenerator/funcs/geometry/volume_sphere.py index 015e69c..3881870 100644 --- a/mathgenerator/funcs/geometry/volume_sphere.py +++ b/mathgenerator/funcs/geometry/volume_sphere.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/misc/arithmetic_progression_sum.py b/mathgenerator/funcs/misc/arithmetic_progression_sum.py index b3fd7cf..df12a0f 100644 --- a/mathgenerator/funcs/misc/arithmetic_progression_sum.py +++ b/mathgenerator/funcs/misc/arithmetic_progression_sum.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/arithmetic_progression_term.py b/mathgenerator/funcs/misc/arithmetic_progression_term.py index 7e09b92..c7e1bb1 100644 --- a/mathgenerator/funcs/misc/arithmetic_progression_term.py +++ b/mathgenerator/funcs/misc/arithmetic_progression_term.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/base_conversion.py b/mathgenerator/funcs/misc/base_conversion.py index 2f74f3f..047e000 100644 --- a/mathgenerator/funcs/misc/base_conversion.py +++ b/mathgenerator/funcs/misc/base_conversion.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/binomial_distribution.py b/mathgenerator/funcs/misc/binomial_distribution.py index 3f37da8..b54fc43 100644 --- a/mathgenerator/funcs/misc/binomial_distribution.py +++ b/mathgenerator/funcs/misc/binomial_distribution.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/celsius_to_fahrenheit.py b/mathgenerator/funcs/misc/celsius_to_fahrenheit.py index 176c14b..b2fd262 100644 --- a/mathgenerator/funcs/misc/celsius_to_fahrenheit.py +++ b/mathgenerator/funcs/misc/celsius_to_fahrenheit.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/common_factors.py b/mathgenerator/funcs/misc/common_factors.py index 20b7ea5..e1863a9 100644 --- a/mathgenerator/funcs/misc/common_factors.py +++ b/mathgenerator/funcs/misc/common_factors.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/complex_to_polar.py b/mathgenerator/funcs/misc/complex_to_polar.py index 95219ea..71d5513 100644 --- a/mathgenerator/funcs/misc/complex_to_polar.py +++ b/mathgenerator/funcs/misc/complex_to_polar.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/misc/decimal_to_roman_numerals.py b/mathgenerator/funcs/misc/decimal_to_roman_numerals.py index 2812b09..8c044af 100644 --- a/mathgenerator/funcs/misc/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/misc/decimal_to_roman_numerals.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/misc/euclidian_norm.py b/mathgenerator/funcs/misc/euclidian_norm.py index 2d5b4a2..84c9011 100644 --- a/mathgenerator/funcs/misc/euclidian_norm.py +++ b/mathgenerator/funcs/misc/euclidian_norm.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/misc/factors.py b/mathgenerator/funcs/misc/factors.py index 91d35ee..794764e 100644 --- a/mathgenerator/funcs/misc/factors.py +++ b/mathgenerator/funcs/misc/factors.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/gcd.py b/mathgenerator/funcs/misc/gcd.py index f160bcf..23b2868 100644 --- a/mathgenerator/funcs/misc/gcd.py +++ b/mathgenerator/funcs/misc/gcd.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/geometric_mean.py b/mathgenerator/funcs/misc/geometric_mean.py index 640562b..56b1ddf 100644 --- a/mathgenerator/funcs/misc/geometric_mean.py +++ b/mathgenerator/funcs/misc/geometric_mean.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/geometric_progression.py b/mathgenerator/funcs/misc/geometric_progression.py index 4d74c23..5a9098c 100644 --- a/mathgenerator/funcs/misc/geometric_progression.py +++ b/mathgenerator/funcs/misc/geometric_progression.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/harmonic_mean.py b/mathgenerator/funcs/misc/harmonic_mean.py index 72c99dd..58569b1 100644 --- a/mathgenerator/funcs/misc/harmonic_mean.py +++ b/mathgenerator/funcs/misc/harmonic_mean.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/hcf.py b/mathgenerator/funcs/misc/hcf.py index 43caf0b..1c06f61 100644 --- a/mathgenerator/funcs/misc/hcf.py +++ b/mathgenerator/funcs/misc/hcf.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/is_leap_year.py b/mathgenerator/funcs/misc/is_leap_year.py index b59f840..b730e34 100644 --- a/mathgenerator/funcs/misc/is_leap_year.py +++ b/mathgenerator/funcs/misc/is_leap_year.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/lcm.py b/mathgenerator/funcs/misc/lcm.py index 0d9aa57..e420084 100644 --- a/mathgenerator/funcs/misc/lcm.py +++ b/mathgenerator/funcs/misc/lcm.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/minutes_to_hours.py b/mathgenerator/funcs/misc/minutes_to_hours.py index 14d0909..381e2a4 100644 --- a/mathgenerator/funcs/misc/minutes_to_hours.py +++ b/mathgenerator/funcs/misc/minutes_to_hours.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/prime_factors.py b/mathgenerator/funcs/misc/prime_factors.py index 9c31d44..20f5005 100644 --- a/mathgenerator/funcs/misc/prime_factors.py +++ b/mathgenerator/funcs/misc/prime_factors.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/product_of_scientific_notations.py b/mathgenerator/funcs/misc/product_of_scientific_notations.py index d7ee4f4..29e0a62 100644 --- a/mathgenerator/funcs/misc/product_of_scientific_notations.py +++ b/mathgenerator/funcs/misc/product_of_scientific_notations.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/profit_loss_percent.py b/mathgenerator/funcs/misc/profit_loss_percent.py index 7122962..cbe5e39 100644 --- a/mathgenerator/funcs/misc/profit_loss_percent.py +++ b/mathgenerator/funcs/misc/profit_loss_percent.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/quotient_of_power_same_base.py b/mathgenerator/funcs/misc/quotient_of_power_same_base.py index 66914c6..8eed683 100644 --- a/mathgenerator/funcs/misc/quotient_of_power_same_base.py +++ b/mathgenerator/funcs/misc/quotient_of_power_same_base.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/quotient_of_power_same_power.py b/mathgenerator/funcs/misc/quotient_of_power_same_power.py index 58ef209..df5c651 100644 --- a/mathgenerator/funcs/misc/quotient_of_power_same_power.py +++ b/mathgenerator/funcs/misc/quotient_of_power_same_power.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/set_operation.py b/mathgenerator/funcs/misc/set_operation.py index 45d98c1..95c3691 100644 --- a/mathgenerator/funcs/misc/set_operation.py +++ b/mathgenerator/funcs/misc/set_operation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/signum_function.py b/mathgenerator/funcs/misc/signum_function.py index 3ddc580..fd113b6 100644 --- a/mathgenerator/funcs/misc/signum_function.py +++ b/mathgenerator/funcs/misc/signum_function.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/misc/surds_comparison.py b/mathgenerator/funcs/misc/surds_comparison.py index 50d8066..830e8ee 100644 --- a/mathgenerator/funcs/misc/surds_comparison.py +++ b/mathgenerator/funcs/misc/surds_comparison.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/statistics/combinations.py b/mathgenerator/funcs/statistics/combinations.py index a9ad9c3..83d3866 100644 --- a/mathgenerator/funcs/statistics/combinations.py +++ b/mathgenerator/funcs/statistics/combinations.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/statistics/conditional_probability.py b/mathgenerator/funcs/statistics/conditional_probability.py index b659c3b..05ebbb3 100644 --- a/mathgenerator/funcs/statistics/conditional_probability.py +++ b/mathgenerator/funcs/statistics/conditional_probability.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/statistics/confidence_interval.py b/mathgenerator/funcs/statistics/confidence_interval.py index 8137704..6300fe1 100644 --- a/mathgenerator/funcs/statistics/confidence_interval.py +++ b/mathgenerator/funcs/statistics/confidence_interval.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/statistics/data_summary.py b/mathgenerator/funcs/statistics/data_summary.py index 6f350af..7892832 100644 --- a/mathgenerator/funcs/statistics/data_summary.py +++ b/mathgenerator/funcs/statistics/data_summary.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/statistics/dice_sum_probability.py b/mathgenerator/funcs/statistics/dice_sum_probability.py index f2ecaed..ad55c72 100644 --- a/mathgenerator/funcs/statistics/dice_sum_probability.py +++ b/mathgenerator/funcs/statistics/dice_sum_probability.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/statistics/mean_median.py b/mathgenerator/funcs/statistics/mean_median.py index e282709..7330462 100644 --- a/mathgenerator/funcs/statistics/mean_median.py +++ b/mathgenerator/funcs/statistics/mean_median.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random diff --git a/mathgenerator/funcs/statistics/permutation.py b/mathgenerator/funcs/statistics/permutation.py index 5f374d5..d3f3d27 100644 --- a/mathgenerator/funcs/statistics/permutation.py +++ b/mathgenerator/funcs/statistics/permutation.py @@ -1,4 +1,4 @@ -from ...__init__ import Generator +from ...generator import Generator import random import math diff --git a/mathgenerator/funcs/template.py b/mathgenerator/funcs/template.py index 18217d7..0f020bd 100644 --- a/mathgenerator/funcs/template.py +++ b/mathgenerator/funcs/template.py @@ -1,11 +1,12 @@ -from .__init__ import * +from ...generator import Generator +import random def gen_func(format='string'): if format == 'string': - return problem, solution + return # problem, solution elif format == 'latex': return 'Latex unavailable' diff --git a/mathgenerator/funcs/template_comments.py b/mathgenerator/funcs/template_comments.py index 816b735..a592afe 100644 --- a/mathgenerator/funcs/template_comments.py +++ b/mathgenerator/funcs/template_comments.py @@ -1,4 +1,5 @@ -from .__init__ import * +from ...generator import Generator +import random def gen_func(format='string'): @@ -6,7 +7,7 @@ def gen_func(format='string'): if format == 'string': # code that generates problem, solution strings goes here - return problem, solution + return # problem, solution elif format == 'latex': # code that generates latex representation of problem, and solution goes here # if you can't do this, leave the return 'Latex unavailable' @@ -15,7 +16,7 @@ def gen_func(format='string'): else: # Return necessary variables here # Any variables that go into the problem and solution string without formatting - return a, b + return # a, b # generator_name should be the same as the file name diff --git a/mathgenerator/generator.py b/mathgenerator/generator.py new file mode 100644 index 0000000..2bb2ba1 --- /dev/null +++ b/mathgenerator/generator.py @@ -0,0 +1,31 @@ +from os import sep as SEP +import traceback +import bisect + +genList = [] + + +class Generator: + def __init__(self, title, id, func, kwargs): + self.title = title + self.id = id + self.func = func + self.kwargs = kwargs + + # Gets the path to the file the generator is in + path, _, _, _ = traceback.extract_stack()[-2] + # Gets the name of the file without the extension + funcname = path.split(SEP)[-1].strip()[:-3] + # Gets the name of the subject folder + subjectname = path.split(SEP)[-2].strip() + bisect.insort(genList, [id, title, self, funcname, subjectname, kwargs]) + + def __str__(self): + return str(self.id) + " " + self.title + + def __call__(self, *args, **kwargs): + return self.func(*args, **kwargs) + + +def getGenList(): + return genList diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 1c1b612..cf03402 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -1,10 +1,3 @@ -from .funcs import * -from .__init__ import getGenList - -genList = getGenList() - - -# || Non-generator Functions -def genById(id, *args, **kwargs): - generator = genList[id][2] - return (generator(*args, **kwargs)) +# Present for backwards compatibility <= 1.3.0 +# Enables using `from mathgenerator import mathgen` +from .__init__ import *