Skip to content

Fix naming of some activity/capacity-related things#441

Merged
alexdewar merged 6 commits intomainfrom
activity-naming
Mar 24, 2025
Merged

Fix naming of some activity/capacity-related things#441
alexdewar merged 6 commits intomainfrom
activity-naming

Conversation

@alexdewar
Copy link
Copy Markdown
Member

Description

I've a renamed a couple of activity-related things for consistency/clarity:

  1. I renamed the cap2act field and CSV column to capacity_to_activity. We've previously expanded out these kinds of abbreviations elsewhere and I think it makes things more readable. (I suppose we could name it something else, like activity_per_capacity instead)
  2. For the map which we use to work out capacity/availability constraints, I think we should be talking about "activity limits" rather than "capacity limits". I've renamed some data structures and fields to reflect this. This makes sense to me, but please let me know if you think I'm not using the term activity correctly.

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@alexdewar alexdewar requested review from TinyMarsh and tsmbland and removed request for tsmbland March 11, 2025 16:58
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.11%. Comparing base (55d7c49) to head (740ae51).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #441   +/-   ##
=======================================
  Coverage   95.11%   95.11%           
=======================================
  Files          32       32           
  Lines        4751     4752    +1     
  Branches     4751     4752    +1     
=======================================
+ Hits         4519     4520    +1     
  Misses        119      119           
  Partials      113      113           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexdewar
Copy link
Copy Markdown
Member Author

I've realised we still use the term capacity_a in the docs although I've changed the code to call it maximum_activity. Probably doesn't matter for now.

@alexdewar alexdewar added this to MUSE Mar 11, 2025
@alexdewar alexdewar moved this to 👀 In review in MUSE Mar 11, 2025
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland left a comment

Choose a reason for hiding this comment

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

A couple of comments, otherwise looks good

@@ -1,4 +1,4 @@
process_id,start_year,end_year,capital_cost,fixed_operating_cost,variable_operating_cost,lifetime,discount_rate,cap2act
process_id,start_year,end_year,capital_cost,fixed_operating_cost,variable_operating_cost,lifetime,discount_rate,capacity_to_activity
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think cap2act is used in other energy systems models so we might consider keeping this. Maybe @ahawkes can comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, interesting. I assumed it was a MUSE-ism. If spelling it out sounds silly to economists, then let's leave it as is.

We could always spell it out in the code and leave it abbreviated in the CSV column names if we wanted to.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ahawkes do you have an opinion on this? It'd be good to get this PR merged in some form soonish so that we don't get merge conflicts.

Comment thread src/agent.rs Outdated

/// Maximum activity for this asset in a year.
///
/// This was referred to as `capacity_a` in MUSE 1.0.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nope, no such thing as capacity_a in muse1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh ok. Is it just referred to as maximum activity or something?

@alexdewar alexdewar linked an issue Mar 12, 2025 that may be closed by this pull request
3 tasks
@alexdewar alexdewar enabled auto-merge March 24, 2025 17:53
@alexdewar alexdewar merged commit f64dcee into main Mar 24, 2025
7 checks passed
@alexdewar alexdewar deleted the activity-naming branch March 24, 2025 17:55
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in MUSE Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Process-related tidy-ups

3 participants