Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update DFA path runscript [ana5; runscripts] #1039

Merged
merged 1 commit into from
Dec 9, 2024
Merged

update DFA path runscript [ana5; runscripts] #1039

merged 1 commit into from
Dec 9, 2024

Conversation

leon-wagner
Copy link
Contributor

@leon-wagner leon-wagner commented Oct 22, 2024

With the aim of addressing #848, as well as rework of the runScript

Summary of changes:

  • restructured runComputeDFAPath script to make it compatible with QGIS connector, moved script to /avaframe

  • the -runDFA flag can now be set to run com1 to generate results for path generation (this was previously handled by a True/False argument within the runScript). The avaFolder may now also be added to the run command.

  • settings that are used to override com1DFA run were moved to DFAPath cfg as overrides. changed some of the overrides, path is now essentially generated from a default null com1 run with standard friction and particle settings, and dt=1. path is now also generated from fields as default, instead of from particles.

  • if splitpoint is not found with the set angle (default 20 degrees), the splitpoint is now generated at the top of the path, instead of not creating one, to avoid issues down the line. changed plot output accordingly.

  • added missing discrete color levels for travel angle, so now colors in the path output plot are generated with the same levels. additionally, color map for travel angles is now Crameri:nuuk (previously was undefined and a mix of Crameri:batlow and Crameri:lapaz)

  • also fixes two user warnings in DFAPath script log, one in connection with the legend, one with cmap. also fixed DFA path generation returns no coordinates for splitpoint #1038.

To do:

@leon-wagner leon-wagner linked an issue Oct 22, 2024 that may be closed by this pull request
@pep8speaks
Copy link

pep8speaks commented Nov 11, 2024

Hello @leon-wagner! Thanks for updating this PR.

Line 215:121: E501 line too long (152 > 120 characters)
Line 205:22: W605 invalid escape sequence '\D'

Line 714:1: E302 expected 2 blank lines, found 1
Line 712:18: E231 missing whitespace after ','
Line 706:121: E501 line too long (127 > 120 characters)
Line 109:1: E302 expected 2 blank lines, found 1
Line 105:16: E231 missing whitespace after ','
Line 89:121: E501 line too long (128 > 120 characters)
Line 68:10: E261 at least two spaces before inline comment
Line 59:74: E127 continuation line over-indented for visual indent
Line 52:13: E117 over-indented
Line 51:13: E117 over-indented (comment)
Line 50:21: E261 at least two spaces before inline comment
Line 32:1: E302 expected 2 blank lines, found 1

Line 420:52: E203 whitespace before ':'
Line 418:48: E203 whitespace before ':'
Line 417:48: E203 whitespace before ':'

Line 193:54: E262 inline comment should start with '# '
Line 193:53: E261 at least two spaces before inline comment
Line 175:121: E501 line too long (139 > 120 characters)
Line 170:54: E262 inline comment should start with '# '
Line 170:53: E261 at least two spaces before inline comment
Line 167:121: E501 line too long (122 > 120 characters)
Line 148:54: E262 inline comment should start with '# '
Line 148:53: E261 at least two spaces before inline comment
Line 73:121: E501 line too long (131 > 120 characters)
Line 71:74: E251 unexpected spaces around keyword / parameter equals
Line 71:72: E251 unexpected spaces around keyword / parameter equals
Line 69:93: E251 unexpected spaces around keyword / parameter equals
Line 69:91: E251 unexpected spaces around keyword / parameter equals
Line 69:59: W605 invalid escape sequence '\m'
Line 30:121: E501 line too long (125 > 120 characters)

Line 982:121: E501 line too long (138 > 120 characters)
Line 980:19: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 951:21: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 912:66: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 805:121: E501 line too long (124 > 120 characters)
Line 689:37: E203 whitespace before ':'
Line 688:37: E203 whitespace before ':'
Line 537:15: E711 comparison to None should be 'if cond is not None:'
Line 501:71: E203 whitespace before ':'
Line 501:48: E203 whitespace before ':'
Line 495:71: E203 whitespace before ':'
Line 495:48: E203 whitespace before ':'
Line 482:121: E501 line too long (121 > 120 characters)

Line 86:1: E305 expected 2 blank lines after class or function definition, found 1
Line 84:19: E231 missing whitespace after ','
Line 21:1: E302 expected 2 blank lines, found 1

Line 112:5: E303 too many blank lines (2)
Line 72:20: E262 inline comment should start with '# '
Line 72:20: E261 at least two spaces before inline comment

Comment last updated at 2024-12-09 10:51:25 UTC

@leon-wagner leon-wagner added the enhancement New feature or request label Nov 11, 2024
@leon-wagner leon-wagner linked an issue Nov 11, 2024 that may be closed by this pull request
@leon-wagner leon-wagner marked this pull request as ready for review November 11, 2024 12:28
@leon-wagner leon-wagner self-assigned this Nov 11, 2024
@fso42 fso42 self-requested a review November 19, 2024 14:34
@fso42 fso42 added this to the Version 1.10 milestone Nov 19, 2024
@leon-wagner leon-wagner force-pushed the dfaPathQGis branch 2 times, most recently from ea6318f to 83f2042 Compare November 21, 2024 11:58
avaframe/ana5Utils/DFAPathGeneration.py Outdated Show resolved Hide resolved
avaframe/ana5Utils/DFAPathGenerationCfg.ini Outdated Show resolved Hide resolved
avaframe/ana5Utils/DFAPathGenerationCfg.ini Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/out3Plot/outCom3Plots.py Outdated Show resolved Hide resolved
avaframe/runAna5DFAPathGeneration.py Outdated Show resolved Hide resolved
@fso42 fso42 changed the title update DFA path runscript (ana5Utils) update DFA path runscript [ana5U; runscripts] Nov 29, 2024
@fso42 fso42 changed the title update DFA path runscript [ana5U; runscripts] update DFA path runscript [ana5; runscripts] Nov 29, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 21.78218% with 79 lines in your changes missing coverage. Please review.

Project coverage is 73.54%. Comparing base (eea271a) to head (3ef7697).
Report is 68 commits behind head on master.

Files with missing lines Patch % Lines
avaframe/ana5Utils/DFAPathGeneration.py 20.00% 40 Missing ⚠️
avaframe/out3Plot/outCom3Plots.py 0.00% 35 Missing ⚠️
avaframe/in2Trans/shpConversion.py 72.72% 3 Missing ⚠️
avaframe/com3Hybrid/com3Hybrid.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1039      +/-   ##
==========================================
- Coverage   73.82%   73.54%   -0.29%     
==========================================
  Files          66       66              
  Lines       14916    15439     +523     
==========================================
+ Hits        11012    11354     +342     
- Misses       3904     4085     +181     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- com1 overrides moved from runScript to ini

- new --runDFA flag logic

- path is generated from fields by default (resType changed accordingly)

- moved runScript to main avaframe folder (for QGIS)

- clean DFAPath output folder in avadir before generating path (necessary for QGIS, so if script is run multiple times, paths that are previously generated are not returned to QGIS)

- removed coulomb friction and other com1 overrides, path is now generated from standard run

- added option to add velocity info when FV is saved

set splitpoint to be generated at the top of path if it is not found, instead of not at all (avoids issues with QGIS)

- adjusted corresponding error message

- accordingly adjusted plot generation to exclude splitPoints set at the top

general changes to DFAPath output plots

- add missing discrete color levels for Travel Angle and changed it from a mix of lapaz and batlow to nuuk color map
- grey out faulty legend plotting line thereby removing user warning: “no artists found with label”… in log and removes empty legend in top right corner of birds eye view panel
- more descriptive runDFA flag comment in runScript

- set dt to 1

fixes #1038, adds extra checks for what type is expected (point, float or other)

- adjustment to writePoint2SHPfile to account for pytest. tested and it still fixes the addressed problem.

- adjusted runDFAModule flag, added to ini
- renamed functions in DFAPathGeneration.py to reflect better what they do
Copy link

codeclimate bot commented Dec 9, 2024

Code Climate has analyzed commit 9191d8a and detected 6 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 4
Duplication 2

The test coverage on the diff in this pull request is 21.7% (50% is the threshold).

This pull request will bring the total coverage in the repository to 69.5%.

View more on Code Climate.

@fso42
Copy link
Contributor

fso42 commented Dec 9, 2024

Standardtests ok, apart from known

@fso42 fso42 merged commit f1ac7c8 into master Dec 9, 2024
3 of 4 checks passed
@fso42 fso42 deleted the dfaPathQGis branch December 9, 2024 12:21
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.

DFA path generation returns no coordinates for splitpoint Add automatic path to connector as extra
3 participants