Skip to content

fix: error message when no overlapping periods - #1723

Merged
jsolaas merged 3 commits into
mainfrom
fix/compare-error
Aug 19, 2026
Merged

fix: error message when no overlapping periods#1723
jsolaas merged 3 commits into
mainfrom
fix/compare-error

Conversation

@jsolaas

@jsolaas jsolaas commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@jsolaas
jsolaas requested a review from a team as a code owner August 19, 2026 07:49
Comment thread src/libecalc/presentation/simple_result/simple.py Outdated
Co-authored-by: Aleksander Karlsson <AMKA@equinor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the compare/delta-profile flow for SimpleResultData by explicitly failing fast when two models have no overlapping time periods, instead of proceeding into period-union logic that cannot produce a meaningful delta.

Changes:

  • Add an explicit overlap check (first_date >= last_date) in SimpleResultData.delta_profile.
  • Raise EcalcError with a compare-specific title/message when models do not overlap.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/libecalc/presentation/simple_result/simple.py Outdated
Comment on lines +390 to +392
if first_date >= last_date:
raise EcalcError(title="Compare error", message="The models periods does not overlap.")

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jsolaas
jsolaas merged commit 1ae64c7 into main Aug 19, 2026
23 checks passed
@jsolaas
jsolaas deleted the fix/compare-error branch August 19, 2026 08:02
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.

4 participants