fchavelli commited on
Commit
b3e10d5
·
1 Parent(s): c1ea798

style(app): ruff format and line length

Browse files
Files changed (2) hide show
  1. src/about_data.py +2 -3
  2. src/data.py +2 -6
src/about_data.py CHANGED
@@ -251,9 +251,8 @@ def build_algo_table(runtime_detectors: dict | None = None) -> str:
251
  """Return a Markdown table of algorithms (no group separator rows)."""
252
  rows: list[str] = []
253
  for a in ALGO_ENTRIES:
254
- rows.append(
255
- f"| {a.name} | {a.task} | {a.family} | `{format_complexity_plain(a.complexity)}` | {a.license} | {a.source} |"
256
- )
257
 
258
  header = (
259
  "| Algorithm | Task | Family | Complexity | License | Source |\n"
 
251
  """Return a Markdown table of algorithms (no group separator rows)."""
252
  rows: list[str] = []
253
  for a in ALGO_ENTRIES:
254
+ complexity = format_complexity_plain(a.complexity)
255
+ rows.append(f"| {a.name} | {a.task} | {a.family} | `{complexity}` | {a.license} | {a.source} |")
 
256
 
257
  header = (
258
  "| Algorithm | Task | Family | Complexity | License | Source |\n"
src/data.py CHANGED
@@ -289,9 +289,7 @@ def _generate_segment_by_pattern(
289
  # Pick a sub-pattern deterministically from shape_rng so two segments
290
  # of the same recurring state pick the SAME sub-pattern.
291
  choice = shape_rng.choice(["constant", "sinusoidal", "step", "stairs", "linear", "gp"])
292
- return _generate_segment_by_pattern(
293
- choice, state_idx, length, n_dims, noise_level, shape_rng, noise_rng
294
- )
295
  else:
296
  # Fallback to constant
297
  return _gen_constant(length, n_dims, float(state_idx), noise_level, noise_rng)
@@ -375,9 +373,7 @@ def generate_synthetic_series(
375
  shape_rng = np.random.default_rng(state_seeds[sid])
376
  noise_rng = np.random.default_rng(noise_seeds[seg_idx])
377
 
378
- segment = _generate_segment_by_pattern(
379
- pattern, sid, seg_len, n_dims, noise_level, shape_rng, noise_rng
380
- )
381
 
382
  # Stitch segment to previous endpoint to suppress visual discontinuities
383
  # at the boundary (does not change the state label or boundary index).
 
289
  # Pick a sub-pattern deterministically from shape_rng so two segments
290
  # of the same recurring state pick the SAME sub-pattern.
291
  choice = shape_rng.choice(["constant", "sinusoidal", "step", "stairs", "linear", "gp"])
292
+ return _generate_segment_by_pattern(choice, state_idx, length, n_dims, noise_level, shape_rng, noise_rng)
 
 
293
  else:
294
  # Fallback to constant
295
  return _gen_constant(length, n_dims, float(state_idx), noise_level, noise_rng)
 
373
  shape_rng = np.random.default_rng(state_seeds[sid])
374
  noise_rng = np.random.default_rng(noise_seeds[seg_idx])
375
 
376
+ segment = _generate_segment_by_pattern(pattern, sid, seg_len, n_dims, noise_level, shape_rng, noise_rng)
 
 
377
 
378
  # Stitch segment to previous endpoint to suppress visual discontinuities
379
  # at the boundary (does not change the state label or boundary index).