Skip to content

[out3Plot]: add functionality for assets#1277

Open
awirb wants to merge 3 commits into
masterfrom
addInfra
Open

[out3Plot]: add functionality for assets#1277
awirb wants to merge 3 commits into
masterfrom
addInfra

Conversation

@awirb
Copy link
Copy Markdown
Contributor

@awirb awirb commented May 20, 2026

No description provided.

@awirb awirb requested review from ahuber-bfw and fso42 May 20, 2026 12:47
@awirb awirb self-assigned this May 20, 2026
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 20, 2026

Analysis for project AvaFrame

❌ 4 blocking issues (6 total)

Tool Category Rule Count
ruff Lint Avoid equality comparisons to False; use if not np\.isnan\(k\): for false checks 2
black Style Incorrect formatting, autoformat by running qlty fmt. 1
ruff Lint Ambiguous variable name: l 1
qlty Structure Function with high complexity (count = 15): createAssetsRasterFromParticleLocations 1
qlty Structure Deeply nested control flow (level = 4) 1

@qltysh one-click actions:

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

particleAssets[indY, indX] = np.where(
particleAssets[indY, indX] >= l, particleAssets[indY, indX], l
)

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.

Function with high complexity (count = 15): createAssetsRasterFromParticleLocations [qlty:function-complexity]

# loop over each particle
for pId in range(len(particlesTimeArrays["ID"][0, :])):
# loop over each infrastructure class (sorted from low to high)
for l in uniqueAssets:
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.

Ambiguous variable name: l [ruff:E741]

indX = np.asarray(particlesTimeArrays["indXDEM"][0 : m + 1, pId], dtype=int)
indY = np.asarray(particlesTimeArrays["indYDEM"][0 : m + 1, pId], dtype=int)
particleAssets[indY, indX] = np.where(
particleAssets[indY, indX] >= l, particleAssets[indY, indX], l
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.

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

Comment thread avaframe/in1Data/getInput.py
assetsValues = {}
for i in uniqueAssets:
assetsArray = np.where(assets["rasterData"] == i, cellNo, np.nan)
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) == False]
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.

Avoid equality comparisons to False; use if not np.isnan(k): for false checks [ruff:E712]

Suggested change
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) == False]
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) is False]

assetsValues = {}
for i in uniqueAssets:
assetsArray = np.where(assets["rasterData"] == i, cellNo, np.nan)
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) == False]
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.

Avoid equality comparisons to False; use if not np.isnan(k): for false checks [ruff:E712]

Suggested change
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) == False]
assetsValues["value_%d" % i] = [int(k) for k in assetsArray.flatten() if np.isnan(k) is False]

@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 20, 2026

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on master by 0.11%.

Modified Components (1)

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

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: B
avaframe/in1Data/getInput.py3.3%1209-1250
Coverage rating: B Coverage rating: B
avaframe/com1DFA/com1DFA.py100.0%
Coverage rating: F Coverage rating: F
avaframe/com1DFA/particleTools.py100.0%
Coverage rating: B Coverage rating: B
avaframe/com1DFA/deriveParameterSet.py100.0%
Total38.3%
🤖 Increase coverage with AI coding...
In the `addInfra` branch, add test coverage for this new code:

- `avaframe/in1Data/getInput.py` -- Line 1209-1250

🚦 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant