Skip to content

Conversation

@sindre-nistad
Copy link
Collaborator

Reasons for making this change

This should make the package easier to publish (ref. PyPa)

I've also simplified som of the testing to use contest.py when appropriate.

Related merge requests

Part of #109.
Builds on #108 (which should be merged before this)

Checklist

  • I'm updating documentation
    • I've checked the rendering of the Markdown text I've added
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
  • I'm adding a new feature
    • I've updated the help directory with an example use of the feature

@sindre-nistad sindre-nistad self-assigned this Jun 18, 2025
@sindre-nistad sindre-nistad added the enhancement New feature or request label Jun 18, 2025
@sindre-nistad sindre-nistad requested a review from Copilot June 18, 2025 08:59
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 refactors several modules to align the structure of tests and code with the recommendations from PyPa, removing unused imports and simplifying error message formatting. Key changes include:

  • Removing unused imports and parameters across multiple files.
  • Replacing f-string usage with literal strings where dynamic content is unnecessary.
  • Refactoring file path handling in truncation rule files using a new helper method.

Reviewed Changes

Copilot reviewed 138 out of 138 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aps/rms_jobs/updateAPSModelFromUncertaintyTable.py Removed unused get_workflow_name import.
aps/rms_jobs/updateAPSModelFromFMU.py Simplified print statement string formatting.
aps/rms_jobs/turn_off_traceback.py Removed unused os import.
aps/rms_jobs/test_jobs_and_workflow.py Eliminated several unused imports for clarity.
aps/rms_jobs/import_fields_from_disk_original.py Changed formatting style for error message.
aps/rms_jobs/export_fmu_config_files.py Adjusted print messaging to use literal strings.
aps/rms_jobs/export_fields_to_disk.py Updated error messages to remove unnecessary f-string notation.
aps/rms_jobs/create_simulation_grid.py Removed unused numpy import.
aps/rms_jobs/check_grid_index_origin.py Standardized error message formatting.
aps/algorithms/truncation_rules/*.py Updated conditional checks and added all lists for explicit exports.
aps/algorithms/defineTruncationRule.py Refactored file path resolution using a helper method.
aps/algorithms/defineFacies.py Removed redundant type import for Dict.
aps/algorithms/APSZoneModel.py, APSMainFaciesTable.py Cleaned up unused imports.
aps/algorithms/APSGaussModel.py Modified error messages to remove class name information.

@sindre-nistad sindre-nistad requested a review from einarwar June 18, 2025 10:51
@einarwar
Copy link
Collaborator

@sindre-nistad will review this once the conflicts are resolved :)

@sindre-nistad sindre-nistad force-pushed the refactor/improve-tests branch from 4c90e9b to 0544c75 Compare July 1, 2025 08:09
@sindre-nistad
Copy link
Collaborator Author

@einarwar; I've resolved the merge conflics

@sindre-nistad sindre-nistad force-pushed the refactor/improve-tests branch 2 times, most recently from cdd53e2 to 79095a1 Compare July 1, 2025 08:55
@sindre-nistad sindre-nistad requested a review from oddvarlia July 1, 2025 09:17
Copy link
Collaborator

@einarwar einarwar left a comment

Choose a reason for hiding this comment

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

Solid work, good job! Seems like a good change, with more code reusability.

Im sorry for nitpicking on files that were mostly just renamed/moved. Also i am not very knowledgeable about this repo, so some comments might not be relevant.

One thing i would suggest is to add type annotations in the tests where fixtures are used.

@sindre-nistad
Copy link
Collaborator Author

@einarwar I've resolved your suggestions and feedback.
Since I've made changes since last you approved this PR, a re-approval is necessary

Copy link
Collaborator

@einarwar einarwar left a comment

Choose a reason for hiding this comment

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

LGTM. Once tests pass should be good to go :)

This makes it much easier to behave the same, independent of where it was invoked from
The tests are re-organized to that `pytest` can easily execute them

The tests also use more features of `pytest` to reduce boilerplate
@sindre-nistad sindre-nistad force-pushed the refactor/improve-tests branch from 6839861 to 742ec26 Compare July 2, 2025 11:53
@sindre-nistad sindre-nistad requested a review from einarwar July 3, 2025 10:15
@sindre-nistad
Copy link
Collaborator Author

@einarwar; I did another (force) push, which addresses the rest of your feedback

@sindre-nistad sindre-nistad merged commit 431c337 into main Jul 3, 2025
9 checks passed
@sindre-nistad sindre-nistad deleted the refactor/improve-tests branch July 3, 2025 10:59
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.

3 participants