mathmaker.lib.core package

Submodules

mathmaker.lib.core.base module

class mathmaker.lib.core.base.Clonable[source]

Bases: object

clone()[source]
class mathmaker.lib.core.base.Drawable[source]

Bases: mathmaker.lib.core.base.NamedObject

eps_filename
euk_filename
into_euk(**options)[source]
into_pic(**options)[source]
name
class mathmaker.lib.core.base.NamedObject[source]

Bases: mathmaker.lib.core.base.Clonable

name
class mathmaker.lib.core.base.Printable[source]

Bases: mathmaker.lib.core.base.NamedObject

into_str(**options)[source]
printed

Shortcut for self.into_str(force_expression_begins=True)

This returns the string of the Printable object, assuming it starts the expression.

mathmaker.lib.core.base_calculus module

class mathmaker.lib.core.base_calculus.AngleItem(raw_value=None, copy_this=None, from_this_angle=None)[source]

Bases: mathmaker.lib.core.base_calculus.Item

Represent Angles’ names, like widehat{ABC} (handled as Items).

into_str(**options)[source]

Return the printed version of the AngleItem.

If the AngleItem is literal, it will be displayed like a literal Item yet wrapped in a ‘wide hat’. If it is not numeric, the unit will be automatically discarded.

class mathmaker.lib.core.base_calculus.BinomialIdentity(arg, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Expandable

a

Gets the ‘a’ term of the BinomialIdentity

b

Gets the ‘b’ term of the BinomialIdentity

expand()[source]
expand_and_reduce_next_step(**options)[source]
get_a()[source]
get_b()[source]
get_kind()[source]
into_str(**options)[source]
kind

kind of BinomialIdentity it, e.g. ‘sum_square’|’difference_square’|’squares_difference’

class mathmaker.lib.core.base_calculus.CommutativeOperation[source]

Bases: mathmaker.lib.core.base_calculus.Operation

append(elt)[source]
compact_display

compact_display field of a CommutativeOperation

contains_a_rounded_number()[source]
contains_exactly(objct)[source]
evaluate(**options)[source]
get_compact_display()[source]
get_first_letter()[source]
get_info()[source]
get_sign()[source]
info

info field of a CommutativeOperation

is_displ_as_a_single_int()[source]
is_displ_as_a_single_neutral(neutral_elt)[source]
is_displ_as_a_single_numeric_Item()[source]
remove(elt)[source]
set_compact_display(arg)[source]
set_info(arg)[source]
set_sign(arg)[source]
throw_away_the_neutrals()[source]
class mathmaker.lib.core.base_calculus.Expandable(arg, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Product

expand(**options)[source]
expand_and_reduce_()[source]
expand_and_reduce_next_step(**options)[source]
is_expandable()[source]
class mathmaker.lib.core.base_calculus.Fraction(arg, ignore_1_denominator=False, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Quotient

calculate_next_step(**options)[source]
completely_reduced()[source]
evaluate(**options)[source]
expand_and_reduce_next_step(**options)[source]
get_same_deno_reduction_in_progress()[source]
get_simplification_in_progress()[source]
get_status()[source]
is_a_decimal_number()[source]
is_reducible()[source]
replace_striked_out()[source]
same_deno_reduction_in_progress

Fraction’s same_deno_reduction_in_progress field

set_down_numerator_s_minus_sign()[source]
set_same_deno_reduction_in_progress(arg)[source]
set_status(arg)[source]
simplification_in_progress

Fraction’s simplification_in_progress status

simplification_line()[source]
simplified()[source]
status

Fraction’s status

class mathmaker.lib.core.base_calculus.Function(copy_this=None, name='f', var= {+x (unit='') ^.1.}, fct=<function Function.<lambda>>, num_val=.1., display_mode='literal', inv_fct=None, unlocked=False)[source]

Bases: mathmaker.lib.core.base_calculus.Item

Represent the image of a number under a function like f(x) or cos(ABC).

argument
calculate_next_step(**options)[source]

Will only swap to numeric argument, no automatic evaluation.

contains_a_rounded_number()[source]

f(...) neither its argument never have any reason to be rounded.

contains_exactly(objct)[source]

True if the looked for object is self.

evaluate(**options)[source]

Return the value of f(number).

expand_and_reduce_next_step(**options)[source]

Same as calculate_ntext_step(), for Functions.

fct

The lambda function to use for evaluation.

get_first_letter()[source]

Return the first letter of Function’s name.

get_iteration_list()[source]

Return [variable, exponent].

get_minus_signs_nb()[source]

1 if Function object has a negative sign and no even exponent, else 0.

image_notation
into_str(**options)[source]

Creates the str version of the Function.

inv_fct

The lambda function to use for evaluation.

is_displ_as_a_single_0()[source]

f(x) is never a single 0.

is_displ_as_a_single_1()[source]

f(x) is never a single 1.

is_displ_as_a_single_int()[source]

f(x) is never a single int.

is_displ_as_a_single_minus_1()[source]

f(x) is never a single -1.

is_displ_as_a_single_neutral(elt)[source]

f(x) is never a single neutral element.

is_displ_as_a_single_numeric_Item()[source]

f(x) is never a single numeric Item (like any single number).

is_expandable()[source]

f(x) is not expandable.

is_literal(displ_as=False) → bool[source]

Return True if Function is to be considered literal.

Parameters:displ_as – if displ_as is True, it’s about knowing whether the object should be considered literal for display, otherwise, it’s about knowing wether it can be numerically evaluated (directly, without replacing its variable by a Value).
is_null()[source]

True if self evaluates to 0.

is_numeric(displ_as=False)[source]

Return True if current display mode is numeric.

Parameters:displ_as – if displ_as is True, it’s about knowing whether the object should be considered numeric for display, otherwise, it’s about knowing wether it can be numerically evaluated (directly, without replacing its variable by a Value).
multiply_symbol_is_required(objct, position)[source]

True if × is required between self and next objct in a Product.

num_val
requires_brackets(position)[source]

True if Function requires brackets inside a Product.

requires_inner_brackets()[source]

Return True for cases like (-f(x))^2

set_literal_mode()[source]

Set the display mode to ‘literal’.

set_numeric_mode()[source]

Set the display mode to ‘numeric’.

substitute(subst_dict)[source]

Substitute the argument by its value, if available in subst_dict.

unlocked
var
class mathmaker.lib.core.base_calculus.Item(arg, **options)[source]

Bases: mathmaker.lib.core.root_calculus.Exponented

calculate_next_step(**options)[source]
contains_a_rounded_number()[source]
contains_exactly(objct)[source]
digits_number()[source]
evaluate(**options)[source]
expand_and_reduce_next_step(**options)[source]
force_display_sign_once

Item’s force_display_sign_once field

get_first_letter()[source]
get_force_display_sign_once()[source]
get_is_out_striked()[source]
get_iteration_list()[source]
get_minus_signs_nb()[source]
get_raw_value()[source]
get_unit()[source]
get_value_inside()[source]
into_str(**options)[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_int()[source]
is_displ_as_a_single_minus_1()[source]
is_displ_as_a_single_neutral(elt)[source]
is_displ_as_a_single_numeric_Item()[source]
is_expandable()[source]
is_literal(displ_as=False) → bool[source]

Return True if Item is to be considered literal.

Parameters:displ_as – not applicable to Items
is_null()[source]
is_numeric(displ_as=False)[source]
is_out_striked

Item’s is_out_striked field

multiply_symbol_is_required(objct, position)[source]
needs_to_get_rounded(precision)[source]
raw_value

Item’s raw value

requires_brackets(position)[source]
requires_inner_brackets()[source]
round(precision)[source]
set_force_display_sign_once(arg)[source]
set_is_out_striked(arg)[source]
set_unit(arg)[source]
set_value_inside(arg)[source]
turn_into_fraction()[source]
unit

Unit of the Item

value_inside

Item’s Value

class mathmaker.lib.core.base_calculus.Monomial(arg, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Product

coeff

Monomial’s coefficient

degree

Monomial’s degree

get_coeff()[source]
get_degree()[source]
get_first_letter()[source]
get_raw_value()[source]
get_sign()[source]
get_value_inside()[source]
is_negative()[source]
is_null()[source]
is_numeric(displ_as=False)[source]
is_positive()[source]
letter

Monomial’s letter

raw_value

0-degree-Monomial’s value

set_coeff(arg)[source]
set_degree(arg)[source]
set_letter(letter)[source]
sign

Monomial’s sign

value_inside

0-degree Monomial’s Value inside

class mathmaker.lib.core.base_calculus.Operation[source]

Bases: mathmaker.lib.core.root_calculus.Exponented

element

element field of Operation

get_element()[source]
get_iteration_list()[source]
get_neutral()[source]
get_symbol()[source]
is_expandable()[source]
is_literal(displ_as=False) → bool[source]

Return True if Operation is to be considered literal.

Parameters:displ_as – not applicable to Operations
is_numeric(displ_as=False)[source]
neutral

neutral field of Operation

operator(arg1, arg2)[source]
reset_element()[source]
set_element(n, arg)[source]
set_symbol(arg)[source]
symbol

symbol field of Operation

class mathmaker.lib.core.base_calculus.Polynomial(arg)[source]

Bases: mathmaker.lib.core.base_calculus.Sum

degree

Real degree of the Polynomial

get_degree()[source]
get_max_degree()[source]
class mathmaker.lib.core.base_calculus.Product(arg)[source]

Bases: mathmaker.lib.core.base_calculus.CommutativeOperation

calculate_next_step(**options)[source]
expand_and_reduce_next_step(**options)[source]
factor

To access the factors of the Product.

get_factors_list(given_kind)[source]
get_factors_list_except(objct)[source]
get_first_factor()[source]
get_minus_signs_nb()[source]
into_str(**options)[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_minus_1()[source]
is_null()[source]
is_reducible()[source]
multiply_symbol_is_required(objct, position)[source]
operator(arg1, arg2)[source]
order()[source]
reduce_()[source]
requires_brackets(position)[source]
requires_inner_brackets()[source]
set_factor(n, arg)[source]
class mathmaker.lib.core.base_calculus.Quotient(arg, ignore_1_denominator=False, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Operation

calculate_next_step(**options)[source]
contains_a_rounded_number()[source]
contains_exactly(objct)[source]
denominator

denominator field of Quotient

evaluate(**options)[source]
expand_and_reduce_next_step(**options)[source]

If possible, expands Quotient’s numerator and/or denominator.

get_denominator()[source]
get_iteration_list()[source]
get_minus_signs_nb()[source]
get_numerator()[source]
get_sign()[source]
into_str(**options)[source]
invert()[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_int()[source]
is_displ_as_a_single_minus_1()[source]
is_displ_as_a_single_neutral(elt)[source]
is_displ_as_a_single_numeric_Item()[source]
is_null()[source]
multiply_symbol_is_required(objct, position)[source]
numerator

numerator field of Quotient

operator(arg1, arg2)[source]
requires_brackets(position)[source]
requires_inner_brackets()[source]
set_denominator(arg)[source]
set_numerator(arg)[source]
class mathmaker.lib.core.base_calculus.SquareRoot(arg, **options)[source]

Bases: mathmaker.lib.core.base_calculus.Function

calculate_next_step(**options)[source]
contains_a_rounded_number()[source]
contains_exactly(objct)[source]
expand_and_reduce_next_step(**options)[source]
force_display_sign_once

Item’s force_display_sign_once field

get_force_display_sign_once()[source]
get_iteration_list()[source]
get_minus_signs_nb()[source]
into_str(**options)[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_int()[source]
is_displ_as_a_single_minus_1()[source]
is_displ_as_a_single_neutral(elt)[source]
is_displ_as_a_single_numeric_Item()[source]
is_expandable()[source]
is_literal(displ_as=False)[source]

Return True if SquareRoot is to be considered literal.

Parameters:displ_as – not applicable to SquareRoots
is_null()[source]
is_numeric(displ_as=False)[source]
multiply_symbol_is_required(objct, position)[source]
requires_brackets(position)[source]
requires_inner_brackets()[source]
set_force_display_sign_once(arg)[source]
turn_into_fraction()[source]
class mathmaker.lib.core.base_calculus.Sum(arg)[source]

Bases: mathmaker.lib.core.base_calculus.CommutativeOperation

calculate_next_step(**options)[source]
expand_and_reduce_next_step(**options)[source]
force_inner_brackets_display

force_inner_brackets_display field of a Sum

get_force_inner_brackets_display()[source]
get_literal_terms()[source]
get_minus_signs_nb()[source]
get_numeric_terms()[source]
get_terms_lexicon()[source]
intermediate_reduction_line()[source]
into_str(**options)[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_minus_1()[source]
is_null()[source]
is_reducible()[source]
multiply_symbol_is_required(objct, position)[source]
next_displayable_term_nb(position)[source]
numeric_terms_require_to_be_reduced()[source]
operator(arg1, arg2)[source]
reduce_()[source]
requires_brackets(position)[source]
requires_inner_brackets()[source]
set_force_inner_brackets_display(arg)[source]
set_term(n, arg)[source]
term

To access the terms of the Sum.

mathmaker.lib.core.base_geometry module

class mathmaker.lib.core.base_geometry.Angle(arg, **options)[source]

Bases: mathmaker.lib.core.base.Drawable, mathmaker.lib.core.base.Printable

into_str(**options)[source]
label
label_display_angle
mark
measure
points
vertex
class mathmaker.lib.core.base_geometry.Point(arg, **options)[source]

Bases: mathmaker.lib.core.base.Drawable

name
rotate(center, angle, **options)[source]
x
x_exact
y
y_exact
class mathmaker.lib.core.base_geometry.Ray(arg, **options)[source]

Bases: mathmaker.lib.core.base.Drawable

class mathmaker.lib.core.base_geometry.Segment(arg, **options)[source]

Bases: mathmaker.lib.core.base.Drawable

invert_length_name()[source]

Swap points’ names in the length name. E.g. AB becomes BA.

label

Label of the Segment (the displayed information).

label_into_euk()[source]

Return the label correctly positionned along the Segment.

length

Fake length of the Segment (the one used in a problem).

length_has_been_set

Whether the (fake) length has been set or not.

length_name

Length’s name of the Segment, like AB.

mark
points
real_length

Real length (build length) of the Segment.

setup_label(flag)[source]
class mathmaker.lib.core.base_geometry.Vector(arg, **options)[source]

Bases: mathmaker.lib.core.base_geometry.Point

bisector_vector(arg)[source]

Return a vector colinear to the bisector of self and another vector.

Parameters:arg (Vector) – the other vector
norm

Return the norm of self.

orthogonal_unit_vector(clockwise=True)[source]

Return a unit vector that’s (default clockwise) orthogonal to self.

If clockwise is set to False, then the anti-clockwise orthogonal vector is returned.

slope

Return the slope of self.

unit_vector()[source]

Return the unit vector built from self

mathmaker.lib.core.calculus module

class mathmaker.lib.core.calculus.ComposedCalculable[source]

Bases: mathmaker.lib.core.base.Printable

class mathmaker.lib.core.calculus.CrossProductEquation(arg)[source]

Bases: mathmaker.lib.core.calculus.Equation

get_variable_obj()[source]
get_variable_position()[source]
solve_next_step(**options)[source]
variable_obj

Variable object of the Equation

variable_position

Variable position in the Equation

class mathmaker.lib.core.calculus.Equality(objcts, subst_dict=None, **options)[source]

Bases: mathmaker.lib.core.calculus.ComposedCalculable, mathmaker.lib.core.root_calculus.Substitutable

content

The content to be substituted (list containing literal objects).

elements

Elements of the object

equal_signs

Equal signs of the object

get_elements()[source]
get_equal_signs()[source]
into_str(**options)[source]
class mathmaker.lib.core.calculus.Equation(arg, **options)[source]

Bases: mathmaker.lib.core.calculus.ComposedCalculable

auto_resolution(**options)[source]
get_left_hand_side()[source]
get_number()[source]
get_right_hand_side()[source]
get_variable_letter()[source]
into_str(**options)[source]
left_hand_side

Left hand side of the Equation

name
number

Number of the Equation

right_hand_side

Right hand side of the Equation

set_hand_side(left_or_right, arg)[source]
set_number(arg)[source]
solve_next_step(**options)[source]
variable_letter

Variable letter of the Equation

class mathmaker.lib.core.calculus.Expression(integer_or_letter, objct)[source]

Bases: mathmaker.lib.core.calculus.ComposedCalculable

auto_expansion_and_reduction(**options)[source]
get_right_hand_side()[source]
into_str(**options)[source]
right_hand_side

Right hand side of the object

set_right_hand_side(arg)[source]
class mathmaker.lib.core.calculus.QuotientsEquality(arg, displ_as_qe=True, ignore_1_denos=True, subst_dict=None)[source]

Bases: mathmaker.lib.core.calculus.Table

A shortcut to create Tables as quotients equalities.

class mathmaker.lib.core.calculus.Table(arg, displ_as_qe=False, ignore_1_denos=None, subst_dict=None)[source]

Bases: mathmaker.lib.core.base.Printable, mathmaker.lib.core.root_calculus.Substitutable

class SubstitutableList(*args, subst_dict=None)[source]

Bases: list, mathmaker.lib.core.root_calculus.Substitutable

A list that can call substitute() on its elements.

content

The content to be substituted (list containing literal objects).

Table.auto_resolution(col0=0, col1=1, subst_dict=None, **options)[source]
Table.cell

t.cell is the complete Table t.cell[i][j] is a cell

Table.content
Table.cross_product(col, x_position, remove_1_deno=True, **options)[source]
Table.displ_as_qe
Table.get_cell()[source]
Table.ignore_1_denos
Table.into_crossproduct_equation(col0=0, col1=1) → mathmaker.lib.core.calculus.CrossProductEquation[source]

Create a CrossProductEquation from two columns.

Ensure there is only one literal among the four cells before using it.

Parameters:
  • col0 – the number of the first column to use
  • col1 – the number of the second column to use
Table.into_str(as_a_quotients_equality=None, ignore_1_denos=None, **options)[source]
Table.is_numeric(displ_as=False)[source]
class mathmaker.lib.core.calculus.Table_UP(coeff, first_line, info, displ_as_qe=False)[source]

Bases: mathmaker.lib.core.calculus.Table

coeff

the coefficient of the Table_UP

crossproducts_info

infos about the cross products

get_coeff()[source]
get_crossproducts_info()[source]
into_crossproduct_equation(arg)[source]

mathmaker.lib.core.geometry module

class mathmaker.lib.core.geometry.InterceptTheoremConfiguration(points_names=None, butterfly=False, sketch=True, build_ratio=None, build_dimensions=None, rotate_around_isobarycenter='no')[source]

Bases: mathmaker.lib.core.geometry.Triangle

butterfly
chunk
enlargement_ratio
into_euk(**options)[source]

Create the euk file content, as a str

point
ratios_equalities() → mathmaker.lib.core.calculus.Table[source]

Return a Table matching the ratios equalities.

ratios_equalities_substituted() → mathmaker.lib.core.calculus.Table_UP[source]

Return the ratios equalities containing known numbers.

It is returned as a Table_UP object.

ratios_for_converse() → mathmaker.lib.core.calculus.Table[source]

Return a Table matching the ratios equality for converse.

set_lengths(lengths_list, enlargement_ratio)[source]

Set all (“fake”) lengths of the figure.

The given lengths’ list matches the three small sides. The ratio will be used to compute all other segments’ sides. As these lengths are the “fake” ones (not the ones used to draw the figure, but the ones that will show up on the figure), this ratio is the “fake” one (not the same as self.ratio).

Parameters:
  • lengths_list (a list (of Values)) – the list of the lengths for small0, small1, small2
  • enlargement_ratio (any Evaluable) – the enlargement ratio of the exercise.
small
u
v
class mathmaker.lib.core.geometry.Polygon(arg, **options)[source]

Bases: mathmaker.lib.core.base.Drawable

angle
filename
into_euk(**options)[source]
lengths_have_been_set
name
nature
perimeter
rename(n)[source]
rotation_angle
set_lengths(lengths_list)[source]
setup_labels(flags_list, segments_list=None)[source]

Tells what to display along each segment of the list.

If no segments’ list is provided, it defaults to the Polygon’s sides’ list. It is expected that both the flags’ and segments’ lists have the same length. Meaning of the flags’ list: - a ‘?’ will be displayed for each Segment flagged as None or ‘?’ - its length will be displayed if it’s flagged as anything else

evaluating to True
  • nothing will be displayed it it’s flagged as anything else evaluating to False
Parameters:
  • flags_list (list) – the list of the flags
  • segments_list (list (of Segments)) – the list of the Segments to flag
side
vertex
work_out_euk_box(vertices=None)[source]
class mathmaker.lib.core.geometry.Rectangle(arg, **options)[source]

Bases: mathmaker.lib.core.geometry.Polygon

area
length
set_lengths(lengths_list)[source]
width
class mathmaker.lib.core.geometry.RightTriangle(arg, **options)[source]

Bases: mathmaker.lib.core.geometry.Triangle

hypotenuse
leg
pythagorean_equality(**options)[source]
pythagorean_substequality(**options)[source]
right_angle
setup_for_trigonometry(angle_nb=None, trigo_fct=None, angle_val=None, up_length_val=None, down_length_val=None, length_unit=None, only_mark_unknown_angle=False, mark_angle='simple')[source]

Setup labels, determine subst_dict and stores configuration details.

Exactly one parameter among the three *_val ones must be left to None. According to the chosen trigo_fct and this parameter, this method will create the correct subst_dict.

Parameters:
  • angle_nb (int) – must be either 0 or 2 (index of an acute angle)
  • trigo_fct (str) – must belong to [‘cos’, ‘sin’, ‘tan’]
  • angle_val (Value (or leave it to None to use it as the unknown value to calculate)) – the angle’s Value
  • up_length_val (Value (or leave it to None to use it as the unknown value to calculate)) – the length’s Value of the side that’s at the numerator of the trigonometric formula
  • down_length_val (Value (or leave it to None to use it as the unknown value to calculate)) – the length’s Value of the side that’s at the denominator of the trigonometric formula
  • length_unit (anything that can be used as argument for Units) – the length’s unit to use for lengths
side_adjacent_to(angle=None)[source]

Return the side adjacent to given angle.

Parameters:angle (must be self.angle[0] or self.angle[2]) – one of the acute angles
side_opposite_to(angle=None)[source]

Return the side opposite to given angle.

Parameters:angle (must be self.angle[0] or self.angle[2]) – one of the acute angles
trigonometric_equality(angle=None, trigo_fct=None, subst_dict=None, autosetup=False)[source]

Return the required trigonometric equality.

Parameters:
  • angle (Angle) – the acute Angle to use
  • trigo_fct (str) – either ‘cos’, ‘sin’ or ‘tan’
  • subst_dict (dict) – a correct substitution dictionary
  • autosetup (bool) – if enabled, will take the angle, trigo_fct and subst_dict from preconfigured values (requires to have called setup_for_trigonometry() previously).
trigonometric_ratios()[source]

Definitions of the three standard trigonometric ratios.

class mathmaker.lib.core.geometry.Square(arg, **options)[source]

Bases: mathmaker.lib.core.geometry.Polygon

area
set_lengths(lengths_list)[source]
set_marks(arg)[source]
set_side_length(side_length)[source]
side_length
class mathmaker.lib.core.geometry.Triangle(arg, **options)[source]

Bases: mathmaker.lib.core.geometry.Polygon

mathmaker.lib.core.root_calculus module

class mathmaker.lib.core.root_calculus.Calculable[source]

Bases: mathmaker.lib.core.root_calculus.Evaluable

calculate_next_step(**options)[source]
expand_and_reduce_next_step(**options)[source]
get_iteration_list()[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_int()[source]
is_displ_as_a_single_minus_1()[source]
is_displ_as_a_single_neutral(elt)[source]
is_displ_as_a_single_numeric_Item()[source]
multiply_symbol_is_required(objct, position)[source]
requires_brackets(position)[source]
requires_inner_brackets()[source]
substitute(subst_dict)[source]
class mathmaker.lib.core.root_calculus.Evaluable[source]

Bases: mathmaker.lib.core.base.Printable

alphabetical_order_cmp(other_objct)[source]
contains_a_rounded_number()[source]
contains_exactly(objct)[source]
evaluate(**options)[source]
get_first_letter()[source]
is_literal()[source]
is_null()[source]
is_numeric(displ_as=False)[source]
class mathmaker.lib.core.root_calculus.Exponented[source]

Bases: mathmaker.lib.core.root_calculus.Signed

exponent

Exponent of the Function

exponent_must_be_displayed()[source]
get_exponent()[source]
set_exponent(arg)[source]
class mathmaker.lib.core.root_calculus.Signed[source]

Bases: mathmaker.lib.core.root_calculus.Calculable

get_minus_signs_nb()[source]
get_sign()[source]
is_negative()[source]
is_positive()[source]
set_opposite_sign()[source]
set_sign(arg)[source]
sign

Sign of the object

class mathmaker.lib.core.root_calculus.Substitutable(subst_dict=None)[source]

Bases: object

Any object whose (literal) value(s) can be substituted by numeric ones.

Any Substitutable must define a content property, should include an optional subst_dict argument in its __init__() method and must ensure that a _subst_dict is defined (an easy way to do this is calling Substitutable.__init__(self, subst_dict=subst_dict). The substitute() method is redefined by some Substitutable objects.

content

The content to be substituted (list containing literal objects).

subst_dict

Get the default dictionary to use for substitution.

substitute(subst_dict=None)[source]

If a subst_dict has been defined, it is used for literals substitution.

class mathmaker.lib.core.root_calculus.Unit(arg, **options)[source]

Bases: mathmaker.lib.core.root_calculus.Exponented

exponent
into_str(**options)[source]
name
class mathmaker.lib.core.root_calculus.Value(arg, text_in_maths=True, **options)[source]

Bases: mathmaker.lib.core.root_calculus.Signed

abs_value
calculate_next_step(**options)[source]
contains_a_rounded_number()[source]
contains_exactly(objct)[source]
digits_number()[source]
evaluate(**options)[source]
get_first_letter()[source]
get_has_been_rounded()[source]
get_iteration_list()[source]
get_minus_signs_nb()[source]
get_sign()[source]
get_unit()[source]
has_been_rounded

‘has been rounded’ state of the Value

into_str(**options)[source]
is_a_perfect_square()[source]
is_an_integer()[source]
is_displ_as_a_single_0()[source]
is_displ_as_a_single_1()[source]
is_displ_as_a_single_int()[source]
is_displ_as_a_single_minus_1()[source]
is_displ_as_a_single_numeric_Item()[source]
is_literal(displ_as=False) → bool[source]

Return True if Value is to be considered literal.

Parameters:displ_as – not applicable to Values
is_null()[source]
is_numeric(displ_as=False)[source]
needs_to_get_rounded(precision)[source]
raw_value
round(precision)[source]
set_has_been_rounded(arg)[source]
set_opposite_sign()[source]
set_sign(arg)[source]
set_unit(arg)[source]
sign

Sign of the Value

sqrt()[source]
substitute(subst_dict)[source]
unit

Unit of the Value

mathmaker.lib.core.utils module

mathmaker.lib.core.utils.check_lexicon_for_substitution(objcts, subst_dict, how_many)[source]
mathmaker.lib.core.utils.gather_literals(xpr)[source]

Return all literal Values|AngleItems of an expression.

Parameters:xpr (Calculable) – the expression to iter over
mathmaker.lib.core.utils.put_term_in_lexicon(provided_key, associated_coeff, lexi)[source]
mathmaker.lib.core.utils.reduce_literal_items_product(provided_list)[source]

Module contents