Skip to content

Conversation

@berland
Copy link
Contributor

@berland berland commented Dec 23, 2025

No description provided.

@berland berland self-assigned this Dec 23, 2025
@berland berland added this to SCOUT Dec 23, 2025
@berland berland moved this to Ready for Review in SCOUT Dec 23, 2025
@berland berland moved this from Ready for Review to In Progress in SCOUT Dec 23, 2025
They should be since we provide None as a default value. This allows sending
empty arguments into the Date class, and resolves ruff PIE rules.
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 93.93939% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.21%. Comparing base (cad5cb7) to head (027ffe0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/everest_models/everest_hooks.py 0.00% 2 Missing ⚠️
...erest_models/jobs/fm_extract_summary_data/tasks.py 0.00% 1 Missing ⚠️
src/everest_models/jobs/shared/models/phase.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
- Coverage   84.28%   84.21%   -0.07%     
==========================================
  Files         133      133              
  Lines        3340     3339       -1     
==========================================
- Hits         2815     2812       -3     
- Misses        525      527       +2     

☔ 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.

Copy link

Copilot AI left a comment

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 updates the project to solve and enforce additional ruff linting rulesets, modernizing the codebase to comply with more comprehensive Python best practices and code quality standards.

Key changes:

  • Expanded ruff linting rules to include 30+ additional rulesets covering bug detection, performance, best practices, and code simplification
  • Applied automatic fixes for existing violations across test and source files
  • Updated pre-commit hooks to use the latest ruff version (v0.14.10)

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Expanded ruff linting rules from 5 to 30+ rulesets covering bugs, performance, best practices, and more
.pre-commit-config.yaml Updated ruff version from v0.12.11 to v0.14.10 and changed hook ID from ruff to ruff-check
tests/jobs/well_trajectory/test_well_trajectory_resinsight.py Fixed ModuleNotFoundError instantiation to call without arguments
tests/jobs/well_swapping/test_well_swapping_tasks.py Removed commented-out assertion line
tests/jobs/well_constraints/test_well_constraints_cli.py Converted elif to if and added explicit return None for code path completeness
tests/jobs/shared/test_validators.py Fixed string concatenation to use raw f-string for regex pattern
tests/jobs/drill_planner/strategies.py Removed commented import statement
tests/docs/test_reference_schemas.py Added assertion message for better test failure diagnostics
src/everest_models/logger.py Changed deprecated logging.WARN to logging.WARNING
src/everest_models/jobs/shared/models/phase.py Added explicit return None to missing method
src/everest_models/jobs/shared/models/economics.py Updated type annotations to use union syntax (date | None) and simplified lambda expression
src/everest_models/jobs/shared/currency.py Reorganized comments to follow the code they describe
src/everest_models/jobs/fm_well_trajectory/*.py Standardized numpy imports to use 'np' alias across multiple files
src/everest_models/jobs/fm_well_swapping/state_machine.py Renamed variable from 'df' to 'state_matrix' for clarity
src/everest_models/jobs/fm_well_swapping/models/state.py Converted elif to if and simplified conditional expression using min()
src/everest_models/jobs/fm_well_swapping/models/config.py Added explicit return None
src/everest_models/jobs/fm_well_constraints/models/config.py Removed commented-out code
src/everest_models/jobs/fm_extract_summary_data/tasks.py Updated return type annotation to include None and added explicit return None
src/everest_models/jobs/fm_drill_planner/planner/greedy.py Added explicit return None for completeness
src/everest_models/jobs/fm_compute_economics/manager.py Added explicit return None
src/everest_models/jobs/fm_compute_economics/economic_indicator_config_model.py Removed commented-out code
src/everest_models/jobs/fm_add_templates/cli.py Refactored to use more concise list comprehension
src/everest_models/everest_hooks.py Modernized string prefix removal using str.removeprefix()
docs/reference/npv/config.yml Updated template values for date fields
docs/reference/compute_economics/config.yml Updated template values for date fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +50 to +60
start_date: <REPLACE>

# Datatype: date
# Examples: 2024-01-31, 2024-01-31T11:06
# Required: False
# Default: null
end_date: null
end_date: <REPLACE>

# Datatype: date
# Examples: 2024-01-31, 2024-01-31T11:06
# Required: False
# Default: null
ref_date: null
ref_date: <REPLACE>
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Replacing null with <REPLACE> for optional fields with default null values is incorrect. These fields are marked as "Required: False" and have "Default: null", so they should remain as null rather than <REPLACE>. The <REPLACE> marker should only be used for required fields.

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +60
start_date: <REPLACE>

# Datatype: date
# Examples: 2024-01-31, 2024-01-31T11:06
# Required: False
# Default: null
end_date: null
end_date: <REPLACE>

# Datatype: date
# Examples: 2024-01-31, 2024-01-31T11:06
# Required: False
# Default: null
ref_date: null
ref_date: <REPLACE>
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Replacing null with <REPLACE> for optional fields with default null values is incorrect. These fields are marked as "Required: False" and have "Default: null", so they should remain as null rather than <REPLACE>. The <REPLACE> marker should only be used for required fields.

Copilot uses AI. Check for mistakes.
default_exchange_rate: Annotated[float, Field(default=1, description="")]
default_discount_rate: Annotated[float, Field(default=0.08, description="")]
dates: Annotated[Dates, Field(default_factory=lambda: Dates(**{}), description="")]
dates: Annotated[Dates, Field(default_factory=lambda: Dates(), description="")]
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.

Suggested change
dates: Annotated[Dates, Field(default_factory=lambda: Dates(), description="")]
dates: Annotated[Dates, Field(default_factory=Dates, description="")]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants