[ana5]: add general thalweg extension & resampling - #1323
Open
PaulaSp3 wants to merge 60 commits into
Open
Conversation
still in progress relVolMin and relVolMax as output correct position for relId delete print small change fix bug pathPolygons as output rename function tidy up try to keep RAM as small as possible print a warning if the output in cfg is not completly valid small corrections correct bugs and doc update docu adapt pytest delete unused package
…flux small modification for comparison tests benchmark tests for FP pep8speaks small bug update bug fix add statement that rasters are close Option to have an uMax_Limit Layer as input alpha and umax same for each startcell default fix comment small comment rename variables - camelCase; paths can beread in with customPaths rename variables - camelCase; paths can beread in with customPaths add flag if variable alpha is computed add dynamic exponent shorten part where calculation is executed (independend of forest True/False rename variables, option to provide variable zdeltaLim or umaxLim pep8speaks docu for variable parameter
Add relative comparison (when rasters are close) write message in report file add option/ FLAG to calculate with generations data for benchmark tests with generations docu for generations pep8speaks pep8speaks pep8spekas
store also center of zdelta and flux thalwegs save stoppig criteria save info about stopping thalweg format opportunity to choose output variables thalweg output minor adaptions to previous PRs output velocity add velocity as output begin to add alpahaEff to thalwegOutput save alpha eff of thalweg save sum of flux of every generation possible' delete personal test data get thalweg deposited flux save number of gnerations per thalweg add output sum of routing and deposition flux thalweg output fluxsums only compute pathArrays once
update benchmark data update benchmark data fix cell count computation format fix bug in computing cell counts minor change
comment do not consider first generation simplified computation ofaveraging If possible, use relID in thalweg name
extend thalweg to top of release area update travel length add dfa path extrapolation and comment out the other option update variables after extending the path to th etop do not overwrite x and y cooridnated extend to bottom adjust bottom extension use config simplify correction that projection on DEM works for FLowPy find bottom point within flow path resample path format consider com1DFAs upside down fliping of rasters consider com1DFAs upside down fliping of rasters consider com1DFAs upside down fliping of rasters add resampling thalweg cut the thalweg at bottom fix bug correct top extension try new top extension minor correction correction correction track the averaged path also remember indeizes correction correction correct
all plots work tidy up format and tidy up
7 tasks
14 tasks
Contributor
Analysis for project
|
| Tool | Category | Rule | Count | |
|---|---|---|---|---|
| ripgrep | Lint | # TODO: for option 2, the code is very similar as in extendProfileBottom, should we summarize both in one function with options/different handling for top nd bottom extension? | 4 | ❌ |
| ruff | Style | Incorrect formatting, autoformat by running qlty fmt. |
3 | ❌ |
| ruff | Lint | Do not use bare except |
2 | ❌ |
| ruff | Lint | Ambiguous variable name: l |
2 | ❌ |
| ruff | Lint | f-string without any placeholders | 1 | ❌ |
| qlty | Structure | Function with high complexity (count = 34): extendProfileTop | 1 | |
| qlty | Structure | Deeply nested control flow (level = 4) | 1 |
@qltysh one-click actions:
- Auto-fix formatting (
qlty fmt && git push)
| profile["z"] = np.append(zExtTop, profile["z"]) | ||
| profile["s"] = np.append(0, profile["s"] + ds) | ||
| if debugPlot: | ||
| debPlot.plotPathExtTop(profile, particlesIni, xFirst, yFirst, zFirst, dz1) |
Contributor
| log.warning("Skip top extension of thalweg since profile contains only one point.") | ||
| return profile | ||
|
|
||
| # TODO: for option 2, the code is very similar as in extendProfileBottom, should we summarize both in one function with options/different handling for top nd bottom extension? |
Contributor
| log.error(message) | ||
| raise ValueError(message) | ||
| if cfg is None: | ||
| message = f"If extTopOption = 2, the cfg needs to be provided" |
Contributor
| else: | ||
| # remember last point found inside | ||
| factFirst = factExt | ||
| factExt = factExt + stepSize |
Contributor
| title = ('com3HybRasterPlot') | ||
| l = ax.legend(loc='lower left') | ||
| title = "com3HybRasterPlot" | ||
| l = ax.legend(loc="lower left") |
Contributor
| else: | ||
| extentPlot = extent | ||
|
|
||
| # TODO: restore changes and rebase master! |
Contributor
| @@ -0,0 +1,205 @@ | |||
| """Tests for module preparePathGeneral""" | |||
Contributor
Co-authored-by: qltysh[bot] <168846912+qltysh[bot]@users.noreply.github.com>
Contributor
|
Coverage Impact This PR will not change total coverage. Modified Components (1)
Modified Files with Diff Coverage (3)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
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.

The goal is to derive a thalweg profile from very general thalweg data (containing x and y coordinates).
This changed in each file:
ana5Utils/DFAPathGeneration.py:
(for option 2, the code is very similar as in extendProfileBottom, should we summarize both in one function with options/different handling for top nd bottom extension?)
ana5Utils/DFAPathGenerationCfg.ini:
ana5Utils/preparePathGeneral.py
functions to prepare a path/thalweg that has only x and y coordinates:
out3Plot/outCom3Plots.py
PR Checklist
Please confirm before requesting review:
pytestlocally without failsConfirm before the final merge/rebase into master