Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
971096f
WIP Wide-to-long transformation code and accompanying runner and vali…
Jan 26, 2026
296cb57
WIP on transform CSV scripts
Feb 4, 2026
a6758d9
Add duplicate detection, row counts, and run artifact validation to m…
Feb 5, 2026
304e49a
Fix Polars 1.38 compatibility: Expr.is_sorted() removed, use Series.i…
Feb 5, 2026
49ae5b2
Fix sortedness bug: sink_parquet ignores sort, use collect+write_parquet
Feb 5, 2026
05356e5
Add migrate-month recipe for EC2 CSV-to-Parquet production runs
Feb 6, 2026
157db07
Add .txt and archive dirs to .gitignore, add secrets pre-commit guards
Feb 6, 2026
0342d90
Refactor validate_month_output.py for O(batch_size) memory streaming
Feb 6, 2026
9c50745
Fix false sortedness failures in sample mode due to overlapping slices
Feb 6, 2026
4890400
Add migrate-month recipe to Justfile (based on main branch)
Feb 6, 2026
a6a59dc
Add professional annotations to CSV-to-Parquet pipeline files
Feb 6, 2026
012e9cf
Merge remote-tracking branch 'origin/main' into 43-convert-coned-mete…
Feb 6, 2026
c5d7157
Fix trailing whitespace in README files from main merge
Feb 6, 2026
da5843a
Add multi-month orchestration recipes to Justfile
Feb 9, 2026
31d37d3
Add rate_structures directory for tariff definitions
Feb 10, 2026
a91613c
Added STOU YAML file to begin simulation testing
Feb 10, 2026
a79be5f
Generalize billing to compare two generic hourly tariffs (A vs B)
Feb 10, 2026
a370788
Add hourly tariff price calendar builder from YAML rate structure
Feb 10, 2026
fe68a1a
Add builder for hourly flat-rate price calendar
Feb 10, 2026
1cc14ab
Add end-to-end DST roll-in validator for RTP billing pipeline
Feb 11, 2026
49dfc60
Add BG regression dataset builder and multi-month billing orchestrator
Feb 11, 2026
64eb66b
Add pricing simulation E2E tests and reviewer test plan; allow tracki…
Feb 11, 2026
743e88f
Add reviewer "why" annotations to pricing simulation pipeline
Feb 11, 2026
d13a802
Update E2E tests for month-scoped bills and expanded regression outputs
Feb 16, 2026
7285174
Add deterministic month-level compaction stage with atomic swap and v…
Feb 17, 2026
4e0f3e4
Filter migrate-month inputs by filename month to tolerate mixed-month…
Feb 9, 2026
35ff63e
Run migrate_month_runner via uv-managed environment
Feb 9, 2026
286c4f7
Add --compact-no-swap mode; perform full compaction+validation withou…
Feb 17, 2026
8f18d52
update .gitignore to explicitly avoid committing test parquets
Feb 18, 2026
9cc5234
Fix adjacent-key validation to avoid to_list() memory blowup
Feb 18, 2026
e0acf58
update .gitignore to explicitly avoid committing test parquets
Feb 18, 2026
d84455b
rtp: support glob/directory input and multi-file parquet scan in comp…
Feb 18, 2026
f310997
add BG correlation check, class-aware GeoJSON export, and account cha…
Feb 19, 2026
66a7531
fix code-review issues in pricing_pilot analysis scripts
Feb 19, 2026
5d594f2
fix B007 lint error in validate_mf_esh_bg_count.py
Feb 19, 2026
6fc476b
add wide_to_long unit tests; sync ruff to v0.14.4
Feb 19, 2026
a2dc7b5
add build_account_bg_map.py: reproducible account→BG map builder
Feb 20, 2026
ccd166e
add TOU window audit script and alignment unit tests
Feb 20, 2026
03772f6
enforce STOU/DTOU TOU window alignment at YAML and CI level
Feb 20, 2026
de16ecd
add per-class scatterplots and fix axis labeling in pricing pilot reg…
Feb 20, 2026
7379134
cosmetic fixes to pricing pilot scatterplots
Feb 20, 2026
98a4089
fix stats box redundancy and Times New Roman font in scatterplots
Feb 20, 2026
d4265d3
include all block groups in GeoJSON export (left join, null-fill for …
Feb 21, 2026
e6bdbef
add --pct flag for percentage-change y-axis in pricing pilot regressions
Feb 21, 2026
b7a22d6
GeoJSON export: global symmetric cap + fail-loud validation
Feb 23, 2026
2f35612
fix GeoJSON exporter sign convention: prefer bill_b - bill_a over bil…
Feb 23, 2026
d00c135
filter GeoJSON export to Chicago ZIP-based BG universe
Feb 23, 2026
3cd2331
fix CI: restore wide_to_long module and update regression x-axis scale
Feb 23, 2026
84ade66
add 95% CI band to regression scatterplots; rename Rate BEST -> STOU
Feb 24, 2026
b0a7480
Replace _validate_adjacent_keys with streaming PyArrow iter_batches v…
Feb 24, 2026
4ef97da
Cap rows_per_chunk at 50M to prevent OOM on dense months
Feb 26, 2026
0937618
Refactor _stream_write_chunks to write multi-row-group files targetin…
Feb 26, 2026
50416e6
Switch to plain YYYY/MM partition dirs, Spark part- naming, and add e…
Feb 27, 2026
044dfdd
Commit AGENTS.md and ignore .cursor/ in .gitignore
Mar 2, 2026
fef0ea6
Move edit_geojson.py from root to scripts/
Mar 2, 2026
6fcf966
Restore code quality targets to Justfile from main
Mar 2, 2026
8e39d88
Archive deprecated Chicago visualization scripts
Mar 2, 2026
9557d48
Merge into csv/parquet to get new agent code.
Mar 2, 2026
be03d98
Fix sign convention docs in geojson export
Mar 2, 2026
4618690
Fix delta fallback to match Flat − Alt convention
Mar 2, 2026
f16d757
Add HC1 robust standard errors to BG OLS fit
Mar 2, 2026
78f4321
Use lazy scan for bills parquet load
Mar 2, 2026
58bd196
Use lazy scan for aggregate BG bill loading
Mar 2, 2026
adf98ed
Fix pre-existing ruff lint warnings
Mar 3, 2026
c77e621
Make ZIP filter optional in account-BG mapper
Mar 3, 2026
08b8a27
Parameterize geo scope and add domain anchors in GeoJSON exporter
Mar 3, 2026
1ce7b55
Archive superseded GeoJSON exporter
Mar 3, 2026
efa1921
Fix memory safety and rename paths in chain-of-custody script
Mar 3, 2026
2565ea1
Sync lockfile with pyproject.toml
Mar 3, 2026
097377e
Fix sign convention docs and minor review findings
Mar 3, 2026
55776d7
Remove redundant unique before n_unique in chain-of-custody
Mar 3, 2026
706214b
Allow glob patterns in billing pipeline interval-pattern
Mar 5, 2026
678b2ee
Add chunked processing to compute_hourly_loads for OOM safety
Mar 5, 2026
65b933e
Add sub-file row chunking to compute_hourly_loads
Mar 5, 2026
1de02c7
Add multi-pass merge to re-aggregation step
Mar 5, 2026
0b91130
Reduce batch size and merge fan-in for OOM safety
Mar 5, 2026
1ea44d2
Fix OOM by limiting Polars to single thread
Mar 5, 2026
9969a4e
Use streaming sink_parquet for merge passes
Mar 5, 2026
bff00e0
Reduce batch size to 100k and fan-in to 8
Mar 5, 2026
b968643
Replace final merge pass with dict-based aggregation to avoid OOM
Mar 6, 2026
c514ec6
Shard final merge by account hash to fit in memory
Mar 6, 2026
36f07f1
fix: restore hourly aggregation in sharded merge and shard bill compu…
Mar 6, 2026
91ddb3d
fix: correct STOU midday_peak prices, carry delivery_service_class th…
Mar 6, 2026
7b2e7e5
fix: preserve Categorical dtype for delivery_service_class in hourly …
Mar 6, 2026
fb32fc4
revert: remove delivery_service_class pipeline changes, keep correcte…
Mar 6, 2026
de325e1
Add output/ to .gitignore
Mar 6, 2026
7c9fae0
Remove dead files and clean up lint config
Mar 6, 2026
7deba68
Rewrite infra teardown scripts with state drift recovery
Mar 6, 2026
03aa091
Add pricing simulation report scaffold
Mar 6, 2026
8b4bfd1
Fix mkdocs and deptry CI failures
Mar 6, 2026
b36661f
Fix OOM in delivery class lookup with streaming PyArrow reader
Mar 6, 2026
a4245da
Add STOU delivery delta post-processing script
Mar 7, 2026
302d2f0
Fix inverted sign convention in GeoJSON export and bill stats scripts
Mar 9, 2026
d4f73a5
Fix hourly aggregation grain in sharded merge passes
Mar 9, 2026
7dfca22
Reduce peak memory in delivery class lookup with incremental dedup
Mar 9, 2026
2675c17
Cast delivery_service_class to Utf8 before dedup in lookup builder
Mar 9, 2026
0788c1b
Standardize pricing pilot scripts against repo conventions
Mar 9, 2026
67ddb2e
Fix OOM in delivery class lookup with set-based dedup
Mar 9, 2026
10750a9
Remove Polars lazy-scan path that OOMs before Python can catch
Mar 9, 2026
6d0e49e
Add DTOU results packaging script
Mar 9, 2026
c96c49f
Add statewide account→BG map builder from combined Parquets
Mar 10, 2026
b38400f
Add statewide BG-level pricing regression analysis script
Mar 10, 2026
ecd89c9
Fix log-income regression bug in statewide pricing analysis
Mar 10, 2026
b62e532
Add statewide GeoJSON export for pricing simulation maps
Mar 10, 2026
b6a232e
Add phase 0 repo audit script
Mar 10, 2026
6070e10
Update 2026 STOU rates and compute supply deltas inline
Mar 11, 2026
9a42c96
Add income-vs-savings scatterplot generator from combined parquets
Mar 12, 2026
25978b0
Add end-to-end pipeline audit with synthetic data verification
Mar 12, 2026
d878fd5
Write per-class BG-level CSV in statewide analysis regression loop
Mar 12, 2026
a9fb692
Add 16 per-class scenarios to GeoJSON export
Mar 12, 2026
47831ea
Add cost_change field to GeoJSON for Felt-friendly coloring
Mar 12, 2026
ba5cf72
Add income quintile analysis to statewide pipeline
Mar 19, 2026
a7b381e
Draft 1 of memo in index.qmd
Mar 19, 2026
3f9a8d8
Updated index.qmd to full draft
Mar 20, 2026
04b53cd
Wire index.qmd setup block to pickle-backed report variables
Mar 23, 2026
1d6ee79
devcontainer: switch from features to Dockerfile, raise fd limit
Mar 23, 2026
5466d76
devcontainer: fix stale yarn repo blocking chromium install
Mar 23, 2026
2757c42
devcontainer: set ulimit via runArgs
Mar 23, 2026
8c4877f
devcontainer: create /workspaces dir
Mar 23, 2026
7d63cea
fix: devcontainer startup — move venv to /opt/venv, add WORKDIR, add …
Mar 23, 2026
ac096ef
Replace analysis notebook with CUB TOU equity analysis
Mar 23, 2026
d5a8c9f
updated memo draft with correct python format to plug into notebooks/…
Mar 23, 2026
a24c5df
Fix deptry dependency issues in CI
Mar 23, 2026
741aec4
Fix deptry dependency issues in CI
Mar 23, 2026
473b47a
[smart-meter-analysis] Fix column names in analysis notebook
Mar 24, 2026
55f2026
[smart-meter-analysis] Add Quarto project config, references, and rep…
Mar 24, 2026
327b1f7
Fix month filter comparisons to use integers in assign-regression-vars
Mar 24, 2026
be1f1dd
Add Felt map iframes for DTOU and Rate BEST bill change maps
Mar 24, 2026
2e7baca
add report_variables.pkl to cache, ignore .quarto build dir
Mar 24, 2026
d4268e8
WIP: proposed edits to report
Mar 24, 2026
997a7b6
Merge branch '60-smart-meter-analysis-pricing-simulation' of https://…
Mar 24, 2026
2105d4e
Add Switchbox shared lib (plotnine theme, quarto helpers) from reports2
Mar 24, 2026
d2ad44b
Add build dependencies and uncommitted project files
Mar 24, 2026
ff89d5d
Merge branch '60-smart-meter-analysis-pricing-simulation' of https://…
Mar 24, 2026
7cce8f9
Merge branch '60-smart-meter-analysis-pricing-simulation' of https://…
Mar 24, 2026
fa9cae5
Memo draft 2 for review/comment
Mar 26, 2026
d04eddf
Proposed edits to final draft
Mar 27, 2026
c163dea
Line edits for memo
Mar 27, 2026
00ee6b0
Updated visualization titles
Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye

# Raise file descriptor limits
RUN echo "* soft nofile 65536\n* hard nofile 65536" >> /etc/security/limits.conf

# Install just
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

# Install Quarto CLI
RUN QUARTO_VERSION=1.6.42 && \
curl -LO "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-arm64.deb" && \
dpkg -i "quarto-${QUARTO_VERSION}-linux-arm64.deb" && \
rm "quarto-${QUARTO_VERSION}-linux-arm64.deb"

# Install AWS CLI v2
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf aws awscliv2.zip

# Install Chromium (remove stale yarn repo first to unblock apt-get update)
RUN rm -f /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y chromium && \
apt-get clean

# Create workspaces directory expected by devcontainer
RUN mkdir -p /workspaces/smart-meter-analysis
RUN mkdir -p /opt/venv && chown vscode:vscode /opt/venv
WORKDIR /workspaces/smart-meter-analysis
40 changes: 9 additions & 31 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,23 @@
// .devcontainer/devcontainer.json

{
"name": "smart_meter_analysis",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",

// Install Quarto CLI and Chromium
"features": {
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
"installChromium": true
},
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "chromium"
},
"ghcr.io/guiyomh/features/just:0.1.0": {
"version": "1.40.0"
},
"ghcr.io/devcontainers/features/aws-cli:1": {
"version": "2.27.4"
}
"workspaceFolder": "/workspaces/smart-meter-analysis",
"runArgs": ["--ulimit", "nofile=65536:65536"],
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},

"initializeCommand": "mkdir -p ${localEnv:HOME}/.aws",
"mounts": [
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
],
"remoteEnv": {
"AWS_REGION": "us-west-2"
},

// Run after the container is created to install uv, create .venv, and install deps
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",

// Tell Quarto to use the Python interpreter in the uv-managed virtual environment.
"containerEnv": {
"QUARTO_PYTHON": "/workspaces/smart-meter-analysis/.venv/bin/python"
"UV_PROJECT_ENVIRONMENT": "/opt/venv",
"QUARTO_PYTHON": "/opt/venv/bin/python"
},

"customizations": {
"vscode": {
"extensions": [
Expand All @@ -48,12 +30,8 @@
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,

// Use the uv-created virtual environment
"python.defaultInterpreterPath": "/workspaces/smart-meter-analysis/.venv/bin/python",
"python.testing.pytestPath": "/workspaces/smart-meter-analysis/.venv/bin/pytest",

// Let the Python extension auto-activate the environment in its own terminals
"python.defaultInterpreterPath": "/opt/venv/bin/python",
"python.testing.pytestPath": "/opt/venv/bin/pytest",
"python.terminal.activateEnvironment": true
}
}
Expand Down
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
data/
archive/
tmp_polars_*/
.mypy_cache/
.ruff_cache/
.venv/
__pycache__/
*.parquet
*.csv
.git/
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -143,6 +142,7 @@ cython_debug/
*.xlsx
*.csv
*.parquet
*.geojson
*.tsv
*.kml
*.zip
Expand All @@ -156,7 +156,10 @@ data/
# Temporary files
scratch/
*_sample_*.csv
# Ignore ad-hoc test scripts in the project root (test_foo.py scratch files)
# but keep real test files in the tests/ directory via negation pattern.
test_*.py
!tests/test_*.py
debug_*.py

# Debug files
Expand All @@ -166,9 +169,28 @@ archive/

# generated artifacts
out/
output/
results/

# benchmark artificats
profiles/
docs/*.html
docs/index_files/

# Local run artifacts (shard lists, input lists, temp dirs)
*.txt
.tmp/
archive_quarantine/
tmp_polars_run_*/
subagent_packages/

# Operator-only env (do not commit)
.env.comed

# Pricing pilot data
data/pilot_interval_parquet/
CLAUDE.md
.cursor/

/.quarto/
_manuscript/
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ repos:
args: [--autofix, --no-sort-keys]
- id: end-of-file-fixer
- id: trailing-whitespace
- id: detect-private-key

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.11.5"
rev: "v0.14.4"
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format

- repo: local
hooks:
- id: forbid-secrets
name: Block secrets and credential files
entry: "bash -c 'echo BLOCKED: secrets/credential file staged for commit >&2; exit 1'"
language: system
files: '(\.env$|\.env\.|\.secrets|\.secret|credentials\.json|\.pem$|\.key$|\.p12$|\.pfx$|\.jks$)'
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
1 change: 0 additions & 1 deletion .ruffignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
archive/
archive/
Binary file added .style/fonts/ft-bold.otf
Binary file not shown.
Binary file added .style/fonts/ft-regular.otf
Binary file not shown.
Binary file added .style/fonts/gtp-black.otf
Binary file not shown.
Binary file added .style/fonts/gtp-bold.otf
Binary file not shown.
Binary file added .style/fonts/gtp-regular.otf
Binary file not shown.
Binary file added .style/fonts/ips-bold.otf
Binary file not shown.
Binary file added .style/fonts/ips-regular.otf
Binary file not shown.
Loading
Loading