Alina Lozovskaia commited on
Commit
9d989a4
1 Parent(s): bb51465

apply code style and quality checks to utils.py

Browse files
Files changed (1) hide show
  1. src/display/utils.py +4 -3
src/display/utils.py CHANGED
@@ -7,7 +7,8 @@ import pandas as pd
7
 
8
 
9
  # Configure logging
10
- logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
 
11
 
12
  def parse_datetime(datetime_str):
13
  formats = [
@@ -15,7 +16,7 @@ def parse_datetime(datetime_str):
15
  "%Y-%m-%dT%H:%M:%S.%f", # Standard format with colons
16
  "%Y-%m-%dT%H %M %S.%f", # Spaces as separator
17
  ]
18
-
19
  for fmt in formats:
20
  try:
21
  return datetime.strptime(datetime_str, fmt)
@@ -25,6 +26,7 @@ def parse_datetime(datetime_str):
25
  logging.error(f"No valid date format found for: {datetime_str}")
26
  return datetime(1970, 1, 1)
27
 
 
28
  def load_json_data(file_path):
29
  """Safely load JSON data from a file."""
30
  try:
@@ -98,7 +100,6 @@ auto_eval_column_dict.append(["fullname", ColumnContent, ColumnContent("fullname
98
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
99
 
100
 
101
-
102
  @dataclass(frozen=True)
103
  class EvalQueueColumn: # Queue column
104
  model = ColumnContent("model", "markdown", True)
 
7
 
8
 
9
  # Configure logging
10
+ logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
11
+
12
 
13
  def parse_datetime(datetime_str):
14
  formats = [
 
16
  "%Y-%m-%dT%H:%M:%S.%f", # Standard format with colons
17
  "%Y-%m-%dT%H %M %S.%f", # Spaces as separator
18
  ]
19
+
20
  for fmt in formats:
21
  try:
22
  return datetime.strptime(datetime_str, fmt)
 
26
  logging.error(f"No valid date format found for: {datetime_str}")
27
  return datetime(1970, 1, 1)
28
 
29
+
30
  def load_json_data(file_path):
31
  """Safely load JSON data from a file."""
32
  try:
 
100
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
101
 
102
 
 
103
  @dataclass(frozen=True)
104
  class EvalQueueColumn: # Queue column
105
  model = ColumnContent("model", "markdown", True)