1
0
mirror of synced 2024-12-04 19:17:55 +01:00

Code style ...

This commit is contained in:
Stepland 2021-05-09 16:29:40 +02:00
parent 440b9f888d
commit bfd0dffa85
15 changed files with 27 additions and 30 deletions

View File

@ -5,7 +5,7 @@ from hypothesis import given
from jubeatools import song
from jubeatools.formats.eve.timemap import TimeMap
from jubeatools.testutils import strategies as jbst
from jubeatools.utils import fraction_to_decimal, group_by
from jubeatools.utils import group_by
@given(jbst.timing_info(bpm_changes=True), jbst.beat_time())

View File

@ -1,5 +1,4 @@
from dataclasses import dataclass
from io import StringIO
from jubeatools.song import Chart, Song

View File

@ -22,21 +22,22 @@ from typing import (
from more_itertools import windowed
from sortedcontainers import SortedDict, SortedKeyList
from jubeatools.formats.adapters import make_dumper_from_chart_file_dumper
from jubeatools.formats.dump_tools import (
DIFFICULTY_NUMBER,
make_dumper_from_chart_file_dumper,
)
from jubeatools.formats.filetypes import ChartFile
from jubeatools.formats.typing import Dumper
from jubeatools.formats.dump_tools import DIFFICULTY_NUMBER
from jubeatools.song import (
BeatsTime,
Chart,
Direction,
LongNote,
Metadata,
NotePosition,
Song,
TapNote,
Timing,
Direction,
Difficulty,
)
from jubeatools.utils import fraction_to_decimal
@ -263,7 +264,9 @@ def create_sections_from_chart(
return sections
def make_full_dumper_from_jubeat_analyser_chart_dumper(chart_dumper: JubeatAnalyserChartDumper) -> Dumper:
def make_full_dumper_from_jubeat_analyser_chart_dumper(
chart_dumper: JubeatAnalyserChartDumper,
) -> Dumper:
"""Factory function to create a fully fledged song dumper from
the internal chart dumper of jubeat analyser formats"""

View File

@ -4,18 +4,16 @@ from fractions import Fraction
from io import StringIO
from itertools import zip_longest
from math import ceil
from typing import Dict, Iterator, List, Union, Any
from typing import Dict, Iterator, List, Union
from more_itertools import chunked, collapse, intersperse, mark_ends, windowed
from jubeatools.formats.filetypes import ChartFile
from jubeatools.song import (
BeatsTime,
Chart,
LongNote,
Metadata,
NotePosition,
Song,
TapNote,
Timing,
)

View File

@ -24,7 +24,6 @@ from jubeatools.song import (
from jubeatools.utils import none_or
from ..command import is_command, parse_command
from ..files import load_folder
from ..load_tools import (
CIRCLE_FREE_TO_NOTE_SYMBOL,
EMPTY_BEAT_SYMBOLS,
@ -35,6 +34,7 @@ from ..load_tools import (
find_long_note_candidates,
is_double_column_chart_line,
is_empty_line,
load_folder,
parse_double_column_chart_line,
pick_correct_long_note_candidates,
)

View File

@ -4,18 +4,16 @@ from fractions import Fraction
from io import StringIO
from itertools import zip_longest
from math import ceil
from typing import Dict, Iterator, List, Union, Any
from typing import Dict, Iterator, List, Union
from more_itertools import collapse, intersperse, mark_ends, windowed
from jubeatools.formats.filetypes import ChartFile
from jubeatools.song import (
BeatsTime,
Chart,
LongNote,
Metadata,
NotePosition,
Song,
TapNote,
Timing,
)

View File

@ -23,7 +23,6 @@ from jubeatools.song import (
from jubeatools.utils import none_or
from ..command import is_command, parse_command
from ..files import load_folder
from ..load_tools import (
CIRCLE_FREE_TO_NOTE_SYMBOL,
EMPTY_BEAT_SYMBOLS,
@ -34,6 +33,7 @@ from ..load_tools import (
find_long_note_candidates,
is_double_column_chart_line,
is_empty_line,
load_folder,
parse_double_column_chart_line,
pick_correct_long_note_candidates,
)

View File

@ -4,12 +4,11 @@ from decimal import Decimal
from fractions import Fraction
from io import StringIO
from itertools import chain, zip_longest
from typing import Dict, Iterator, List, Optional, Union, Any
from typing import Dict, Iterator, List, Optional, Union
from more_itertools import collapse, intersperse, mark_ends, windowed
from sortedcontainers import SortedKeyList
from jubeatools.formats.filetypes import ChartFile
from jubeatools.song import (
BeatsTime,
BPMEvent,
@ -18,7 +17,6 @@ from jubeatools.song import (
Metadata,
NotePosition,
SecondsTime,
Song,
TapNote,
Timing,
)

View File

@ -24,7 +24,6 @@ from jubeatools.song import (
from jubeatools.utils import none_or
from ..command import is_command, parse_command
from ..files import load_folder
from ..load_tools import (
CIRCLE_FREE_TO_NOTE_SYMBOL,
EMPTY_BEAT_SYMBOLS,
@ -32,6 +31,7 @@ from ..load_tools import (
UnfinishedLongNote,
find_long_note_candidates,
is_empty_line,
load_folder,
pick_correct_long_note_candidates,
)
from ..symbols import CIRCLE_FREE_SYMBOLS

View File

@ -1,17 +1,15 @@
from copy import deepcopy
from io import StringIO
from typing import Dict, Iterator, List, Any
from typing import Dict, Iterator, List
from more_itertools import collapse, intersperse, mark_ends
from jubeatools.formats.filetypes import ChartFile
from jubeatools.song import (
BeatsTime,
Chart,
LongNote,
Metadata,
NotePosition,
Song,
TapNote,
Timing,
)
@ -151,4 +149,7 @@ def _dump_mono_column_chart(
return file
dump_mono_column = make_full_dumper_from_jubeat_analyser_chart_dumper(_dump_mono_column_chart)
dump_mono_column = make_full_dumper_from_jubeat_analyser_chart_dumper(
_dump_mono_column_chart
)

View File

@ -24,7 +24,6 @@ from jubeatools.song import (
from jubeatools.utils import none_or
from ..command import is_command, parse_command
from ..files import load_folder
from ..load_tools import (
CIRCLE_FREE_TO_BEATS_TIME,
JubeatAnalyserParser,
@ -32,6 +31,7 @@ from ..load_tools import (
find_long_note_candidates,
is_empty_line,
is_separator,
load_folder,
pick_correct_long_note_candidates,
split_double_byte_line,
)

View File

@ -1,5 +1,5 @@
from typing import Protocol
from io import StringIO
from typing import Protocol
from jubeatools.song import Chart, Metadata, Timing

View File

@ -1,8 +1,8 @@
from pathlib import Path
from typing import Any, Callable, Dict, Protocol, List
from typing import Any, Callable, Dict, List, Protocol
from jubeatools.song import Song
from jubeatools.formats.filetypes import ChartFile
from jubeatools.song import Song
# Dumpers take a Song object and a Path hint and give back a dict that maps

View File

@ -15,6 +15,7 @@ from jubeatools.song import (
BeatsTime,
BPMEvent,
Chart,
Difficulty,
LongNote,
Metadata,
NotePosition,
@ -22,7 +23,6 @@ from jubeatools.song import (
Song,
TapNote,
Timing,
Difficulty,
)
from jubeatools.testutils.typing import DrawFunc

View File

@ -1,12 +1,12 @@
"""General utility functions"""
import unicodedata
from collections import defaultdict
from decimal import Decimal
from fractions import Fraction
from functools import reduce
from math import gcd
from typing import Callable, Optional, TypeVar, List, Dict
from collections import defaultdict
from typing import Callable, Dict, List, Optional, TypeVar
def single_lcm(a: int, b: int) -> int: