Skip to content

Conversation

@fso42
Copy link
Contributor

@fso42 fso42 commented Dec 10, 2025

Breaking change: by default t=0 is NOT exported anymore

feat(com1DFA): refine tSteps handling for timestep exports

  • Export initial timestep (t=0) only if explicitly specified in tSteps.

  • Updated default behavior to export only final timestep when tSteps is empty.

    1. avaframe/com1DFA/com1DFACfg.ini:16-20
    • Changed default from tSteps = 1 to tSteps = (empty)
    • Updated comments to reflect new behavior
    1. avaframe/in3Utils/fileHandlerUtils.py:387-389
    • Removed filtering that excluded t=0 from dtSave array
    1. avaframe/com1DFA/com1DFA.py:2097
    • Made initial timestep export conditional: only exports if t=0 is in dtSave
    1. avaframe/com1DFA/com1DFA.py:2131-2134
    • Made Tsave initialization conditional based on whether t=0 is exported
    1. docs/moduleCom1DFA.rst:258
    • Updated documentation: "initial time step" → "final time step" to reflect new default

@fso42 fso42 requested a review from awirb December 10, 2025 13:54
@fso42 fso42 self-assigned this Dec 10, 2025
@fso42 fso42 added the enhancement New feature or request label Dec 10, 2025
@qltysh
Copy link
Contributor

qltysh bot commented Dec 12, 2025

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on master by 0.03%.

Modified Components (1)

RatingComponent% Diff
Coverage rating: C Coverage rating: C
com1DFA100.0%

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
avaframe/com1DFA/com1DFA.py100.0%
Coverage rating: B Coverage rating: B
avaframe/log2Report/generateReport.py100.0%
Total100.0%
🚦 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 changed the title Change time writing [com1;in3] Change time writing Dec 15, 2025
- Export initial timestep (t=0) only if explicitly specified in `tSteps`.
- Updated documentation to reflect changes in timestep export behavior.
- Added tests to ensure correct handling of `tSteps` for both empty and explicit configurations.
- Updated default behavior to export only final timestep when `tSteps` is empty.

  1. avaframe/com1DFA/com1DFACfg.ini:16-20
    - Changed default from tSteps = 1 to tSteps = (empty)
    - Updated comments to reflect new behavior
  2. avaframe/in3Utils/fileHandlerUtils.py:387-389
    - Removed filtering that excluded t=0 from dtSave array
  3. avaframe/com1DFA/com1DFA.py:2097
    - Made initial timestep export conditional: only exports if t=0 is in dtSave
  4. avaframe/com1DFA/com1DFA.py:2131-2134
    - Made Tsave initialization conditional based on whether t=0 is exported
  5. docs/moduleCom1DFA.rst:258
    - Updated documentation: "initial time step" → "final time step" to reflect new default
… bug timestep saving

- Removed `plotFields` from all configuration files and corresponding test cases.
- Simplified logic to only use `resType` for determining result parameters across all time steps.
- Updated export function to streamline behavior by treating all `resType` fields equally across all time steps.
- Adjusted tests to reflect the removal of `plotFields` and ensure consistency.

   Fixed critical bug in timestep saving logic:
    - Bug: After saving initial timestep at t=0, dtSave array wasn't updated, causing spurious save at t=dt
    - Fix: Added dtSave = updateSavingTimeStep(dtSave, cfgGen, t) after initial save
    - This eliminates the extra timestep that was appearing (e.g., t=0, t=0.1, t=10, t=20...)
@fso42 fso42 force-pushed the changeTimeWriting branch from 138fe54 to 7a62ff8 Compare December 16, 2025 08:44
- Removed redundant condition for `resT` by excluding `FTDet` checks.
- Simplified logic to populate `resultsDF` unconditionally when appending new rows.

fix(com1DFA): correct timestep export condition for t=0

- Updated logic to use `np.any(dtSave <= 1.0e-8)` for handling initial timestep export.
- Removed redundant contour fetching logic for dummy fields

test(com1DFA): add unit test; squash

refactor(tests): fix `test_tSteps_output_behavior`

- Updated `com1DFA` to ensure particle directory initialization is handled conditionally during initial export.

refactor(com1DFA): ensure valid `resTypes` and improve contour fetching logic

- Added logic to append `pfv` to `resTypes` when it only contains invalid or insufficient field types (e.g., `particles` or empty).
- Adjusted contour line computation to skip when the target field is a dummy array.

refactor(com1DFA): simplify `resTypes` handling and remove redundant `resTypesLast`

- Replaced all instances of `resTypesLast` with `resTypes`
- Removed unused variable `resTypesLast` across the codebase.
- Ensured consistent use of `resTypes` for initializing fields and max value computations.
@fso42 fso42 force-pushed the changeTimeWriting branch from 7a62ff8 to 653624a Compare December 16, 2025 09:11
@fso42 fso42 requested a review from awirb December 16, 2025 09:14
…export

- Store original `dtSave` to ensure accurate initial timestep decisions.
- Update `dtSave` only after initial timestep export to avoid unintended modifications.
- Improve readability of conditions by explicitly referencing `dtSaveOriginal`.

 Root Cause:
  The code uses dtSave for two decisions but modifies it between them:
  1. Line 2107: Checks if dtSave contains t=0 → decides to export initial timestep
  2. Line 2114: Calls updateSavingTimeStep() which modifies dtSave (changes [0] to [2*tEnd])
  3. Line 2142: Checks dtSave again → decides whether to add t=0 to Tsave array

  The Problem:
  When tSteps = "0":
  - Line 2107 check passes → exports t=0
  - Line 2114 modifies dtSave from [0] to [2*tEnd]
  - Line 2142 check fails → Tsave remains empty
  - Result: t=0 was exported but not tracked in Tsave (inconsistency)

  Proposed Fix: ✓ CORRECT
  The fix saves the original dtSave before modifications and uses it for both decisions. This ensures
   consistency between the export and Tsave array decisions.

fix(com1DFA): correct field type filter for `resTypes` validation
@fso42 fso42 force-pushed the changeTimeWriting branch from 0b563a4 to 84605b4 Compare December 16, 2025 14:18
@fso42
Copy link
Contributor Author

fso42 commented Dec 16, 2025

Standardtests ident

@fso42 fso42 changed the title [com1;in3] Change time writing [com1;in3] Change time writing [breaking change] Dec 16, 2025
@fso42 fso42 merged commit 55d14ec into master Dec 16, 2025
4 checks passed
@fso42 fso42 deleted the changeTimeWriting branch December 16, 2025 14:47
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