diff --git a/makeinit.py b/makeinit.py new file mode 100644 index 0000000..d2c835e --- /dev/null +++ b/makeinit.py @@ -0,0 +1,27 @@ +import os + +def get_filepaths(directory): + """ + This function will generate the file names in a directory + tree by walking the tree either top-down or bottom-up. For each + directory in the tree rooted at directory top (including top itself), + it yields a 3-tuple (dirpath, dirnames, filenames). + """ + file_paths = [] # List which will store all of the full filepaths. + + # Walk the tree. + for root, directories, files in os.walk(directory): + for filename in files: + # Join the two strings in order to form the full filepath. + filepath = os.path.join(root, filename) + filename = filepath[31:-3] + file_paths.append(filename) # Add it to the list. + + return file_paths # Self-explanatory. + +# Run the above function and store its results in a variable. +full_file_paths = get_filepaths("mathgenerator/funcs/statistics") +full_file_paths.sort() +#print(full_file_paths) +for item in full_file_paths: + print("from ." + item + " import *") diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 45ca62f..b4bfb54 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -1,5 +1,11 @@ import sys import traceback + +import random +import sympy +import numpy +import scipy + genList = [] @@ -15,8 +21,10 @@ class Generator: text) = traceback.extract_stack()[-2] funcname = filename[filename.rfind('/'):].strip() funcname = funcname[1:-3] - # print(funcname) - genList.append([id, title, self, funcname]) + groupname = filename[:filename.rfind('/')].strip() + groupname = groupname[groupname.rfind('/'):].strip() + groupname = groupname[1:] + genList.append([id, title, self, funcname, groupname]) def __str__(self): return str( @@ -29,4 +37,6 @@ class Generator: def getGenList(): correctedList = genList[-1:] + genList[:-1] + # Orders list by id + correctedList.sort() return correctedList diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 0fd5976..f09884d 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -4,116 +4,10 @@ import fractions from ..__init__ import * -from .addition import * -from .subtraction import * -from .multiplication import * -from .division import * -from .binary_complement_1s import * -from .modulo_division import * -from .square_root import * -from .power_rule_differentiation import * -from .square import * -from .lcm import * -from .gcd import * -from .basic_algebra import * -from .log import * -from .complex_division import * -from .decimal_to_binary import * -from .binary_to_decimal import * -from .divide_fractions import * -from .multiply_int_to_22_matrix import * -from .area_of_triangle import * -from .valid_triangle import * -from .midpoint_of_two_points import * -from .factoring import * -from .third_angle_of_triangle import * -from .system_of_equations import * -from .distance_two_points import * -from .pythagorean_theorem import * -from .linear_equations import * -from .prime_factors import * -from .fraction_multiplication import * -from .angle_regular_polygon import * -from .combinations import * -from .factorial import * -from .surface_area_cube import * -from .surface_area_cuboid import * -from .surface_area_cylinder import * -from .volume_cube import * -from .volume_cuboid import * -from .volume_cylinder import * -from .surface_area_cone import * -from .volume_cone import * -from .common_factors import * -from .intersection_of_two_lines import * -from .permutation import * -from .vector_cross import * -from .compare_fractions import * -from .simple_interest import * -from .matrix_multiplication import * -from .cube_root import * -from .power_rule_integration import * -from .fourth_angle_of_quadrilateral import * -from .quadratic_equation import * -from .hcf import * -from .dice_sum_probability import * -from .exponentiation import * -from .confidence_interval import * -from .surds_comparison import * -from .fibonacci_series import * -from .basic_trigonometry import * -from .sum_of_polygon_angles import * -from .data_summary import * -from .surface_area_sphere import * -from .volume_sphere import * -from .nth_fibonacci_number import * -from .profit_loss_percent import * -from .binary_to_hex import * -from .multiply_complex_numbers import * -from .geometric_progression import * -from .geometric_mean import * -from .harmonic_mean import * -from .euclidian_norm import * -from .angle_btw_vectors import * -from .absolute_difference import * -from .vector_dot import * -from .binary_2s_complement import * -from .invert_matrix import * -from .sector_area import * -from .mean_median import * -from .int_matrix_22_determinant import * -from .compound_interest import * -from .decimal_to_hexadeci import * -from .percentage import * -from .celsius_to_fahrenheit import * -from .arithmetic_progression_term import * -from .arithmetic_progression_sum import * -from .decimal_to_octal import * -from .decimal_to_roman_numerals import * -from .degree_to_rad import * -from .radian_to_deg import * -from .differentiation import * -from .definite_integral import * -from .is_prime import * -from .bcd_to_decimal import * -from .complex_to_polar import * -from .set_operation import * -from .base_conversion import * -from .curved_surface_area_cylinder import * -from .perimeter_of_polygons import * -from .power_of_powers import * -from .quotient_of_power_same_base import * -from .quotient_of_power_same_power import * -from .complex_quadratic import * -from .is_leap_year import * -from .minutes_to_hours import * -from .decimal_to_bcd import * -from .circumference import * -from .combine_like_terms import * -from .signum_function import * -from .conditional_probability import * -from .arc_length import * -from .binomial_distribution import * -from .stationary_points import * -from .expanding import * -from .area_of_circle import * +from .algebra import * +from .basic_math import * +from .calculus import * +from .computer_science import * +from .geometry import * +from .misc import * +from .statistics import * diff --git a/mathgenerator/funcs/algebra/__init__.py b/mathgenerator/funcs/algebra/__init__.py new file mode 100644 index 0000000..2cb11ca --- /dev/null +++ b/mathgenerator/funcs/algebra/__init__.py @@ -0,0 +1,23 @@ +from ...__init__ import * + +from .basic_algebra import * +from .combine_like_terms import * +from .complex_quadratic import * +from .compound_interest import * +from .distance_two_points import * +from .expanding import * +from .factoring import * +from .int_matrix_22_determinant import * +from .intersection_of_two_lines import * +from .invert_matrix import * +from .linear_equations import * +from .log import * +from .matrix_multiplication import * +from .midpoint_of_two_points import * +from .multiply_complex_numbers import * +from .multiply_int_to_22_matrix import * +from .quadratic_equation import * +from .simple_interest import * +from .system_of_equations import * +from .vector_cross import * +from .vector_dot import * diff --git a/mathgenerator/funcs/basic_algebra.py b/mathgenerator/funcs/algebra/basic_algebra.py similarity index 100% rename from mathgenerator/funcs/basic_algebra.py rename to mathgenerator/funcs/algebra/basic_algebra.py diff --git a/mathgenerator/funcs/combine_like_terms.py b/mathgenerator/funcs/algebra/combine_like_terms.py similarity index 100% rename from mathgenerator/funcs/combine_like_terms.py rename to mathgenerator/funcs/algebra/combine_like_terms.py diff --git a/mathgenerator/funcs/complex_quadratic.py b/mathgenerator/funcs/algebra/complex_quadratic.py similarity index 100% rename from mathgenerator/funcs/complex_quadratic.py rename to mathgenerator/funcs/algebra/complex_quadratic.py diff --git a/mathgenerator/funcs/compound_interest.py b/mathgenerator/funcs/algebra/compound_interest.py similarity index 100% rename from mathgenerator/funcs/compound_interest.py rename to mathgenerator/funcs/algebra/compound_interest.py diff --git a/mathgenerator/funcs/distance_two_points.py b/mathgenerator/funcs/algebra/distance_two_points.py similarity index 100% rename from mathgenerator/funcs/distance_two_points.py rename to mathgenerator/funcs/algebra/distance_two_points.py diff --git a/mathgenerator/funcs/expanding.py b/mathgenerator/funcs/algebra/expanding.py similarity index 100% rename from mathgenerator/funcs/expanding.py rename to mathgenerator/funcs/algebra/expanding.py diff --git a/mathgenerator/funcs/factoring.py b/mathgenerator/funcs/algebra/factoring.py similarity index 100% rename from mathgenerator/funcs/factoring.py rename to mathgenerator/funcs/algebra/factoring.py diff --git a/mathgenerator/funcs/int_matrix_22_determinant.py b/mathgenerator/funcs/algebra/int_matrix_22_determinant.py similarity index 100% rename from mathgenerator/funcs/int_matrix_22_determinant.py rename to mathgenerator/funcs/algebra/int_matrix_22_determinant.py diff --git a/mathgenerator/funcs/intersection_of_two_lines.py b/mathgenerator/funcs/algebra/intersection_of_two_lines.py similarity index 100% rename from mathgenerator/funcs/intersection_of_two_lines.py rename to mathgenerator/funcs/algebra/intersection_of_two_lines.py diff --git a/mathgenerator/funcs/invert_matrix.py b/mathgenerator/funcs/algebra/invert_matrix.py similarity index 100% rename from mathgenerator/funcs/invert_matrix.py rename to mathgenerator/funcs/algebra/invert_matrix.py diff --git a/mathgenerator/funcs/linear_equations.py b/mathgenerator/funcs/algebra/linear_equations.py similarity index 100% rename from mathgenerator/funcs/linear_equations.py rename to mathgenerator/funcs/algebra/linear_equations.py diff --git a/mathgenerator/funcs/log.py b/mathgenerator/funcs/algebra/log.py similarity index 100% rename from mathgenerator/funcs/log.py rename to mathgenerator/funcs/algebra/log.py diff --git a/mathgenerator/funcs/matrix_multiplication.py b/mathgenerator/funcs/algebra/matrix_multiplication.py similarity index 100% rename from mathgenerator/funcs/matrix_multiplication.py rename to mathgenerator/funcs/algebra/matrix_multiplication.py diff --git a/mathgenerator/funcs/midpoint_of_two_points.py b/mathgenerator/funcs/algebra/midpoint_of_two_points.py similarity index 100% rename from mathgenerator/funcs/midpoint_of_two_points.py rename to mathgenerator/funcs/algebra/midpoint_of_two_points.py diff --git a/mathgenerator/funcs/multiply_complex_numbers.py b/mathgenerator/funcs/algebra/multiply_complex_numbers.py similarity index 100% rename from mathgenerator/funcs/multiply_complex_numbers.py rename to mathgenerator/funcs/algebra/multiply_complex_numbers.py diff --git a/mathgenerator/funcs/multiply_int_to_22_matrix.py b/mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py similarity index 100% rename from mathgenerator/funcs/multiply_int_to_22_matrix.py rename to mathgenerator/funcs/algebra/multiply_int_to_22_matrix.py diff --git a/mathgenerator/funcs/quadratic_equation.py b/mathgenerator/funcs/algebra/quadratic_equation.py similarity index 100% rename from mathgenerator/funcs/quadratic_equation.py rename to mathgenerator/funcs/algebra/quadratic_equation.py diff --git a/mathgenerator/funcs/simple_interest.py b/mathgenerator/funcs/algebra/simple_interest.py similarity index 100% rename from mathgenerator/funcs/simple_interest.py rename to mathgenerator/funcs/algebra/simple_interest.py diff --git a/mathgenerator/funcs/system_of_equations.py b/mathgenerator/funcs/algebra/system_of_equations.py similarity index 100% rename from mathgenerator/funcs/system_of_equations.py rename to mathgenerator/funcs/algebra/system_of_equations.py diff --git a/mathgenerator/funcs/vector_cross.py b/mathgenerator/funcs/algebra/vector_cross.py similarity index 100% rename from mathgenerator/funcs/vector_cross.py rename to mathgenerator/funcs/algebra/vector_cross.py diff --git a/mathgenerator/funcs/vector_dot.py b/mathgenerator/funcs/algebra/vector_dot.py similarity index 100% rename from mathgenerator/funcs/vector_dot.py rename to mathgenerator/funcs/algebra/vector_dot.py diff --git a/mathgenerator/funcs/basic_math/__init__.py b/mathgenerator/funcs/basic_math/__init__.py new file mode 100644 index 0000000..8e1a708 --- /dev/null +++ b/mathgenerator/funcs/basic_math/__init__.py @@ -0,0 +1,19 @@ +from ...__init__ import * + +from .absolute_difference import * +from .addition import * +from .compare_fractions import * +from .complex_division import * +from .cube_root import * +from .divide_fractions import * +from .division import * +from .exponentiation import * +from .factorial import * +from .fraction_multiplication import * +from .is_prime import * +from .multiplication import * +from .percentage import * +from .power_of_powers import * +from .square import * +from .square_root import * +from .subtraction import * diff --git a/mathgenerator/funcs/absolute_difference.py b/mathgenerator/funcs/basic_math/absolute_difference.py similarity index 100% rename from mathgenerator/funcs/absolute_difference.py rename to mathgenerator/funcs/basic_math/absolute_difference.py diff --git a/mathgenerator/funcs/addition.py b/mathgenerator/funcs/basic_math/addition.py similarity index 100% rename from mathgenerator/funcs/addition.py rename to mathgenerator/funcs/basic_math/addition.py diff --git a/mathgenerator/funcs/compare_fractions.py b/mathgenerator/funcs/basic_math/compare_fractions.py similarity index 100% rename from mathgenerator/funcs/compare_fractions.py rename to mathgenerator/funcs/basic_math/compare_fractions.py diff --git a/mathgenerator/funcs/complex_division.py b/mathgenerator/funcs/basic_math/complex_division.py similarity index 100% rename from mathgenerator/funcs/complex_division.py rename to mathgenerator/funcs/basic_math/complex_division.py diff --git a/mathgenerator/funcs/cube_root.py b/mathgenerator/funcs/basic_math/cube_root.py similarity index 100% rename from mathgenerator/funcs/cube_root.py rename to mathgenerator/funcs/basic_math/cube_root.py diff --git a/mathgenerator/funcs/divide_fractions.py b/mathgenerator/funcs/basic_math/divide_fractions.py similarity index 100% rename from mathgenerator/funcs/divide_fractions.py rename to mathgenerator/funcs/basic_math/divide_fractions.py diff --git a/mathgenerator/funcs/division.py b/mathgenerator/funcs/basic_math/division.py similarity index 100% rename from mathgenerator/funcs/division.py rename to mathgenerator/funcs/basic_math/division.py diff --git a/mathgenerator/funcs/exponentiation.py b/mathgenerator/funcs/basic_math/exponentiation.py similarity index 100% rename from mathgenerator/funcs/exponentiation.py rename to mathgenerator/funcs/basic_math/exponentiation.py diff --git a/mathgenerator/funcs/factorial.py b/mathgenerator/funcs/basic_math/factorial.py similarity index 100% rename from mathgenerator/funcs/factorial.py rename to mathgenerator/funcs/basic_math/factorial.py diff --git a/mathgenerator/funcs/fraction_multiplication.py b/mathgenerator/funcs/basic_math/fraction_multiplication.py similarity index 100% rename from mathgenerator/funcs/fraction_multiplication.py rename to mathgenerator/funcs/basic_math/fraction_multiplication.py diff --git a/mathgenerator/funcs/is_prime.py b/mathgenerator/funcs/basic_math/is_prime.py similarity index 100% rename from mathgenerator/funcs/is_prime.py rename to mathgenerator/funcs/basic_math/is_prime.py diff --git a/mathgenerator/funcs/multiplication.py b/mathgenerator/funcs/basic_math/multiplication.py similarity index 100% rename from mathgenerator/funcs/multiplication.py rename to mathgenerator/funcs/basic_math/multiplication.py diff --git a/mathgenerator/funcs/percentage.py b/mathgenerator/funcs/basic_math/percentage.py similarity index 100% rename from mathgenerator/funcs/percentage.py rename to mathgenerator/funcs/basic_math/percentage.py diff --git a/mathgenerator/funcs/power_of_powers.py b/mathgenerator/funcs/basic_math/power_of_powers.py similarity index 100% rename from mathgenerator/funcs/power_of_powers.py rename to mathgenerator/funcs/basic_math/power_of_powers.py diff --git a/mathgenerator/funcs/square.py b/mathgenerator/funcs/basic_math/square.py similarity index 100% rename from mathgenerator/funcs/square.py rename to mathgenerator/funcs/basic_math/square.py diff --git a/mathgenerator/funcs/square_root.py b/mathgenerator/funcs/basic_math/square_root.py similarity index 100% rename from mathgenerator/funcs/square_root.py rename to mathgenerator/funcs/basic_math/square_root.py diff --git a/mathgenerator/funcs/subtraction.py b/mathgenerator/funcs/basic_math/subtraction.py similarity index 100% rename from mathgenerator/funcs/subtraction.py rename to mathgenerator/funcs/basic_math/subtraction.py diff --git a/mathgenerator/funcs/calculus/__init__.py b/mathgenerator/funcs/calculus/__init__.py new file mode 100644 index 0000000..cc9b474 --- /dev/null +++ b/mathgenerator/funcs/calculus/__init__.py @@ -0,0 +1,7 @@ +from ...__init__ import * + +from .definite_integral import * +from .differentiation import * +from .power_rule_differentiation import * +from .power_rule_integration import * +from .stationary_points import * diff --git a/mathgenerator/funcs/definite_integral.py b/mathgenerator/funcs/calculus/definite_integral.py similarity index 100% rename from mathgenerator/funcs/definite_integral.py rename to mathgenerator/funcs/calculus/definite_integral.py diff --git a/mathgenerator/funcs/differentiation.py b/mathgenerator/funcs/calculus/differentiation.py similarity index 100% rename from mathgenerator/funcs/differentiation.py rename to mathgenerator/funcs/calculus/differentiation.py diff --git a/mathgenerator/funcs/power_rule_differentiation.py b/mathgenerator/funcs/calculus/power_rule_differentiation.py similarity index 100% rename from mathgenerator/funcs/power_rule_differentiation.py rename to mathgenerator/funcs/calculus/power_rule_differentiation.py diff --git a/mathgenerator/funcs/power_rule_integration.py b/mathgenerator/funcs/calculus/power_rule_integration.py similarity index 100% rename from mathgenerator/funcs/power_rule_integration.py rename to mathgenerator/funcs/calculus/power_rule_integration.py diff --git a/mathgenerator/funcs/stationary_points.py b/mathgenerator/funcs/calculus/stationary_points.py similarity index 100% rename from mathgenerator/funcs/stationary_points.py rename to mathgenerator/funcs/calculus/stationary_points.py diff --git a/mathgenerator/funcs/computer_science/__init__.py b/mathgenerator/funcs/computer_science/__init__.py new file mode 100644 index 0000000..f902c5f --- /dev/null +++ b/mathgenerator/funcs/computer_science/__init__.py @@ -0,0 +1,14 @@ +from ...__init__ import * + +from .bcd_to_decimal import * +from .binary_2s_complement import * +from .binary_complement_1s import * +from .binary_to_decimal import * +from .binary_to_hex import * +from .decimal_to_bcd import * +from .decimal_to_binary import * +from .decimal_to_hexadeci import * +from .decimal_to_octal import * +from .fibonacci_series import * +from .modulo_division import * +from .nth_fibonacci_number import * diff --git a/mathgenerator/funcs/bcd_to_decimal.py b/mathgenerator/funcs/computer_science/bcd_to_decimal.py similarity index 100% rename from mathgenerator/funcs/bcd_to_decimal.py rename to mathgenerator/funcs/computer_science/bcd_to_decimal.py diff --git a/mathgenerator/funcs/binary_2s_complement.py b/mathgenerator/funcs/computer_science/binary_2s_complement.py similarity index 100% rename from mathgenerator/funcs/binary_2s_complement.py rename to mathgenerator/funcs/computer_science/binary_2s_complement.py diff --git a/mathgenerator/funcs/binary_complement_1s.py b/mathgenerator/funcs/computer_science/binary_complement_1s.py similarity index 100% rename from mathgenerator/funcs/binary_complement_1s.py rename to mathgenerator/funcs/computer_science/binary_complement_1s.py diff --git a/mathgenerator/funcs/binary_to_decimal.py b/mathgenerator/funcs/computer_science/binary_to_decimal.py similarity index 100% rename from mathgenerator/funcs/binary_to_decimal.py rename to mathgenerator/funcs/computer_science/binary_to_decimal.py diff --git a/mathgenerator/funcs/binary_to_hex.py b/mathgenerator/funcs/computer_science/binary_to_hex.py similarity index 100% rename from mathgenerator/funcs/binary_to_hex.py rename to mathgenerator/funcs/computer_science/binary_to_hex.py diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/computer_science/decimal_to_bcd.py similarity index 100% rename from mathgenerator/funcs/decimal_to_bcd.py rename to mathgenerator/funcs/computer_science/decimal_to_bcd.py diff --git a/mathgenerator/funcs/decimal_to_binary.py b/mathgenerator/funcs/computer_science/decimal_to_binary.py similarity index 100% rename from mathgenerator/funcs/decimal_to_binary.py rename to mathgenerator/funcs/computer_science/decimal_to_binary.py diff --git a/mathgenerator/funcs/decimal_to_hexadeci.py b/mathgenerator/funcs/computer_science/decimal_to_hexadeci.py similarity index 100% rename from mathgenerator/funcs/decimal_to_hexadeci.py rename to mathgenerator/funcs/computer_science/decimal_to_hexadeci.py diff --git a/mathgenerator/funcs/decimal_to_octal.py b/mathgenerator/funcs/computer_science/decimal_to_octal.py similarity index 100% rename from mathgenerator/funcs/decimal_to_octal.py rename to mathgenerator/funcs/computer_science/decimal_to_octal.py diff --git a/mathgenerator/funcs/fibonacci_series.py b/mathgenerator/funcs/computer_science/fibonacci_series.py similarity index 100% rename from mathgenerator/funcs/fibonacci_series.py rename to mathgenerator/funcs/computer_science/fibonacci_series.py diff --git a/mathgenerator/funcs/modulo_division.py b/mathgenerator/funcs/computer_science/modulo_division.py similarity index 100% rename from mathgenerator/funcs/modulo_division.py rename to mathgenerator/funcs/computer_science/modulo_division.py diff --git a/mathgenerator/funcs/nth_fibonacci_number.py b/mathgenerator/funcs/computer_science/nth_fibonacci_number.py similarity index 100% rename from mathgenerator/funcs/nth_fibonacci_number.py rename to mathgenerator/funcs/computer_science/nth_fibonacci_number.py diff --git a/mathgenerator/funcs/geometry/__init__.py b/mathgenerator/funcs/geometry/__init__.py new file mode 100644 index 0000000..efd712e --- /dev/null +++ b/mathgenerator/funcs/geometry/__init__.py @@ -0,0 +1,29 @@ +from ...__init__ import * + +from .angle_btw_vectors import * +from .angle_regular_polygon import * +from .arc_length import * +from .area_of_circle import * +from .area_of_triangle import * +from .basic_trigonometry import * +from .circumference import * +from .curved_surface_area_cylinder import * +from .degree_to_rad import * +from .fourth_angle_of_quadrilateral import * +from .perimeter_of_polygons import * +from .pythagorean_theorem import * +from .radian_to_deg import * +from .sector_area import * +from .sum_of_polygon_angles import * +from .surface_area_cone import * +from .surface_area_cube import * +from .surface_area_cuboid import * +from .surface_area_cylinder import * +from .surface_area_sphere import * +from .third_angle_of_triangle import * +from .valid_triangle import * +from .volume_cone import * +from .volume_cube import * +from .volume_cuboid import * +from .volume_cylinder import * +from .volume_sphere import * diff --git a/mathgenerator/funcs/angle_btw_vectors.py b/mathgenerator/funcs/geometry/angle_btw_vectors.py similarity index 100% rename from mathgenerator/funcs/angle_btw_vectors.py rename to mathgenerator/funcs/geometry/angle_btw_vectors.py diff --git a/mathgenerator/funcs/angle_regular_polygon.py b/mathgenerator/funcs/geometry/angle_regular_polygon.py similarity index 100% rename from mathgenerator/funcs/angle_regular_polygon.py rename to mathgenerator/funcs/geometry/angle_regular_polygon.py diff --git a/mathgenerator/funcs/arc_length.py b/mathgenerator/funcs/geometry/arc_length.py similarity index 100% rename from mathgenerator/funcs/arc_length.py rename to mathgenerator/funcs/geometry/arc_length.py diff --git a/mathgenerator/funcs/area_of_circle.py b/mathgenerator/funcs/geometry/area_of_circle.py similarity index 100% rename from mathgenerator/funcs/area_of_circle.py rename to mathgenerator/funcs/geometry/area_of_circle.py diff --git a/mathgenerator/funcs/area_of_triangle.py b/mathgenerator/funcs/geometry/area_of_triangle.py similarity index 100% rename from mathgenerator/funcs/area_of_triangle.py rename to mathgenerator/funcs/geometry/area_of_triangle.py diff --git a/mathgenerator/funcs/basic_trigonometry.py b/mathgenerator/funcs/geometry/basic_trigonometry.py similarity index 100% rename from mathgenerator/funcs/basic_trigonometry.py rename to mathgenerator/funcs/geometry/basic_trigonometry.py diff --git a/mathgenerator/funcs/circumference.py b/mathgenerator/funcs/geometry/circumference.py similarity index 100% rename from mathgenerator/funcs/circumference.py rename to mathgenerator/funcs/geometry/circumference.py diff --git a/mathgenerator/funcs/curved_surface_area_cylinder.py b/mathgenerator/funcs/geometry/curved_surface_area_cylinder.py similarity index 100% rename from mathgenerator/funcs/curved_surface_area_cylinder.py rename to mathgenerator/funcs/geometry/curved_surface_area_cylinder.py diff --git a/mathgenerator/funcs/degree_to_rad.py b/mathgenerator/funcs/geometry/degree_to_rad.py similarity index 100% rename from mathgenerator/funcs/degree_to_rad.py rename to mathgenerator/funcs/geometry/degree_to_rad.py diff --git a/mathgenerator/funcs/fourth_angle_of_quadrilateral.py b/mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py similarity index 100% rename from mathgenerator/funcs/fourth_angle_of_quadrilateral.py rename to mathgenerator/funcs/geometry/fourth_angle_of_quadrilateral.py diff --git a/mathgenerator/funcs/perimeter_of_polygons.py b/mathgenerator/funcs/geometry/perimeter_of_polygons.py similarity index 100% rename from mathgenerator/funcs/perimeter_of_polygons.py rename to mathgenerator/funcs/geometry/perimeter_of_polygons.py diff --git a/mathgenerator/funcs/pythagorean_theorem.py b/mathgenerator/funcs/geometry/pythagorean_theorem.py similarity index 100% rename from mathgenerator/funcs/pythagorean_theorem.py rename to mathgenerator/funcs/geometry/pythagorean_theorem.py diff --git a/mathgenerator/funcs/radian_to_deg.py b/mathgenerator/funcs/geometry/radian_to_deg.py similarity index 100% rename from mathgenerator/funcs/radian_to_deg.py rename to mathgenerator/funcs/geometry/radian_to_deg.py diff --git a/mathgenerator/funcs/sector_area.py b/mathgenerator/funcs/geometry/sector_area.py similarity index 100% rename from mathgenerator/funcs/sector_area.py rename to mathgenerator/funcs/geometry/sector_area.py diff --git a/mathgenerator/funcs/sum_of_polygon_angles.py b/mathgenerator/funcs/geometry/sum_of_polygon_angles.py similarity index 100% rename from mathgenerator/funcs/sum_of_polygon_angles.py rename to mathgenerator/funcs/geometry/sum_of_polygon_angles.py diff --git a/mathgenerator/funcs/surface_area_cone.py b/mathgenerator/funcs/geometry/surface_area_cone.py similarity index 100% rename from mathgenerator/funcs/surface_area_cone.py rename to mathgenerator/funcs/geometry/surface_area_cone.py diff --git a/mathgenerator/funcs/surface_area_cube.py b/mathgenerator/funcs/geometry/surface_area_cube.py similarity index 100% rename from mathgenerator/funcs/surface_area_cube.py rename to mathgenerator/funcs/geometry/surface_area_cube.py diff --git a/mathgenerator/funcs/surface_area_cuboid.py b/mathgenerator/funcs/geometry/surface_area_cuboid.py similarity index 100% rename from mathgenerator/funcs/surface_area_cuboid.py rename to mathgenerator/funcs/geometry/surface_area_cuboid.py diff --git a/mathgenerator/funcs/surface_area_cylinder.py b/mathgenerator/funcs/geometry/surface_area_cylinder.py similarity index 100% rename from mathgenerator/funcs/surface_area_cylinder.py rename to mathgenerator/funcs/geometry/surface_area_cylinder.py diff --git a/mathgenerator/funcs/surface_area_sphere.py b/mathgenerator/funcs/geometry/surface_area_sphere.py similarity index 100% rename from mathgenerator/funcs/surface_area_sphere.py rename to mathgenerator/funcs/geometry/surface_area_sphere.py diff --git a/mathgenerator/funcs/third_angle_of_triangle.py b/mathgenerator/funcs/geometry/third_angle_of_triangle.py similarity index 100% rename from mathgenerator/funcs/third_angle_of_triangle.py rename to mathgenerator/funcs/geometry/third_angle_of_triangle.py diff --git a/mathgenerator/funcs/valid_triangle.py b/mathgenerator/funcs/geometry/valid_triangle.py similarity index 100% rename from mathgenerator/funcs/valid_triangle.py rename to mathgenerator/funcs/geometry/valid_triangle.py diff --git a/mathgenerator/funcs/volume_cone.py b/mathgenerator/funcs/geometry/volume_cone.py similarity index 100% rename from mathgenerator/funcs/volume_cone.py rename to mathgenerator/funcs/geometry/volume_cone.py diff --git a/mathgenerator/funcs/volume_cube.py b/mathgenerator/funcs/geometry/volume_cube.py similarity index 100% rename from mathgenerator/funcs/volume_cube.py rename to mathgenerator/funcs/geometry/volume_cube.py diff --git a/mathgenerator/funcs/volume_cuboid.py b/mathgenerator/funcs/geometry/volume_cuboid.py similarity index 100% rename from mathgenerator/funcs/volume_cuboid.py rename to mathgenerator/funcs/geometry/volume_cuboid.py diff --git a/mathgenerator/funcs/volume_cylinder.py b/mathgenerator/funcs/geometry/volume_cylinder.py similarity index 100% rename from mathgenerator/funcs/volume_cylinder.py rename to mathgenerator/funcs/geometry/volume_cylinder.py diff --git a/mathgenerator/funcs/volume_sphere.py b/mathgenerator/funcs/geometry/volume_sphere.py similarity index 100% rename from mathgenerator/funcs/volume_sphere.py rename to mathgenerator/funcs/geometry/volume_sphere.py diff --git a/mathgenerator/funcs/misc/__init__.py b/mathgenerator/funcs/misc/__init__.py new file mode 100644 index 0000000..ec5fa46 --- /dev/null +++ b/mathgenerator/funcs/misc/__init__.py @@ -0,0 +1,26 @@ +from ...__init__ import * + +from .arithmetic_progression_sum import * +from .arithmetic_progression_term import * +from .base_conversion import * +from .binomial_distribution import * +from .celsius_to_fahrenheit import * +from .common_factors import * +from .complex_to_polar import * +from .decimal_to_roman_numerals import * +from .euclidian_norm import * +from .gcd import * +from .geometric_mean import * +from .geometric_progression import * +from .harmonic_mean import * +from .hcf import * +from .is_leap_year import * +from .lcm import * +from .minutes_to_hours import * +from .prime_factors import * +from .profit_loss_percent import * +from .quotient_of_power_same_base import * +from .quotient_of_power_same_power import * +from .set_operation import * +from .signum_function import * +from .surds_comparison import * diff --git a/mathgenerator/funcs/arithmetic_progression_sum.py b/mathgenerator/funcs/misc/arithmetic_progression_sum.py similarity index 100% rename from mathgenerator/funcs/arithmetic_progression_sum.py rename to mathgenerator/funcs/misc/arithmetic_progression_sum.py diff --git a/mathgenerator/funcs/arithmetic_progression_term.py b/mathgenerator/funcs/misc/arithmetic_progression_term.py similarity index 100% rename from mathgenerator/funcs/arithmetic_progression_term.py rename to mathgenerator/funcs/misc/arithmetic_progression_term.py diff --git a/mathgenerator/funcs/base_conversion.py b/mathgenerator/funcs/misc/base_conversion.py similarity index 100% rename from mathgenerator/funcs/base_conversion.py rename to mathgenerator/funcs/misc/base_conversion.py diff --git a/mathgenerator/funcs/binomial_distribution.py b/mathgenerator/funcs/misc/binomial_distribution.py similarity index 100% rename from mathgenerator/funcs/binomial_distribution.py rename to mathgenerator/funcs/misc/binomial_distribution.py diff --git a/mathgenerator/funcs/celsius_to_fahrenheit.py b/mathgenerator/funcs/misc/celsius_to_fahrenheit.py similarity index 100% rename from mathgenerator/funcs/celsius_to_fahrenheit.py rename to mathgenerator/funcs/misc/celsius_to_fahrenheit.py diff --git a/mathgenerator/funcs/common_factors.py b/mathgenerator/funcs/misc/common_factors.py similarity index 100% rename from mathgenerator/funcs/common_factors.py rename to mathgenerator/funcs/misc/common_factors.py diff --git a/mathgenerator/funcs/complex_to_polar.py b/mathgenerator/funcs/misc/complex_to_polar.py similarity index 100% rename from mathgenerator/funcs/complex_to_polar.py rename to mathgenerator/funcs/misc/complex_to_polar.py diff --git a/mathgenerator/funcs/decimal_to_roman_numerals.py b/mathgenerator/funcs/misc/decimal_to_roman_numerals.py similarity index 100% rename from mathgenerator/funcs/decimal_to_roman_numerals.py rename to mathgenerator/funcs/misc/decimal_to_roman_numerals.py diff --git a/mathgenerator/funcs/euclidian_norm.py b/mathgenerator/funcs/misc/euclidian_norm.py similarity index 100% rename from mathgenerator/funcs/euclidian_norm.py rename to mathgenerator/funcs/misc/euclidian_norm.py diff --git a/mathgenerator/funcs/gcd.py b/mathgenerator/funcs/misc/gcd.py similarity index 100% rename from mathgenerator/funcs/gcd.py rename to mathgenerator/funcs/misc/gcd.py diff --git a/mathgenerator/funcs/geometric_mean.py b/mathgenerator/funcs/misc/geometric_mean.py similarity index 100% rename from mathgenerator/funcs/geometric_mean.py rename to mathgenerator/funcs/misc/geometric_mean.py diff --git a/mathgenerator/funcs/geometric_progression.py b/mathgenerator/funcs/misc/geometric_progression.py similarity index 100% rename from mathgenerator/funcs/geometric_progression.py rename to mathgenerator/funcs/misc/geometric_progression.py diff --git a/mathgenerator/funcs/harmonic_mean.py b/mathgenerator/funcs/misc/harmonic_mean.py similarity index 100% rename from mathgenerator/funcs/harmonic_mean.py rename to mathgenerator/funcs/misc/harmonic_mean.py diff --git a/mathgenerator/funcs/hcf.py b/mathgenerator/funcs/misc/hcf.py similarity index 100% rename from mathgenerator/funcs/hcf.py rename to mathgenerator/funcs/misc/hcf.py diff --git a/mathgenerator/funcs/is_leap_year.py b/mathgenerator/funcs/misc/is_leap_year.py similarity index 100% rename from mathgenerator/funcs/is_leap_year.py rename to mathgenerator/funcs/misc/is_leap_year.py diff --git a/mathgenerator/funcs/lcm.py b/mathgenerator/funcs/misc/lcm.py similarity index 100% rename from mathgenerator/funcs/lcm.py rename to mathgenerator/funcs/misc/lcm.py diff --git a/mathgenerator/funcs/minutes_to_hours.py b/mathgenerator/funcs/misc/minutes_to_hours.py similarity index 100% rename from mathgenerator/funcs/minutes_to_hours.py rename to mathgenerator/funcs/misc/minutes_to_hours.py diff --git a/mathgenerator/funcs/prime_factors.py b/mathgenerator/funcs/misc/prime_factors.py similarity index 100% rename from mathgenerator/funcs/prime_factors.py rename to mathgenerator/funcs/misc/prime_factors.py diff --git a/mathgenerator/funcs/profit_loss_percent.py b/mathgenerator/funcs/misc/profit_loss_percent.py similarity index 100% rename from mathgenerator/funcs/profit_loss_percent.py rename to mathgenerator/funcs/misc/profit_loss_percent.py diff --git a/mathgenerator/funcs/quotient_of_power_same_base.py b/mathgenerator/funcs/misc/quotient_of_power_same_base.py similarity index 100% rename from mathgenerator/funcs/quotient_of_power_same_base.py rename to mathgenerator/funcs/misc/quotient_of_power_same_base.py diff --git a/mathgenerator/funcs/quotient_of_power_same_power.py b/mathgenerator/funcs/misc/quotient_of_power_same_power.py similarity index 100% rename from mathgenerator/funcs/quotient_of_power_same_power.py rename to mathgenerator/funcs/misc/quotient_of_power_same_power.py diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/misc/set_operation.py similarity index 100% rename from mathgenerator/funcs/set_operation.py rename to mathgenerator/funcs/misc/set_operation.py diff --git a/mathgenerator/funcs/signum_function.py b/mathgenerator/funcs/misc/signum_function.py similarity index 100% rename from mathgenerator/funcs/signum_function.py rename to mathgenerator/funcs/misc/signum_function.py diff --git a/mathgenerator/funcs/surds_comparison.py b/mathgenerator/funcs/misc/surds_comparison.py similarity index 100% rename from mathgenerator/funcs/surds_comparison.py rename to mathgenerator/funcs/misc/surds_comparison.py diff --git a/mathgenerator/funcs/statistics/__init__.py b/mathgenerator/funcs/statistics/__init__.py new file mode 100644 index 0000000..84848a9 --- /dev/null +++ b/mathgenerator/funcs/statistics/__init__.py @@ -0,0 +1,9 @@ +from ...__init__ import * + +from .combinations import * +from .conditional_probability import * +from .confidence_interval import * +from .data_summary import * +from .dice_sum_probability import * +from .mean_median import * +from .permutation import * diff --git a/mathgenerator/funcs/combinations.py b/mathgenerator/funcs/statistics/combinations.py similarity index 100% rename from mathgenerator/funcs/combinations.py rename to mathgenerator/funcs/statistics/combinations.py diff --git a/mathgenerator/funcs/conditional_probability.py b/mathgenerator/funcs/statistics/conditional_probability.py similarity index 100% rename from mathgenerator/funcs/conditional_probability.py rename to mathgenerator/funcs/statistics/conditional_probability.py diff --git a/mathgenerator/funcs/confidence_interval.py b/mathgenerator/funcs/statistics/confidence_interval.py similarity index 100% rename from mathgenerator/funcs/confidence_interval.py rename to mathgenerator/funcs/statistics/confidence_interval.py diff --git a/mathgenerator/funcs/data_summary.py b/mathgenerator/funcs/statistics/data_summary.py similarity index 100% rename from mathgenerator/funcs/data_summary.py rename to mathgenerator/funcs/statistics/data_summary.py diff --git a/mathgenerator/funcs/dice_sum_probability.py b/mathgenerator/funcs/statistics/dice_sum_probability.py similarity index 100% rename from mathgenerator/funcs/dice_sum_probability.py rename to mathgenerator/funcs/statistics/dice_sum_probability.py diff --git a/mathgenerator/funcs/mean_median.py b/mathgenerator/funcs/statistics/mean_median.py similarity index 97% rename from mathgenerator/funcs/mean_median.py rename to mathgenerator/funcs/statistics/mean_median.py index 91295c7..85456c8 100644 --- a/mathgenerator/funcs/mean_median.py +++ b/mathgenerator/funcs/statistics/mean_median.py @@ -1,4 +1,5 @@ from .__init__ import * +import random def meanMedianFunc(maxlen=10): diff --git a/mathgenerator/funcs/permutation.py b/mathgenerator/funcs/statistics/permutation.py similarity index 100% rename from mathgenerator/funcs/permutation.py rename to mathgenerator/funcs/statistics/permutation.py diff --git a/test.py b/test.py index 02dd930..2c51d56 100644 --- a/test.py +++ b/test.py @@ -10,7 +10,7 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(111)) +print(mathgen.genById(10)) #Make a pdf with 10 problems of generator id 1 # mathgen.makePdf(0, 10)