mathmaker.lib package

Subpackages

Submodules

mathmaker.lib.error module

exception mathmaker.lib.error.ArgumentNeeded(data)[source]

Bases: Exception

exception mathmaker.lib.error.ImpossibleAction(data)[source]

Bases: Exception

exception mathmaker.lib.error.MethodShouldBeRedefined(objct, method)[source]

Bases: Exception

exception mathmaker.lib.error.NotImplementedYet(method)[source]

Bases: Exception

exception mathmaker.lib.error.NotInstanciableObject(objct)[source]

Bases: Exception

exception mathmaker.lib.error.OutOfRangeArgument(objct, expected_range)[source]

Bases: Exception

exception mathmaker.lib.error.UncompatibleObjects(objct1, objct2, given_action, expected_result)[source]

Bases: Exception

exception mathmaker.lib.error.UncompatibleOptions(opt1, opt2)[source]

Bases: Exception

exception mathmaker.lib.error.UncompatibleType(objct, possible_types)[source]

Bases: Exception

exception mathmaker.lib.error.UnknownOutputFormat(given_format)[source]

Bases: Exception

exception mathmaker.lib.error.UnknownXMLTag(given_tag)[source]

Bases: Exception

exception mathmaker.lib.error.WrongArgument(given_arg, expected_arg)[source]

Bases: Exception

exception mathmaker.lib.error.WrongObject(data)[source]

Bases: Exception

exception mathmaker.lib.error.XMLFileFormatError(msg)[source]

Bases: Exception

mathmaker.lib.is_ module

mathmaker.lib.is_.a_natural_int(objct)[source]
mathmaker.lib.is_.a_number(objct)[source]
mathmaker.lib.is_.a_numerical_string(objct)[source]
mathmaker.lib.is_.a_sign(objct)[source]
mathmaker.lib.is_.a_string(objct)[source]
mathmaker.lib.is_.a_string_list(objct)[source]
mathmaker.lib.is_.an_int(objct)[source]
mathmaker.lib.is_.an_integer(objct)[source]
mathmaker.lib.is_.an_ordered_calculable_objects_list(provided_list)[source]

mathmaker.lib.list_sheets module

mathmaker.lib.list_sheets.list_all_sheets()[source]

Creates the list of all available mathmaker’s sheets.

The list is displayed as a tabular.

Returns:The list as str

mathmaker.lib.maths_lib module

mathmaker.lib.maths_lib.abs(nb)[source]
mathmaker.lib.maths_lib.barycenter(points_list, barycenter_name, weights=None)[source]
mathmaker.lib.maths_lib.coprime_generator(n)[source]
mathmaker.lib.maths_lib.correct_normalize_results(d)[source]
mathmaker.lib.maths_lib.deg_to_rad(arg)[source]
mathmaker.lib.maths_lib.gcd(a, b)[source]
mathmaker.lib.maths_lib.generate_decimal(width, ranks_scale, start_rank)[source]
mathmaker.lib.maths_lib.is_even(objct)[source]
mathmaker.lib.maths_lib.is_uneven(objct)[source]
mathmaker.lib.maths_lib.lcm(a, b)[source]
mathmaker.lib.maths_lib.lcm_of_the_list(l)[source]
mathmaker.lib.maths_lib.mean(numberList, weights=None)[source]
mathmaker.lib.maths_lib.pupil_gcd(a, b)[source]
mathmaker.lib.maths_lib.round(d, precision, **options)[source]
mathmaker.lib.maths_lib.sign_of_product(signed_objctlist)[source]
mathmaker.lib.maths_lib.ten_power_gcd(a, b)[source]

mathmaker.lib.randomly module

mathmaker.lib.randomly.coprime_to(n, range)[source]
mathmaker.lib.randomly.coprime_to_the_first(n, p, range)[source]
mathmaker.lib.randomly.decimal_0_1()[source]
mathmaker.lib.randomly.heads_or_tails()[source]
mathmaker.lib.randomly.integer(min_value, max_value, **options)[source]
mathmaker.lib.randomly.mix(objects_list)[source]
mathmaker.lib.randomly.not_coprime_to(n, range, **options)[source]
mathmaker.lib.randomly.pop(provided_list, **options)[source]
mathmaker.lib.randomly.sign(**options)[source]

mathmaker.lib.shared module

mathmaker.lib.shared.init()[source]

mathmaker.lib.sources module

mathmaker.lib.sources.generate_values(source_id)[source]
class mathmaker.lib.sources.mc_source[source]

Bases: object

next(source_id, **kwargs)[source]
class mathmaker.lib.sources.sub_source(source_id)[source]

Bases: object

next(**kwargs)[source]

mathmaker.lib.startup_actions module

This module gathers functions that should be run at startup.

These functions check dependencies, settings consistency and setup the language for gettext translations.

mathmaker.lib.startup_actions.check_dependencies(euktoeps='euktoeps', xmllint='xmllint', lualatex='lualatex', luaotfload_tool='luaotfload-tool') → bool[source]

Will check all mathmaker’s dependencies.

mathmaker.lib.startup_actions.check_dependency(name: str, goal: str, path_to: str, required_version_nb: str) → bool[source]

Will check if a dependency is installed plus its version number.

The version number is supposed to be displayed at the end of the line containing ‘version’ when calling executable –version (or the equivalent).

Parameters:
  • name (str) – the dependency’s name.
  • goal (str) – tells shortly why mathmaker needs it for
  • path_to (str) – the path to the executable to test
  • required_version_nb (str) – well, the required version number
Return type:

bool

mathmaker.lib.startup_actions.check_font() → bool[source]

Will check if settings.font belongs to data/fonts_list.txt.

It will first check if the exact name is in the list, then if one line of the list starts with the exact name.

mathmaker.lib.startup_actions.check_settings_consistency(language=None, od=None)[source]

Will check the consistency of several settings values.

The checked values are: whether the language is supported as a LaTeX package that mathmaker uses, the output directory (is it an existing directory?) and whether the chosen font is usable by lualatex.

mathmaker.lib.startup_actions.install_gettext_translations(**kwargs)[source]

Will install output’s language (gettext functions).

mathmaker.lib.startup_actions.warning_msg(name: str, path_to: str, c_out: str, c_err: str, gkw: str, g_out: str, g_err: str)[source]

Return the formatted warning message.

Parameters:
  • name – name of the software
  • path_to – the path to the software
  • c_out – output of the call to software –version
  • c_err – error output of the call to software –version
  • gkw – keyword used to grep the version from output
  • g_out – output of the call to grep...
  • g_err – error output of the call to grep...

Module contents