Skip to content

[runScripts]: wrap script execution in __main__ block; fixes #1247#1258

Merged
fso42 merged 1 commit intomasterfrom
fix1247
Apr 9, 2026
Merged

[runScripts]: wrap script execution in __main__ block; fixes #1247#1258
fso42 merged 1 commit intomasterfrom
fix1247

Conversation

@fso42
Copy link
Copy Markdown
Contributor

@fso42 fso42 commented Mar 25, 2026

Wraps the top-level execution code in runStandardTestsCom1DFA.py and
runUpdateBenchmarkTestsCom1DFA.py in if __name__ == "__main__" guards.

This prevents unintended execution when these scripts are imported as
modules (e.g. during test collection or parallel processing forks),
which was the root cause of #1247.

@fso42 fso42 added the bugfix label Mar 25, 2026
@fso42 fso42 self-assigned this Mar 25, 2026
@fso42
Copy link
Copy Markdown
Contributor Author

fso42 commented Mar 25, 2026

Standardtests ident

@qltysh
Copy link
Copy Markdown
Contributor

qltysh bot commented Mar 25, 2026

Qlty

Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
Coverage rating: F Coverage rating: F
avaframe/out3Plot/statsPlots.py66.7%238
Coverage rating: B Coverage rating: B
avaframe/ana3AIMEC/aimecTools.py100.0%
Total80.0%
🤖 Increase coverage with AI coding...

In the `fix1247` branch, add test coverage for this new code:

- `avaframe/out3Plot/statsPlots.py` -- Line 238

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@fso42 fso42 requested a review from JuLa96 March 25, 2026 11:59
@fso42 fso42 modified the milestone: Version 2.0 Mar 25, 2026
Copy link
Copy Markdown
Contributor

@JuLa96 JuLa96 left a comment

Choose a reason for hiding this comment

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

The scripts are running under Windows now.

@fso42
Copy link
Copy Markdown
Contributor Author

fso42 commented Apr 9, 2026

Standardtests ok, apart from known snowslide test

…` and improve structure; fixes #1247

- Use `tempfile.TemporaryDirectory` for handling temporary test directories, ensuring automatic cleanup.
- Fix division-by-zero issue in statsPlots by validating input values.
- Standardize `runoutFound` values as strings in `aimecTools` to ensure consistent conditional checks.
@fso42 fso42 merged commit 1c82ba9 into master Apr 9, 2026
4 checks passed
@fso42 fso42 deleted the fix1247 branch April 9, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants