Conversation
add pytest
Contributor
❌ 2 blocking issues (2 total)
@qltysh one-click actions:
|
Contributor
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Components (1)
Modified Files with Diff Coverage (4)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
fso42
requested changes
May 26, 2026
Contributor
fso42
left a comment
There was a problem hiding this comment.
def createAssetsRasterFromParticleLocations(particlesTimeArrays, dem, uniqueAssets,
assetsValues):
"""create a raster indicating particle trajectories colorcoded with assets
classes,
highest overrides lower classes"""
nTime, nPart = particlesTimeArrays["ID"].shape
particlesTimeArrays["assetsValue"] = np.full((nTime, nPart), np.nan)
particleAssets = np.full((dem["header"]["nrows"], dem["header"]["ncols"]),
np.nan)
# Process classes from low to high so higher classes naturally override lower
ones
for l in uniqueAssets:
assetCells = np.asarray(assetsValues["value_%d" % l])
inAsset = np.isin(particlesTimeArrays["inCellDEM"], assetCells)
for pId in range(nPart):
hitTimes = np.where(inAsset[:, pId])[0]
if len(hitTimes) == 0:
continue
# Mark particle trajectory up to the last time it hit this asset class
mMax = hitTimes[-1]
particlesTimeArrays["assetsValue"][:mMax, pId] = l
indX = particlesTimeArrays["indXDEM"][: mMax + 1, pId].astype(int)
indY = particlesTimeArrays["indYDEM"][: mMax + 1, pId].astype(int)
# Only overwrite cells not already set to a higher class
particleAssets[indY, indX] = np.where(
particleAssets[indY, indX] >= l, particleAssets[indY, indX], l
)
return particleAssets, particlesTimeArrays
fso42
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.