Skip to content

add option to only save certain particle props#1273

Open
awirb wants to merge 4 commits into
masterfrom
addIndCells
Open

add option to only save certain particle props#1273
awirb wants to merge 4 commits into
masterfrom
addIndCells

Conversation

@awirb
Copy link
Copy Markdown
Contributor

@awirb awirb commented May 11, 2026

No description provided.

@awirb awirb requested a review from fso42 May 11, 2026 12:51
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 11, 2026

Analysis for project AvaFrame

❌ 1 blocking issue (1 total)

Tool Category Rule Count
black Style Incorrect formatting, autoformat by running qlty fmt. 1

@qltysh one-click actions:

  • Auto-fix formatting (qlty fmt && git push)

Comment thread avaframe/com1DFA/com1DFA.py
@fso42 fso42 added the enhancement New feature or request label May 11, 2026
exportRasters = False
# use LZW compression when writing TIFF raster files
useCompression = True
# particle properties - list all properties that shall be saved, t is always added
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.

Add info that particle property list can be found in the documentation

if isinstance(dictList, list):
for dict in dictList:
if particleProperties != "":
particlesToSave = {key: dict[key] for key in particleProperties}
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.

Here (and further down): if key is not available (eg. typo) it just fails with KeyError. Maybe validate the particle properties first in this function and throw an error right away with info about the wrong key.

particlesToSave = dictList
fi = open(outDir / ("particles_%s_%09.4f.pickle" % (logName, dictList["t"])), "wb")
pickle.dump(dictList, fi)
pickle.dump(particlesToSave, fi)
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.

This and the above could be written in only one statement after the if/else block

Comment thread avaframe/com1DFA/com1DFA.py
Comment thread avaframe/com1DFA/com1DFA.py
@awirb awirb requested a review from fso42 May 13, 2026 09:06
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 13, 2026

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
com1DFA96.2%

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
avaframe/com1DFA/com1DFA.py96.2%2936
Total96.2%
🤖 Increase coverage with AI coding...
In the `addIndCells` branch, add test coverage for this new code:

- `avaframe/com1DFA/com1DFA.py` -- Line 2936

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

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.

2 participants