Skip to content

Commit f61fa4b

Browse files
chore(pre-commit.ci): auto fixes
1 parent 6bb4771 commit f61fa4b

3 files changed

Lines changed: 31 additions & 9 deletions

File tree

src/ut_course_catalog/analysis.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ def parse_scoring_method(text: str | None) -> set[ScoringMethod]:
6161
ScoringMethod.課題: ["課題", "assign", "宿題"],
6262
ScoringMethod.レポート: ["レポート", "レポ", "report"],
6363
ScoringMethod.発表: ["発表", "presenta", "プレゼン"],
64-
ScoringMethod.出席: ["出席", "発表", "参加", "attend", "平常", "出欠", "リアペ", "リアクション"],
64+
ScoringMethod.出席: [
65+
"出席",
66+
"発表",
67+
"参加",
68+
"attend",
69+
"平常",
70+
"出欠",
71+
"リアペ",
72+
"リアクション",
73+
],
6574
}
6675
result: set[ScoringMethod] = set()
6776
if text is None:
@@ -95,7 +104,11 @@ def encode_common_code(common_codes: pd.Series[CommonCode]) -> pd.DataFrame:
95104
def to_perfect_dataframe(df: pd.DataFrame) -> pd.DataFrame:
96105
df = df.copy()
97106
df = pd.concat(
98-
[df, encode_scoring_method(df["成績評価方法"]), encode_common_code(df["共通科目コード"])],
107+
[
108+
df,
109+
encode_scoring_method(df["成績評価方法"]),
110+
encode_common_code(df["共通科目コード"]),
111+
],
99112
axis=1,
100113
)
101114
return df

src/ut_course_catalog/common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ async def wait(self) -> None:
9393

9494
def wraps(
9595
self,
96-
func: WrappedFn[WrappedFnParam, WrappedFnResult]
97-
| WrappedAwaitableFn[WrappedFnParam, WrappedFnResult],
96+
func: (
97+
WrappedFn[WrappedFnParam, WrappedFnResult]
98+
| WrappedAwaitableFn[WrappedFnParam, WrappedFnResult]
99+
),
98100
) -> WrappedFn[WrappedFnParam, WrappedFnResult]:
99101
@wraps(func)
100102
async def wrapper(

src/ut_course_catalog/ja.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,9 @@ def _parse_weekday_period(period_text: str) -> set[tuple[Weekday, int]]:
649649
period_texts = period_text.split("、")
650650

651651
def parse_one(period: str) -> tuple[Weekday, int] | None:
652-
w = Weekday([weekday in period for weekday in list("月火水木金土日")].index(True))
652+
w = Weekday(
653+
[weekday in period for weekday in list("月火水木金土日")].index(True)
654+
)
653655
reres = re.search(r"\d+", period)
654656
if not reres:
655657
# raise ValueError(f"Invalid period: {period}")
@@ -778,7 +780,9 @@ def iterable_or_type_to_iterable(
778780
x.value * 100 + 1000 for x in iterable_or_type_to_iterable(params.曜日)
779781
]
780782
if params.講義使用言語:
781-
facet["course_language_codes"] = iterable_or_type_to_iterable(params.講義使用言語)
783+
facet["course_language_codes"] = iterable_or_type_to_iterable(
784+
params.講義使用言語
785+
)
782786
if params.実務経験のある教員による授業科目:
783787
facet["operational_experience_flag"] = iterable_or_type_to_iterable(
784788
params.実務経験のある教員による授業科目
@@ -1094,8 +1098,9 @@ async def fetch_search_detail_all(
10941098
*,
10951099
year: int = current_fiscal_year(),
10961100
use_tqdm: bool = True,
1097-
on_initial_request: None
1098-
| (Callable[[SearchResult], Awaitable[None] | None]) = None,
1101+
on_initial_request: None | (
1102+
Callable[[SearchResult], Awaitable[None] | None]
1103+
) = None,
10991104
on_detail_request: Callable[[Details], Awaitable[None] | None] | None = None,
11001105
) -> Iterable[Details]:
11011106
"""Fetch all search results by repeatedly calling `fetch_search` and `fetch_detail`.
@@ -1144,7 +1149,9 @@ async def on_initial_request_wrapper(search_result: SearchResult):
11441149
async def inner(item):
11451150
async with s:
11461151
try:
1147-
details = await self.retry(self.fetch_detail)(item.時間割コード, year)
1152+
details = await self.retry(self.fetch_detail)(
1153+
item.時間割コード, year
1154+
)
11481155
except Exception as e:
11491156
self._logger.error(e)
11501157
return None

0 commit comments

Comments
 (0)