Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Equation.indexsets optional #164

Open
wants to merge 3 commits into
base: enh/introduce-optimization-item-delete
Choose a base branch
from

Conversation

glatterf42
Copy link
Member

Working on the ixmp4 shim, I discovered that our assumption that Equations must always be constrained to IndexSets is wrong: in message_ix, there are numerous examples of Equations not linked to IndexSets.

This PR includes some minor improvements to the code, but mainly makes the Equation.indexsets attribute optional.

TODO

  • I'm not sure the changes here need their own DB migration. It looks like only an ORM attribute/property is affected, but make sure that's true; otherwise, include the migrations.

@glatterf42 glatterf42 added the enhancement New feature or request label Feb 12, 2025
@glatterf42 glatterf42 requested a review from meksor February 12, 2025 10:46
@glatterf42 glatterf42 self-assigned this Feb 12, 2025
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.6%. Comparing base (2895604) to head (f907393).

Additional details and impacted files
@@                          Coverage Diff                           @@
##           enh/introduce-optimization-item-delete    #164   +/-   ##
======================================================================
  Coverage                                    88.6%   88.6%           
======================================================================
  Files                                         223     223           
  Lines                                        8192    8200    +8     
======================================================================
+ Hits                                         7264    7272    +8     
  Misses                                        928     928           
Files with missing lines Coverage Δ
ixmp4/core/optimization/equation.py 93.3% <100.0%> (ø)
ixmp4/data/abstract/optimization/equation.py 97.1% <100.0%> (ø)
ixmp4/data/api/optimization/equation.py 94.4% <100.0%> (ø)
ixmp4/data/db/optimization/equation/model.py 100.0% <100.0%> (ø)
ixmp4/data/db/optimization/equation/repository.py 98.8% <100.0%> (+0.1%) ⬆️
ixmp4/data/db/optimization/parameter/repository.py 96.8% <100.0%> (ø)
ixmp4/data/db/optimization/table/repository.py 98.7% <100.0%> (ø)
ixmp4/data/db/optimization/variable/repository.py 98.8% <100.0%> (ø)
ixmp4/data/db/region/repository.py 100.0% <100.0%> (ø)
ixmp4/server/rest/optimization/equation.py 97.5% <100.0%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant