implemented welcome interface

parent 2a1cb5a6
import typing as tp
import static_solvers
import dynamic_solvers
import functions
from tabulate import tabulate
import typer
STATIC_METHODS = [
static_solvers.left_rectangle_method,
static_solvers.right_rectangle_method,
static_solvers.trapezium_method,
static_solvers.parabola_method,
]
DYNAMIC_METHODS = [
dynamic_solvers.cordic_method,
dynamic_solvers.double_recalculate_method,
dynamic_solvers.runge_kutty_method,
dynamic_solvers.euler_method,
dynamic_solvers.mysterious_method,
]
ALL_METHODS = [
*STATIC_METHODS,
*DYNAMIC_METHODS,
]
ALL_FUNCTIONS = [
functions.fn_sin,
functions.fn_cos,
functions.fn_ln,
functions.fn_sqrt,
functions.fn_square,
functions.fn_cube,
]
def list_methods() -> None:
headers = ["№", "Название метода"]
method_names = [method.__doc__ for method in ALL_METHODS]
method_table = tabulate(
tabular_data=[[no, name] for no, name in enumerate(method_names, start=1)],
headers=headers,
)
typer.echo("Доступные методы с постоянным и переменным шагом:")
typer.echo(method_table + "\n")
def list_functions() -> None:
headers = ["№", "Функция"]
function_names = [function.__doc__ for function in ALL_FUNCTIONS]
function_table = tabulate(
tabular_data=[[no, name] for no, name in enumerate(function_names, start=1)],
headers=headers,
)
typer.echo("Доступные функции для интегрирования:")
typer.echo(function_table + "\n")
def main() -> None:
typer.echo("ЛР1: Система решения ОДУ")
typer.echo("Работу выполнили: Величко А.А., Галкин И.Ю., Егоров С.А., Адаев Р.М. ИВТ 2 курс\n")
list_methods()
list_functions()
if __name__ == "__main__":
typer.run(main)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment