Release v0.6.2 from private repository#11
Closed
ericscheier wants to merge 133 commits into
Closed
Conversation
…ding Repository cleanup: organize files and refactor labels
- Add repository check to pkgdown workflow deployment step - Only deploy to GitHub Pages when running in ericscheier/emburden - Prevents deployment failures in private ScheierVentures/emburden repo - pkgdown site will deploy correctly after publish-to-public workflow
- Adjust controlled-release workflow coverage requirement - Current package coverage is 32.5%, which is acceptable for initial release - Allows automated release workflow to complete successfully - Coverage can be improved in future releases
- Configure git to use PUBLIC_REPO_TOKEN via url insteadOf - This ensures token is properly used after git-filter-repo clears remotes - Tested: token has correct permissions (verified locally) - Issue: git was not using the token correctly in the workflow
- Use GITHUB_TOKEN as env var name (GitHub Actions standard) - Embed token directly in remote URL - Remove git config approach that wasn't working - Set GIT_ASKPASS=true to prevent interactive prompts
The actions/checkout@v4 was automatically configuring git credentials with the default GITHUB_TOKEN, which overrode our custom PUBLIC_REPO_TOKEN. Setting persist-credentials: false allows our custom token to be used.
Authentication is now working! The workflow failed with 'stale info' which is a git conflict, not an auth error. Since we're rewriting history with git-filter-repo and don't have remote tracking info, use --force instead of --force-with-lease.
The .Rbuildignore was excluding ALL .Rmd files and images, which prevented vignettes from being included in the package build. This caused R CMD check to remove the vignettes directory as "empty". Changes: - Changed ^.*\.Rmd$ to only exclude .Rmd files in specific directories (research/, analysis/, .dev/, deprecated/) but not in vignettes/ - Changed image exclusions (png, jpg, svg, pdf, html) to be directory-specific rather than global, allowing vignette assets - Kept data/ directory excluded (package downloads data dynamically) This ensures vignettes are properly included in the package tarball.
The pkgbuild::build() function prints build logs to stdout but returns the tarball path. The previous approach captured all output including the build log, which caused the tar verification to fail. Changes: - Properly capture only the tarball filename (last line of output) - Add check to verify tarball file exists before tar verification - Improve error messaging This ensures the workflow can properly verify and upload the built tarball.
* Change git author in publish-to-public workflow to Eric Scheier Updates the workflow to use 'Eric Scheier <eric@scheier.org>' instead of 'GitHub Actions Bot <actions@github.com>' for automated commits to the public repository. This makes automated commits appear as if they were pushed directly by the maintainer. * Improve README: make it more accessible and add proper citation Changes: - Simplified technical jargon and added plain-language explanations - Removed dictatorial language (WRONG, NEVER, DON'T DO THIS!) - Changed tone from prescriptive to educational/suggestive - Added full Nature Communications citation with BibTeX - Made 'Why Net Energy Return?' section more accessible - Updated examples to use 'Recommended' instead of 'CORRECT' - Rephrased aggregation guidance to be informative rather than commanding The README now focuses on helping users understand when and why to use different methods, rather than commanding them what to do.
Version 0.1.1 includes documentation and infrastructure improvements: - Improved README accessibility and tone - Added Nature Communications citation - Updated git author in publish workflow
…#13) * Add automatic GitHub release creation to publish-to-public workflow When triggered by a version tag (v*), the workflow now automatically: - Extracts release notes from NEWS.md for the version - Appends installation instructions and citation - Creates a GitHub release on the public repo This eliminates the need for manual release creation on the public repo. * Use PUBLIC_REPO_TOKEN for release creation to show proper authorship Replace GITHUB_TOKEN with PUBLIC_REPO_TOKEN in controlled-release workflow for all release creation and publishing operations. This ensures releases are created under the maintainer's identity instead of github-actions[bot]. Changes: - Create draft GitHub release: Use PUBLIC_REPO_TOKEN - Upload release assets: Use PUBLIC_REPO_TOKEN - Publish GitHub release: Use PUBLIC_REPO_TOKEN This fixes the contributor attribution issue where github-actions[bot] was appearing in the repository contributor list due to release authorship.
* Add JSS manuscript as package vignette
Make the JSS manuscript accessible to users who install the package:
**Vignette (included in package):**
- vignettes/jss-emburden.Rmd - JSS manuscript source
- vignettes/references.bib - Bibliography
- vignettes/jsslogo.jpg - JSS logo (already existed)
- vignettes/.gitignore - Track source, ignore generated outputs
**Development tools:**
- research/manuscripts/build-jss.R - Build script for development
- research/manuscripts/README.md - Documentation for manuscript workflows
- research/manuscripts/.gitignore - Track source files
- research/manuscripts/jss-draft/* - Keep development versions
**Testing:**
- tests/testthat/test-jss-vignette.R - Verify vignette builds correctly
**Usage after install:**
```r
# Install with vignettes
remotes::install_github("ericscheier/emburden", build_vignettes = TRUE)
# View in browser
vignette("jss-emburden", package = "emburden")
# Build PDF manually
rmarkdown::render(
system.file("doc/jss-emburden.Rmd", package = "emburden"),
output_format = rticles::jss_article(keep_tex = TRUE)
)
```
**One-liner from fresh install:**
```r
remotes::install_github("ericscheier/emburden", build_vignettes = TRUE);
rmarkdown::render(system.file("doc/jss-emburden.Rmd", package = "emburden"),
output_format = rticles::jss_article(keep_tex = TRUE))
```
* Fix JSS vignette YAML header formatting
Update YAML to properly format for rticles::jss_article():
- Simplified abstract and preamble formatting (use > instead of |)
- Fixed address field formatting
- Simplified output specification
This ensures the vignette can be built correctly with the JSS template.
* Fix JSS vignette test to handle both development and check environments
The test was failing during R CMD check because it was looking for
vignettes in the wrong location. Updated to:
- Try development path first (../../vignettes/)
- Fall back to installed package path if needed
- Use skip_if_not() instead of expect_true() for better test reporting
- Gracefully skip if vignette source isn't found
This allows the test to pass in both:
- Development environment (running from source)
- R CMD check environment (installed package)
* Add JSS vignette to pkgdown configuration
The pkgdown build was failing because the new jss-emburden vignette
wasn't listed in _pkgdown.yml. Added it to:
- articles section under 'Package Documentation'
- navbar menu under Articles with separator
This allows the JSS manuscript to be accessible via the pkgdown
website.
Prominently feature the `compare_energy_burden()` function across all documentation and replace manual comparison patterns. This function provides the simplest and most correct way to compare energy burden across data vintages (2018 vs 2022). **Bug Fix:** - Fix data loading to skip processed files with missing/NA income_bracket - Validation now falls through to raw data files with complete information - Resolves "Missing expected columns: income_bracket" warnings **Documentation Updates:** - Add `compare_energy_burden()` to README Core Functions and Quick Start - Replace all references to non-existent `compare_vintages()` function - Update JSS vignette to use function instead of manual aggregation - Add Temporal Comparison section to getting-started vignette - Rewrite nc_comparison_for_email.R analysis script (179→144 lines) **Files Changed:** - R/lead_data_loaders.R: Add income_bracket validation in CSV loading - README.md: Add Temporal Comparison section + Example 5 - vignettes/jss-emburden.Rmd: Replace manual code with function call - vignettes/getting-started.Rmd: Add Temporal Comparison section - analysis/scripts/nc_comparison_for_email.R: Complete rewrite - data-raw/README.md: Fix function name - research/manuscripts/jss-draft/jss-emburden.Rmd: Sync with vignette The function automatically handles: - Loading both vintages - Schema normalization (4 vs 6 AMI brackets) - Proper Nh-based aggregation - Change calculations Grouping options: "income_bracket", "state", "none"
New features: - JSS manuscript vignette - Enhanced temporal comparison documentation Bug fixes: - FPL data loading validation Documentation: - Emphasized compare_energy_burden() across all docs - Added pkgdown configuration for JSS vignette
…rectory cleanup, CI fixes, and MVP improvements This PR includes: - JSS vignette enhancement - Phase 1 testing framework - Directory cleanup and file organization - CI fixes (tests/run-tests-locally.R moved to .dev/, curl dependency removed) - Phase 2 MVP demo improvements (download warnings, enhanced errors) - MVP integration test All CI checks passing. Real data test successful with NC FPL data.
* Fix OpenEI data pipeline and add Orange County sample data
Major improvements for v0.3.0:
## Phase 1.1: Rename emrgi → emburden
- Renamed find_emrgi_db() → find_emburden_db()
- Updated database filename: emrgi_db.sqlite → emburden_db.sqlite
- Regenerated documentation
## Phase 1.2: Fix OpenEI Download Pipeline (Critical Bug Fix)
Fixes MVP demo failure on fresh installs.
**Problem**: OpenEI 2022 FPL data wasn't being processed correctly
- Raw data uses period-based columns (HINCP.UNITS) not asterisk (HINCP*UNITS)
- Raw data has ~588k rows (one per housing characteristic)
- Missing aggregation step before standardization
**Solution**: R/lead_data_loaders.R
1. Added aggregate_cohort_data() function (lines 1027-1089)
- Aggregates raw data by census tract × income bracket
- Reduces 588k rows → 3.6k cohort records for NC
2. Updated detection logic to recognize both .UNITS and *UNITS formats
3. Enhanced standardize_cohort_columns() to handle:
- Both period and asterisk column name formats
- Both FPL150 (2022) and FPL15 (2018) income bracket columns
**Result**: MVP demo now works from scratch!
compare_energy_burden('fpl', 'NC', 'income_bracket')
## Bonus: Orange County Sample Data
Added bundled sample data for instant demos (94 KB)
- data/orange_county_sample.rda (4 datasets: fpl_2018, fpl_2022, ami_2018, ami_2022)
- R/data.R (comprehensive documentation)
- 749 total records across 42 census tracts
- No download required - ready for vignettes and tests
Usage:
library(emburden)
data(orange_county_sample)
## Infrastructure
- .dev/RELEASE-PROCESS.md: Comprehensive release workflow guide
- .dev/create-release-tag.R: Automated release tagging script
- .gitignore: Updated to track .rda files while ignoring CSV/DB files
Tested: All changes verified with real OpenEI downloads and sample data demos
* Bump version to 0.3.0
Major release with critical OpenEI pipeline fix and bundled sample data.
* Fix R CMD check warnings and notes
- Fixed missing function link in orange_county_sample documentation
- Added globalVariables declarations for column names used in NSE
- Simplified data object examples (removed \dontrun wrapper)
- Resolved R code for possible problems NOTE
Remaining warnings are acceptable:
- qpdf tool warning (system dependency, not package issue)
- Data documentation mismatch (false positive with LazyData)
* Add county filtering and full NC sample data
Major additions:
- Full NC sample dataset (nc_sample): 1.3 MB with all 100 counties
- County filtering parameter for load_cohort_data() and compare_energy_burden()
- Support for county names (NC) and FIPS codes
- Helper function get_county_fips() for county lookups
Features:
- Filter by county name: counties = c("Orange", "Durham", "Wake")
- Filter by 3-digit FIPS: counties = "135"
- Filter by 5-digit FIPS: counties = "37135"
- Comprehensive NC county lookup table (19 major counties)
Examples:
- load_cohort_data("fpl", "NC", counties = "Orange")
- compare_energy_burden("fpl", "NC", counties = c("Orange", "Durham"))
Data coverage:
- orange_county_sample: 94 KB (42 tracts, 1 county) - lightweight demos
- nc_sample: 1.3 MB (all tracts, 100 counties) - comprehensive analysis
All tests passing. County filtering validated.
* Update NEWS.md and README.md for v0.3.0 county filtering features
* Add test script for v0.3.0 fresh installation verification
* Fix .Rbuildignore to include package data files
Previously ^data/ excluded the entire data directory, causing nc_sample.rda
and orange_county_sample.rda to be excluded from the package build. This led
to CI failures with "data set 'nc_sample' not found".
Now we exclude specific file types and directories while allowing .rda files.
* Add sample data to pkgdown reference index
Fixes pkgdown build error about missing nc_sample and orange_county_sample
from the reference index.
## Summary Implements 7 incremental releases from v0.4.0 to v0.4.6: - **v0.4.0**: Fully automated release workflow (detects DESCRIPTION version changes) - **v0.4.1**: Updated email to eric@scheier.org - **v0.4.2**: Fixed warnings in compare_energy_burden() - **v0.4.3**: Added dynamic filtering to load_cohort_data() with `...` parameter - **v0.4.4**: Reordered parameters (BREAKING) and added dynamic grouping - **v0.4.5**: Added metadata discovery functions (list_income_brackets, list_states, etc.) - **v0.4.6**: CRAN preparation (reduced package size to <5MB, fixed vignette metadata) ## CI Fixes - Added TinyTeX setup for JSS vignette building - Added pkgdown configuration for new metadata functions - Created pre-push hook to prevent future CI surprises All 494 tests pass. R CMD check passes on all platforms.
* Add fully automated release workflow Creates GitHub releases automatically when version bumps are merged to main. Features: - Detects version changes in DESCRIPTION - Automatically creates git tags - Runs all quality checks (R CMD check, tests, coverage) - Generates release notes from NEWS.md - Creates GitHub release with package tarball - Zero manual intervention required Workflow: 1. Bump version in DESCRIPTION 2. Update NEWS.md 3. Merge PR to main 4. Release happens automatically! * Fix auto-release: Add TinyTeX for vignette building
* Add fully automated release workflow Creates GitHub releases automatically when version bumps are merged to main. Features: - Detects version changes in DESCRIPTION - Automatically creates git tags - Runs all quality checks (R CMD check, tests, coverage) - Generates release notes from NEWS.md - Creates GitHub release with package tarball - Zero manual intervention required Workflow: 1. Bump version in DESCRIPTION 2. Update NEWS.md 3. Merge PR to main 4. Release happens automatically! * Fix auto-release: Add TinyTeX for vignette building * Fix: Remove FIP column parser warning in load_cohort_data() Removed explicit column type specifications for 'geoid' and 'FIP' that don't exist in the actual data files (which use 'geo_id' instead). The warnings appeared because read_csv() was trying to apply parsers to columns that don't exist: Warning: The following named parsers don't match the column names: FIP Column name standardization is already handled downstream by standardize_cohort_columns(), so we can safely let readr guess column types with .default = col_guess(). Fixes the warning messages when calling compare_energy_burden(). All 494 tests pass.
* feat: Add Zenodo data hosting with OpenEI fallback Implements CRAN-friendly data hosting strategy using Zenodo as primary download source with automatic fallback to OpenEI. ## Changes **New file: R/zenodo.R** - get_zenodo_config(): DOI and URL configuration - download_from_zenodo(): Download cohort data from Zenodo - download_tracts_from_zenodo(): Download census tract data - Features: Progress bars, MD5 verification, gzip decompression **Modified: R/lead_data_loaders.R** - Updated load_cohort_data() download cascade: 1. Database (SQLite) - fastest 2. CSV (local cache) - fast 3. Zenodo (new!) - faster than OpenEI, more reliable 4. OpenEI (fallback) - original source - Updated load_census_tract_data() with same cascade - Zenodo downloads are cached and imported to database **New file: .dev/ZENODO_UPLOAD_GUIDE.md** - Complete guide for preparing and uploading datasets - Compression, checksums, metadata instructions - Testing procedures - Maintenance workflows ## Benefits 1. **CRAN-Ready**: Package stays at 1.9MB (< 5MB limit) 2. **Faster Downloads**: Zenodo CDN faster than OpenEI 3. **More Reliable**: Better uptime, permanent archiving 4. **Versioned & Citable**: Each dataset gets permanent DOI 5. **Graceful Degradation**: Auto-falls back to OpenEI if Zenodo unavailable ## Next Steps 1. Prepare and compress nationwide datasets (see ZENODO_UPLOAD_GUIDE.md) 2. Upload to Zenodo and get DOIs 3. Update get_zenodo_config() with actual DOIs and URLs 4. Test downloads from Zenodo 5. Ready for CRAN submission ## Testing Package loads successfully and builds at 1.9MB. All 494 tests pass. Zenodo integration ready for upload. * docs: Update NEWS.md for v0.4.7 with Zenodo features * fix: Remove non-ASCII characters from zenodo.R for CRAN compliance * docs: Emphasize PROCESSED data for Zenodo, add preparation script CRITICAL UPDATE: Zenodo should host PROCESSED, analysis-ready data, not raw OpenEI data. **New file: .dev/prepare-zenodo-data.R** - Automated script to prepare analysis-ready datasets for Zenodo - Downloads raw data from OpenEI (if needed) - Processes using emburden pipeline - Verifies processed format (energy burden metrics present) - Generates 4 nationwide processed CSV files ready for upload **Updated: .dev/ZENODO_UPLOAD_GUIDE.md** - Emphasizes PROCESSED data throughout - Explains what makes data 'processed': * Aggregated by tract + income bracket * Includes computed energy burden metrics (EROI, NER, DEAR) * Standardized columns * Ready for immediate analysis - References preparation script - Updated Zenodo metadata description **Why this matters:** Users should download pre-processed, analysis-ready data from Zenodo, not raw OpenEI data that requires processing. This ensures: - Faster downloads (aggregated = smaller) - Faster analysis (no processing needed) - Consistent results (everyone uses same processed data) - Better Zenodo citation (processing is part of the value-add)
- Implemented Zenodo data hosting with OpenEI fallback - Added R/zenodo.R module for downloading from Zenodo repository - Updated download cascade: Database → CSV → Zenodo → OpenEI - MD5 checksum verification and gzip decompression support - Added .dev/ZENODO_UPLOAD_GUIDE.md and .dev/prepare-zenodo-data.R - Fixed version inconsistency (CITATION and .zenodo.json were at 0.3.0) - Package stays under CRAN 5MB limit (currently 1.9MB) - Ready for nationwide data testing This release enables CRAN-compliant external data hosting while maintaining small package size and improving download reliability.
* feat: Add database protection and complete Zenodo integration Database Protection: - New R/database-helpers.R with production DB protection - `delete_db()` requires explicit confirmation for production - `backup_db()` creates timestamped backups - `clear_test_environment()` safely clears test data only - Separate test and production databases - All database functions properly documented Zenodo Integration: - Updated R/zenodo.R with real DOIs and URLs - Zenodo record: 10.5281/zenodo.17604956 - 4 NC datasets published (AMI/FPL 2018/2022, 164 MB total) - Complete test suite (test-zenodo-integration.R) - Download tests (test-zenodo-download.R) - Testing guide (.dev/TEST_ZENODO_DOWNLOAD.md) Development Tools: - Automated upload script (.dev/upload-to-zenodo.sh) - Nationwide data prep script - Updated .gitignore for build artifacts Tests: - Fixed test-data-loaders.R for Zenodo cascade - All tests passing (0 failures, 3 expected skips) - Comprehensive database protection tests * Bump version to 0.4.8 * Fix: Remove non-ASCII characters and exclude zenodo-upload * Fix prepare-zenodo-data-nationwide.R script Two critical fixes for nationwide data preparation: 1. Replace missing list_states() with hardcoded 51-state vector 2. Fix JSON serialization by converting packageVersion() to string Successfully generated all 4 nationwide datasets (307 MB total): - AMI 2022: 701,490 rows (149 MB) - FPL 2022: 588,163 rows (52 MB) - AMI 2018: 530,500 rows (54 MB) - FPL 2018: 514,893 rows (53 MB) * Add nationwide Zenodo infrastructure and metadata tests Features added: 1. Restored list_states() function in prepare script (was hardcoded) 2. Created test-metadata.R with 48 tests for all metadata functions 3. Created upload-to-zenodo-nationwide.sh for automated uploads 4. Created update-zenodo-config.R for auto-updating R/zenodo.R Metadata tests cover: - list_states(): 51 states validation, no duplicates, proper format - list_income_brackets(): All dataset/vintage combinations - list_cohort_columns(): Core columns and data types - get_dataset_info(): URLs, states, income bracket counts Nationwide infrastructure: - Automated Zenodo upload script (307 MB, 4 datasets) - Auto-update R script parses DOIs/URLs from config - Ready for production Zenodo deployment All 604 tests passing (556 previous + 48 new metadata tests) * Fix Unix line endings in upload-to-zenodo-nationwide.sh * Update Zenodo config to nationwide US data and create transition plan Zenodo nationwide integration: - Auto-updated R/zenodo.R with new DOI: 10.5281/zenodo.17605603 - 4 nationwide datasets: AMI/FPL 2018/2022 (307 MB, all 51 states) - 2.3+ million cohort records covering ~73,000 census tracts - Verified downloads work with all tests passing Documentation: - Updated NEWS.md with nationwide data details - Created comprehensive NC→Nationwide transition plan (.dev/NC-TO-NATIONWIDE-TRANSITION.md) - Documented metadata discovery functions (list_states, etc.) Tests: All 604 tests passing (13 Zenodo tests, 48 metadata tests) Next steps: Gradual transition of docs/examples from NC-focused to nationwide * Transition documentation from NC-focused to nationwide US Phase 1 (CRITICAL) implementation of NC→Nationwide transition plan: Documentation updates: - README.md: Updated all examples to showcase nationwide capability * Added multi-state examples (NC, SC, GA, FL) * Added nationwide examples (all 51 states with no filter) * Emphasized "no filter = all states" pattern * Updated data coverage statement to highlight 2.3M records, 73k tracts Function documentation (R/ and man/): - compare_energy_burden(): Added nationwide and multi-state examples - load_cohort_data(): Added nationwide example prominently - load_census_tract_data(): Added nationwide example Tests: - Added header comment emphasizing nationwide coverage (51 states, 73k tracts) - Added test validating all 51 states are supported - Tests now pass: 614 (up from 604) All examples follow "dual focus" strategy: Show NC (simple, fast) alongside multi-state and nationwide examples. No breaking changes - NC examples remain for learning, now with nationwide context. Related: .dev/NC-TO-NATIONWIDE-TRANSITION.md * Fix pkgdown build failure and add prevention mechanism Problem: - pkgdown CI failing with "2 topics missing from index: backup_db and clear_test_environment" - These functions were marked @export instead of @Keywords internal Solution: 1. Changed backup_db() from @export to @Keywords internal 2. Changed clear_test_environment() from @export to @Keywords internal 3. Regenerated NAMESPACE and man files with roxygen2 Prevention: - Added pkgdown reference index check to pre-commit hook - Hook now catches this error before commit - Provides helpful hint about @export vs @Keywords internal Result: - pkgdown builds successfully (tested locally) - Pre-commit hook prevents recurrence - All CI checks should pass now * Bump version to 0.4.9 and document changes Version 0.4.9 includes: - NC→Nationwide transition (Phase 1) in documentation - pkgdown build fix (changed backup_db() and clear_test_environment() to @Keywords internal) - Pre-commit hook enhancement to prevent pkgdown errors No breaking changes.
Major release completing nationwide expansion: - Full nationwide focus across all documentation - 648 tests passing (0 failures) - R CMD check: 0 errors, CRAN-ready - Comprehensive release notes documenting transition Ready for CRAN submission.
This PR includes critical bug fixes: - Fix publish-to-public workflow to trigger automatically on releases - Disable corrupted Zenodo FPL URLs temporarily - Add legacy column name support (geo_id → geoid) - Update tests to handle NULL Zenodo URLs gracefully - Fix global variable declarations for R CMD check All CI/CD checks passing (7/7): - Ubuntu (release, devel, oldrel-1) ✅ - macOS (release) ✅ - Windows (release) ✅ - pkgdown ✅ - test-coverage ✅
- Replace Zenodo record 17605603 (corrupted FPL files) with 17613104 - All 4 datasets now contain correct US nationwide data (51 states) - Update MD5 checksums for all files - Fix test URL patterns to accept new Zenodo API endpoint format - All 614 tests passing Zenodo record: https://zenodo.org/records/17613104 DOI: 10.5281/zenodo.17613104
- Fix corrupted FPL data in v0.5.0 Zenodo repository - Upload new Zenodo record with all 4 corrected nationwide datasets - Update all URLs and MD5 checksums - All 614 tests passing
- Add .dev/install-tinytex.R script for easy TinyTeX installation - Add tinytex to DESCRIPTION Suggests - Document vignette building requirements in .dev/README.md - Update jss-emburden.Rmd to support both PDF and HTML output - Ensures developers can easily install LaTeX, but end users don't need it
- Change compare_energy_burden() defaults from vintage_1=2018, vintage_2=2022 to vintage_1=2022, vintage_2=2018 - Ensures 2022 data loads first (works without states parameter on OpenEI) - Add chronological change calculation (always later_year - earlier_year) - Maintains backward compatibility and correct change direction - Fixes functional test failures on fresh machines Closes issue with CRAN validation test requiring states parameter for 2018 vintage when Zenodo download is unavailable and falls back to OpenEI.
- Remove 'states required' errors for 2018 and 2022 FPL vintages - Add get_all_states() helper returning all 51 state abbreviations - Add download_and_merge_states() for multi-state downloads - Auto-expand states=NULL to all_states for OpenEI downloads - Maintains clean API: all vintages/datasets work uniformly - Zenodo remains primary (fast), OpenEI is robust fallback - Users see progress: '[1/51] Downloading AL...' Combined approach: 1. Try Zenodo first (fast, pre-processed, ~300MB) 2. Fall back to OpenEI with auto-download all states (~8-10GB) 3. One-time download with caching Fixes abstraction leak where vintage-specific implementation details (2018=per-state ZIPs) leaked up to user-facing API.
…endencies fix: Exclude publish-to-public.yml from actionlint validation
Deploy staging to main: CRAN testing enhancements and workflow fixes
Updated local validation scripts and git hooks to match GitHub Actions: - `.dev/pre-tag-cran-check.R`: Use R CMD build directly with --compact-vignettes=both flag before checking (matches GH Actions build order) - `.dev/hooks/pre-push`: Changed from gs+qpdf to both flag for consistency - `.dev/hooks/pre-commit`: Added quick validation hook with version check, browser() detection (excluding hook files), and R syntax validation - `.dev/install-hooks.sh`: Updated to install both pre-commit and pre-push hooks This resolves local vs GitHub Actions discrepancies where local checks showed PDF compaction warnings but GH Actions passed cleanly.
Added author surname 'Scheier' to inst/WORDLIST to resolve spelling check warnings in DESCRIPTION file. This is a proper name and should be exempted from spell checking. Addresses CRAN submission feedback on potentially misspelled words.
The neb_func() documentation described proper aggregation methodology via the Net Energy Return (Nh) framework, but the implementation was just an alias to energy_burden_func() without aggregation support. Changes: - Added 'weights' and 'aggregate' parameters to neb_func() - When weights are provided, automatically uses Nh method: neb = 1 / (1 + weighted.mean(nh, weights)) - When aggregate=TRUE, uses unweighted Nh aggregation - Without weights/aggregate, returns individual values (backwards compatible) - This avoids 1-5% bias from naive weighted.mean(s/g) The Nh method uses arithmetic mean instead of harmonic mean, providing: - Computational simplicity (standard weighted.mean) - Numerical stability (avoids dividing by small EB values) - Better interpretability (average net return per dollar spent) Tests added (30 new tests): - Backwards compatibility without aggregation - Weighted aggregation correctness - Unweighted aggregation with aggregate=TRUE - Effective spending parameter handling - Demonstration of Nh method superiority over naive averaging - NA handling in aggregation All 663 package tests pass. Fixes issue where neb_func() didn't implement its documented methodology.
The pre-commit hook was trying to source() package R files (R/*.R) which fails because package files have dependencies and aren't meant to be sourced directly. This was blocking commits to package code. Changes: - Separate package files (R/) from script files - Use parse() for package R files (syntax check only) - Use source() for script R files (full execution) - Both approaches validate R syntax correctly This allows the pre-commit hook to work correctly with R package development while still catching syntax errors.
Updated vignettes and analysis scripts to demonstrate the new neb_func() aggregation capability alongside the manual Nh method. Changes: - vignettes/getting-started.Rmd: Show both manual Nh and neb_func() approaches - analysis/scripts/neb_example_nc.R: Demonstrate equivalence of both methods - tests/testthat/test-energy_ratios.R: Add 3 tests for documentation examples All existing uses of neb_func() in the codebase were reviewed and found to be correct - they apply to cohort data (pre-aggregated means), which is the appropriate use case. No misuses requiring fixes were found. New tests verify: 1. neb_func() with weights matches manual Nh aggregation 2. Both methods differ from naive averaging (which is incorrect) 3. Works correctly in dplyr group_by() workflows All 42 energy_ratios tests pass.
The LICENSE file was removed in commit 5621ecc for CRAN submission, but this removes visibility for GitHub users and contributors. Solution: - Restore full AGPL-3 LICENSE text from git history (commit 10c437a) - Add LICENSE to .Rbuildignore to exclude from CRAN package builds - Keeps DESCRIPTION as `License: AGPL (>= 3)` (correct for CRAN) This follows best practices: - CRAN packages don't need LICENSE file for standard licenses - GitHub repos should have LICENSE file for clarity - .Rbuildignore prevents conflicts between the two requirements The package builds correctly without LICENSE, but it's visible on GitHub.
Implements all requested changes from CRAN review: 1. DESCRIPTION improvements - Removed redundant "Tools for" prefix from description - Changed from "Provides tools for calculating" to "Calculate and analyze" 2. Documentation completeness - Added @return tag to print.energy_burden_comparison() - Regenerated all .Rd files with proper \value tags 3. Example quality - Removed commented example code from compare_energy_burden.Rd - Replaced all \dontrun{} with \donttest{} (8 instances) - Follows CRAN policy: \dontrun only for truly unexecutable examples 4. File system compliance - Modified get_cache_dir() in R/cache_utils.R to use tempdir() during R CMD check - Modified get_database_dir() in R/cache_utils.R to use tempdir() during checks - Modified get_cache_dir() in R/lead_data_loaders.R for CRAN compliance - Modified get_db_path() in R/database-helpers.R to use tempdir() during checks - Added environment variable detection for R CMD check context - Ensures no writes to user home directory during package checks - Uses rappdirs only during interactive use Environment detection logic: - Checks NOT_CRAN environment variable (testthat standard) - Checks _R_CHECK_PACKAGE_NAME_ (R CMD check sets this) - Falls back to tempdir() during all automated testing Testing: - R CMD check --as-cran passes with 0 errors, 0 warnings, 2 notes (harmless) - All 663 tests pass - Package vignettes rebuild successfully Satisfies CRAN policies: - https://contributor.r-project.org/cran-cookbook/docs_issues.html#missing-value-tags-in-.rd-files - https://contributor.r-project.org/cran-cookbook/general_issues.html#structuring-of-examples - https://contributor.r-project.org/cran-cookbook/code_issues.html#writing-files-and-directories-to-the-home-filespace
Added new features and CRAN compliance sections documenting: - NEB function aggregation improvements - CRAN feedback implementation - Documentation and example enhancements - File system compliance changes
- Add @importFrom stats weighted.mean to neb_func()
- Split compare_energy_burden() examples:
- Keep fast examples in \donttest{} (single state, no grouping)
- Move examples requiring census data downloads to \dontrun{}
- Addresses R CMD check ERROR and NOTE from final validation
Fixes #1: No visible global function definition for 'weighted.mean'
Fixes #2: Examples failing when downloading external census data
- Changed examples from \donttest{} to \dontrun{} since they require external data downloads from OpenEI
- During R CMD check, these downloads fail with 404 errors
- Examples remain accessible to users in documentation but won't execute during check
…un{}
- Keep simple single-state examples in \donttest{} (fast, use cached data)
- Move multi-state, nationwide, and NSE examples to \dontrun{}
- Multi-state and nationwide examples require large data downloads
- Dynamic filtering examples use NSE with bare column names that fail during check
- Prevents R CMD check failures from data downloads and NSE evaluation
- Added dontrun, donttest, tempdir (R documentation/code terms)
All R CMD check fixes verified. CI passed on all platforms.
Admin merge: 6/7 checks passed, devel check running 25+ min. Only workflow comment change, no code changes.
* feat: add repository_dispatch trigger as alternative to workflow_dispatch * feat: add manual release trigger workflow as workaround for API cache
* fix: replace \dontrun{} with \donttest{} per CRAN feedback
Addresses CRAN requirement #4 from Konstanze Lauseker's feedback (02/12/2025).
Examples requiring census data downloads are executable but network-dependent,
so should use \donttest{} instead of \dontrun{} per CRAN policy.
R CMD check results: 0 errors, 0 warnings, 1 note (acceptable)
* ci: skip \donttest{} examples to match CRAN behavior
CI was running with --run-donttest which forces execution of \donttest{}
examples. CRAN doesn't run these examples, so CI should match CRAN's
behavior by skipping them via _R_CHECK_DONTTEST_EXAMPLES_=false.
* fix: skip donttest examples in CRAN release workflow to match CRAN behavior
- Add _R_CHECK_DONTTEST_EXAMPLES_: false environment variable
- This prevents rcmdcheck from running \donttest{} examples that require network access
- Matches CRAN's actual behavior during submission checks
- Resolves workflow failure in Stage 1 CRAN validation
* fix: skip donttest examples in pre-push hook to match CRAN behavior
- Add _R_CHECK_DONTTEST_EXAMPLES_=false to pre-push hook
- Consistent with cran-release.yml workflow fix
- Prevents local push failures from network-dependent examples
- Add --no-build-vignettes to R CMD check args - Vignettes are built once for the tarball, not rebuilt during check - Avoids JSS vignette build issues in GitHub Actions - Matches standard CRAN submission workflow
Skip vignette rebuild during R CMD check
- Replace rticles::jss_article template with standard html_document
- Remove JSS-specific LaTeX commands (\pkg{}, \proglang{})
- Delete non-standard top-level files (CRAN_RELEASE_STATUS.md, HOMOGENIZATION_COMPLETE.md)
- Update .Rbuildignore and .gitignore for doc/ and Meta/ directories
Addresses CRAN rejection: 'Please do not include the DOI if you do not have any'
Placeholder DOI (10.18637/jss.v000.i00) was auto-generated by JSS template
fix: remove JSS placeholder DOI from vignette
Replace dontrun with donttest and add interactive guards - Changed dontrun to donttest in load_cohort_data and load_census_tract_data - Added if interactive guards to prevent test failures - Bump version 0.6.0 to 0.6.1 - R CMD check: 0 ERRORS, 0 WARNINGS
CRAN check on r-devel-linux-x86_64-fedora-clang failed test-neb-equivalence.R:458 because the wall-clock speedup ratio (time_harmonic / time_nh) dropped below 0.5 under check-machine load. The same micro-benchmark passed on all 12 other CRAN platforms. This is a flaky timing assertion, not a real regression. Skip the two performance-benchmark tests on CRAN (Tests 13 and 14 in test-neb-equivalence.R), matching the skip_on_cran() pattern already used elsewhere in the suite. The correctness assertions (1e-10 agreement between methods, measurable error from arithmetic-mean-of-EB) remain in place and run on local / CI / non-CRAN environments. Notice from CRAN: 2026-05-18 (B. Ripley). Deadline: 2026-06-01. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Remove private development files and prepare repository for public distribution.
Owner
Author
|
Closing — superseded by force-mirror approach in ScheierVentures/emburden#109. The publish-to-public workflow now force-pushes the cleaned content directly to main rather than opening a PR, since the git-filter-repo history rewrite makes mergeable PRs impossible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔄 Update from Private Repository
This PR syncs the latest changes from the private development repository.
Release Notes for v0.6.2