Skip to content

Add script to call zi-budget-analysis#776

Draft
chengzhuzhang wants to merge 1 commit intomainfrom
water_energy_budget
Draft

Add script to call zi-budget-analysis#776
chengzhuzhang wants to merge 1 commit intomainfrom
water_energy_budget

Conversation

@chengzhuzhang
Copy link
Copy Markdown
Collaborator

Issue resolution:

Summary

Implements a new budget task in zppy that analyzes water and energy conservation from E3SM coupler log files,
generating interactive HTML visualizations and ASCII summary tables.

Key Changes

  • New zppy task: zppy/budget.py following established zppy patterns (year1/year2, bundling, status tracking)
  • Bash template: zppy/templates/budget.bash for job execution
  • External CLI tool: Budget analysis logic in zppy-interfaces package as zi-budget-analysis
  • Integration: Added budget task to main zppy workflow

Features

  • Interactive plots: Bokeh-based HTML visualizations with PNG fallbacks
  • ASCII summaries: Tabular budget data for analysis
  • Configurable: Support for water and heat budget types
  • Standard workflow: Uses existing zppy parameters (input, case, years, output, www)

Architecture

Follows zppy conventions by calling external CLI tool (zi-budget-analysis) rather than embedding analysis logic
directly, keeping zppy focused on orchestration while leveraging specialized tools in zppy-interfaces.

Usage

[budget]
active = True
years = "1:100:50"
budget_types = "water,heat"

Generates web-viewable budget conservation plots at {www}/{case}/budget/{year1}-{year2}/budgets.html

Select one: This pull request is...

  • a bug fix: increment the patch version
  • a small improvement: increment the minor version
  • a new feature: increment the minor version
  • an incompatible (non-backwards compatible) API change: increment the major version

Please fill out either the "Small Change" or "Big Change" section (the latter includes the numbered subsections), and delete the other.

Small Change

  • To merge, I will use "Squash and merge". That is, this change should be a single commit.
  • Logic: I have visually inspected the entire pull request myself.
  • Pre-commit checks: All the pre-commits checks have passed.

Big Change

  • To merge, I will use "Create a merge commit". That is, this change is large enough to require multiple units of work (i.e., it should be multiple commits).

1. Does this do what we want it to do?

Required:

  • Product Management: I have confirmed with the stakeholders that the objectives above are correct and complete.
  • Testing: I have added or modified at least one "min-case" configuration file to test this change. Every objective above is represented in at least one cfg.
  • Testing: I have considered likely and/or severe edge cases and have included them in testing.

If applicable:

  • Testing: this pull request introduces an important feature or bug fix that we must test often. I have updated the weekly-test configuration files, not just a "min-case" one.
  • Testing: this pull request adds at least one new possible parameter to the cfg. I have tested using this parameter with and without any other parameter that may interact with it.

2. Are the implementation details accurate & efficient?

Required:

  • Logic: I have visually inspected the entire pull request myself.
  • Logic: I have left GitHub comments highlighting important pieces of code logic. I have had these code blocks reviewed by at least one other team member.

If applicable:

  • Dependencies: This pull request introduces a new dependency. I have discussed this requirement with at least one other team member. The dependency is noted in zppy/conda, not just an import statement.

3. Is this well documented?

Required:

  • Documentation: by looking at the docs, a new user could easily understand the functionality introduced by this pull request.

4. Is this code clean?

Required:

  • Readability: The code is as simple as possible and well-commented, such that a new team member could understand what's happening.
  • Pre-commit checks: All the pre-commits checks have passed.

If applicable:

  • Software architecture: I have discussed relevant trade-offs in design decisions with at least one other team member. It is unlikely that this pull request will increase tech debt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: add water and energy budget plots

1 participant