Skip to content

Commit f43af2b

Browse files
committed
linting and formatting errors
1 parent cc5cdef commit f43af2b

47 files changed

Lines changed: 3524 additions & 2624 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app.py

Lines changed: 426 additions & 305 deletions
Large diffs are not rendered by default.

examples/ablation_study.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1010
Goal: Show full BDH improves by >10% vs baseline, measure component interactions.
1111
"""
12+
1213
import json
1314
import sys
1415
from pathlib import Path

examples/baseline_comparison.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
Goal: Show >20% improvement over Naive baseline.
88
"""
9+
910
import json
1011
import sys
1112
from pathlib import Path

examples/hebbian_stress_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
Goal: Show >5% weight change for at least one constraint type.
99
"""
10+
1011
import json
1112
import sys
1213
from pathlib import Path

examples/selfplay_bdh_demo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
the Transformer and Models of the Brain. arXiv:2509.26507
1313
https://arxiv.org/abs/2509.26507
1414
"""
15+
1516
import sys
1617
from pathlib import Path
1718

@@ -139,7 +140,7 @@ def main() -> None:
139140
scenario_counts = Counter(all_scenarios)
140141
for scenario, count in scenario_counts.most_common():
141142
logger.info(
142-
f" {scenario:15s}: {count:3d} ({count/len(all_scenarios):.1%})"
143+
f" {scenario:15s}: {count:3d} ({count / len(all_scenarios):.1%})"
143144
)
144145

145146
# 6. Standard metrics
@@ -294,7 +295,7 @@ def plot_bdh_metrics(metrics_history: list, trainer: any) -> None:
294295
ax5.text(
295296
bar.get_x() + bar.get_width() / 2.0,
296297
height,
297-
f"{count}\n({count/total:.1%})",
298+
f"{count}\n({count / total:.1%})",
298299
ha="center",
299300
va="bottom",
300301
)

examples/selfplay_quick_demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
References:
88
See docs/selfplay_implementation.md for architecture details.
99
"""
10+
1011
import sys
1112
from pathlib import Path
1213

notebooks/01_lcl_exploration.ipynb

Lines changed: 223 additions & 178 deletions
Large diffs are not rendered by default.

notebooks/02_ukdale_exploration.ipynb

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
],
3030
"source": [
3131
"# Setup and imports\n",
32-
"import pandas as pd\n",
33-
"import polars as pl\n",
34-
"import numpy as np\n",
35-
"import matplotlib.pyplot as plt\n",
36-
"import seaborn as sns\n",
37-
"from pathlib import Path\n",
3832
"import json\n",
3933
"import warnings\n",
34+
"from pathlib import Path\n",
35+
"\n",
36+
"import matplotlib.pyplot as plt\n",
37+
"import polars as pl\n",
38+
"import seaborn as sns\n",
39+
"\n",
4040
"warnings.filterwarnings(\"ignore\")\n",
4141
"\n",
4242
"plt.style.use(\"seaborn-v0_8-whitegrid\")\n",
@@ -328,12 +328,18 @@
328328
"print(df_pd[\"energy_kwh\"].describe())\n",
329329
"\n",
330330
"print(\"\\n=== Top 15 Appliances by Total Consumption ===\")\n",
331-
"appliance_totals = df_pd.groupby(\"channel\")[\"energy_kwh\"].agg([\"sum\", \"mean\", \"median\", \"std\", \"count\"]).sort_values(\"sum\", ascending=False)\n",
331+
"appliance_totals = (\n",
332+
" df_pd.groupby(\"channel\")[\"energy_kwh\"]\n",
333+
" .agg([\"sum\", \"mean\", \"median\", \"std\", \"count\"])\n",
334+
" .sort_values(\"sum\", ascending=False)\n",
335+
")\n",
332336
"display(appliance_totals.head(15))\n",
333337
"\n",
334338
"total_energy = df_pd[\"energy_kwh\"].sum()\n",
335339
"appliance_totals[\"pct_contribution\"] = (appliance_totals[\"sum\"] / total_energy) * 100\n",
336-
"print(f\"\\nTop 5 appliances: {appliance_totals.head(5)['pct_contribution'].sum():.1f}% of consumption\")"
340+
"print(\n",
341+
" f\"\\nTop 5 appliances: {appliance_totals.head(5)['pct_contribution'].sum():.1f}% of consumption\"\n",
342+
")"
337343
]
338344
},
339345
{

0 commit comments

Comments
 (0)