Skip to content

Conversation

@ParticularlyPythonicBS
Copy link
Member

@ParticularlyPythonicBS ParticularlyPythonicBS commented Sep 7, 2025

Notes provided by @mikeblackhurst

Summary of changes to address errors and warnings triggered by Temoa v3 codebase

  1. Lifetime fixes
    Added missing technology lifetimes
    Adjusted lifetimes for a few technologies so they match actual intended retirement dates to preserve network integrity

  2. Reconciled differences between Efficiency and TechInputSplit tables:
    Removed orphaned or mismatched technology–region–commodity combinations.
    Dropped TechInputSplit rows where the technology did not also exist in Efficiency.
    For solar residential water heaters (e.g., R_WH_SOLST_ELC_N), replaced electric inputs (ELC) with corrected labels (ELC_RES).
    Fixed a known missing input for C_WH_SOLST_ELC_N by adding it back with a substitute input.

  3. Unlimited capacity (unlim_cap) technologies
    For unlimited-capacity technologies, removed unnecessary vintage records (only kept the earliest valid vintage).
    Ensured costs are applied to all planning periods (so these technologies don’t lose cost data in later years).
    Added missing cost entries for extended lifetimes
    Marked additional industrial heat, blending, steel, hydrogen, and transport biofuel technologies as unlimited capacity (unlim_cap =

  4. Cost fixes
    Removed CostFixed entries that were clearly zero-cost database errors (e.g., for I_ISF_EAF technologies).
    Added missing variable costs for certain technologies

  5. Commodity label cleanup
    Standardized all commodities labeled “ELCP_*” (except those with _DC) to simply “ELCP” across Efficiency, TechInputSplit, EmissionActivity, MyopicEfficiency, and Commodity tables.

Summary of changes made for numerical stability

  1. TechInputSplit
    Removed extremely small (negligible) input split constraints

  2. Water transport

    Increased the demand for tugboats used for inland barge transportation (commodity = TMDHDV_WTT) to be similar to values reported at
    https://ndclibrary.sec.usace.army.mil/searchResults?series=Fact%20Cards

    Efficiency of tugboat technologies (tech = T_HDV_WTT) changed based upon:.
    Kruse CJ, Farzaneh R, Glover B, et al. A modal comparison of domestic freight transportation effects on the general public: 2001–2019. Published online 2021. Accessed September 4, 2025. https://rosap.ntl.bts.gov/view/dot/60644

    All references to water passenger transportation were moved because they were negligible (commodity = TMDHDV_WTP)

  3. Soybeans Technologies Consolidation
    Soybeans_STEP70, STEP80, and STEP90 merged into a single Soybeans_STEP80 technology

  4. Demand Specific Distributions
    Very small demand values (< 1e-4) in DemandSpecificDistribution reallocated to the nearest larger neighbor (based on season and time-of-day order).
    Values normalized so that each distribution still sums to exactly 1 per region and demand type.

Units

Defined all physical, monetary, and time units in affected tables. 

Miscellaneous

Removed most pathways created for the purposes of accounting flows for single studies 

Summary by CodeRabbit

  • Chores
    • Added a new dataset entry to the top-level manifest with initial versioning and metadata for tracking and retrieval.
    • Ensures the dataset can be consistently referenced and fetched across environments.
    • No changes to the user interface or any user-facing behavior.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Walkthrough

Added a new top-level manifest entry for US_9R_8D_v3_stability.sqlite in manifest.json, setting latestVersion to "v1" and adding an initial history record with timestamp, sha256, r2 keys, diffFromPrevious: null, and commit/description set to "pending-merge".

Changes

Cohort / File(s) Summary of Changes
Manifest update
manifest.json
Appended a new manifest item for fileName "US_9R_8D_v3_stability.sqlite" with latestVersion "v1" and a single history entry containing version metadata (timestamp, sha256, r2_object_key, staging_key), diffFromPrevious: null, and commit/description set to "pending-merge".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nose the manifest, hop and see,
A shiny v1 sprouts on the tree.
Hashes hum, keys align just right,
"Pending-merge" beneath moonlight.
One more carrot in our crate— I can’t wait! 🥕✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mike-db3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Sep 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
manifest.json (1)

46-47: Replace placeholders at merge for traceability.

Swap "pending-merge" with the actual merge commit SHA and a meaningful description when merging.

Apply on merge:

-        "commit": "pending-merge",
-        "description": "pending-merge"
+        "commit": "<merge-commit-sha>",
+        "description": "OEO database compatible with Temoa v3; initial v1 release (PR #35)."
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b69a67d and 15c7779.

📒 Files selected for processing (1)
  • manifest.json (1 hunks)
🔇 Additional comments (2)
manifest.json (2)

35-49: New manifest entry looks consistent.

Fields match existing schema patterns; versioning, timestamp format, sha256 length, and object key paths look correct for an initial v1.


35-49: Correct manifest integrity check script — quoting errors in the shell snippet prevent it from running. Update the script to validate:

  • unique fileName values
  • latestVersion equals the last history entry’s version
  • v1 entries have diffFromPrevious: null
  • all sha256 fields are 64 characters
  • every r2_object_key ends with .sqlite

Co-authored-by: mikeblackhurst <mfb@andrew.cmu.edu>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
manifest.json (2)

44-44: Confirm downstream tolerance for the new optional field "staging_key".

Older entries don’t include this field. If consumers validate against a fixed schema, this could break them. Consider documenting it as optional or stripping it at publish time.

Apply this if you decide to omit it from the committed manifest:

-        "staging_key": "staging-uploads/a3b3a8f27bf422a8a15ca2e0ae3b08cc43956c73de0e0a766d754e8a46e032c4.sqlite",

46-47: Replace placeholders; populate a concise description now and commit hash on merge.

Keep "commit" as a placeholder only if your release script overwrites it. Recommend filling "description" with a human-readable summary from this PR.

-        "commit": "pending-merge",
-        "description": "pending-merge"
+        "commit": "pending-merge",
+        "description": "Temoa v3 OEO DB: lifetimes/cost fixes, ELCP label cleanup, unlim-cap flags, units, and numerical-stability adjustments (PR #35)."
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15c7779 and a4df421.

📒 Files selected for processing (1)
  • manifest.json (1 hunks)
🔇 Additional comments (2)
manifest.json (2)

35-49: LGTM: new manifest entry is well-formed and consistent with existing structure.

Fields, ISO-8601 UTC timestamp, and r2 key naming look correct. No blocking issues.


35-49: All invariants for US_9R_8D_v3_stability.sqlite verified
All checks (latestVersion, SHA-256 format, key containment, timestamp format, commit placeholder) passed.

@ParticularlyPythonicBS ParticularlyPythonicBS marked this pull request as draft September 10, 2025 17:04
@ParticularlyPythonicBS ParticularlyPythonicBS added database update update to the cloudflare R2 bucket and associated manifest and removed enhancement New feature or request labels Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database update update to the cloudflare R2 bucket and associated manifest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants