master > master: code py - minor

This commit is contained in:
RD 2022-06-11 14:07:00 +02:00
parent d454f71bfa
commit 8acb2157ab
3 changed files with 5 additions and 9 deletions

View File

@ -29,11 +29,13 @@ def enter(*args: str):
# Führe befehle in Assets aus: # Führe befehle in Assets aus:
for command in config.COMMANDS: for command in config.COMMANDS:
result = api.run_command(command); result = api.run_command(command);
log.log_result(result, debug=True); # ignored if log-level >> DEBUG # ignored if log-level >> DEBUG
log.log_result(result, debug=True);
else: else:
# Führe CLI-Befehl aus: # Führe CLI-Befehl aus:
result = api.run_command_from_json(args[0]); result = api.run_command_from_json(args[0]);
log.log_result(result, debug=True); # ignored if log-level >> DEBUG # ignored if log-level >> DEBUG
log.log_result(result, debug=True);
return; return;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -32,7 +32,6 @@ def simple_algorithm(
X: str, X: str,
Y: str, Y: str,
verbose: List[EnumHirschbergVerbosity] = [], verbose: List[EnumHirschbergVerbosity] = [],
show: List[EnumHirschbergShow] = [],
) -> Tuple[str, str]: ) -> Tuple[str, str]:
''' '''
Dieser Algorithmus berechnet die Edit-Distanzen + optimale Richtungen ein Mal. Dieser Algorithmus berechnet die Edit-Distanzen + optimale Richtungen ein Mal.
@ -50,7 +49,6 @@ def simple_algorithm(
def hirschberg_algorithm( def hirschberg_algorithm(
X: str, X: str,
Y: str, Y: str,
once: bool = False,
verbose: List[EnumHirschbergVerbosity] = [], verbose: List[EnumHirschbergVerbosity] = [],
show: List[EnumHirschbergShow] = [], show: List[EnumHirschbergShow] = [],
) -> Tuple[str, str]: ) -> Tuple[str, str]:
@ -64,10 +62,6 @@ def hirschberg_algorithm(
Daraus wird unmittelbar ein optimales Alignment bestimmt. Daraus wird unmittelbar ein optimales Alignment bestimmt.
Des Weiteren werden Zeitkosten durch Divide-and-Conquer klein gehalten. Des Weiteren werden Zeitkosten durch Divide-and-Conquer klein gehalten.
''' '''
# ggf. nur den simplen Algorithmus ausführen:
if once:
return simple_algorithm(X=X, Y=Y, verbose=verbose, show=show);
align = hirschberg_algorithm_step(X=X, Y=Y, depth=1, verbose=verbose, show=show); align = hirschberg_algorithm_step(X=X, Y=Y, depth=1, verbose=verbose, show=show);
word_x = align.as_string1(); word_x = align.as_string1();
word_y = align.as_string2(); word_y = align.as_string2();

View File

@ -47,7 +47,7 @@ def create_commands(path: str) -> List[Command]: # pragma: no cover
assets = yaml_load(fp, Loader=yaml_FullLoader); assets = yaml_load(fp, Loader=yaml_FullLoader);
return [ return [
interpret_command(Command(**instruction)) interpret_command(Command(**instruction))
for instruction in assets for instruction in assets or []
]; ];
# use lazy loaing to ensure that values only loaded (once) when used # use lazy loaing to ensure that values only loaded (once) when used