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

Make thresholds configurable #13

Merged
merged 8 commits into from
Oct 24, 2022
Merged

Make thresholds configurable #13

merged 8 commits into from
Oct 24, 2022

Conversation

adybbroe
Copy link
Owner

@adybbroe adybbroe commented Oct 23, 2022

This PR makes the three space-time thresholds configurable via a yaml config file:

# Thresholds in time and space:
time_and_space_thresholds:
  hour_threshold: 6
  long_fires_threshold_km: 1.2
  spatial_threshold_km: 0.8
  • Closes #xxxx
  • Tests added
  • Tests passed: Passes pytest
  • Passes flake8
  • Fully documented

Adam.Dybbroe added 3 commits September 12, 2022 10:23
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
@adybbroe adybbroe self-assigned this Oct 23, 2022
@adybbroe adybbroe added the enhancement New feature or request label Oct 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2022

Codecov Report

Merging #13 (5dc0eed) into main (4ea9441) will increase coverage by 1.58%.
The diff coverage is 93.82%.

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   73.91%   75.49%   +1.58%     
==========================================
  Files          18       20       +2     
  Lines        1775     1914     +139     
  Branches      191      188       -3     
==========================================
+ Hits         1312     1445     +133     
- Misses        439      443       +4     
- Partials       24       26       +2     
Flag Coverage Δ
unittests 75.49% <93.82%> (+1.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
activefires_pp/tests/test_messaging.py 100.00% <ø> (ø)
activefires_pp/api_posting.py 83.33% <83.33%> (+16.66%) ⬆️
activefires_pp/spatiotemporal_alarm_filtering.py 78.26% <84.61%> (+0.98%) ⬆️
activefires_pp/tests/conftest.py 91.48% <91.48%> (ø)
activefires_pp/config.py 100.00% <100.00%> (ø)
activefires_pp/geojson_utils.py 95.74% <100.00%> (ø)
activefires_pp/tests/test_api_posting.py 100.00% <100.00%> (ø)
activefires_pp/tests/test_config.py 100.00% <100.00%> (ø)
activefires_pp/tests/test_geojson_utils.py 100.00% <100.00%> (ø)
...es_pp/tests/test_spatiotemporal_alarm_filtering.py 100.00% <100.00%> (+1.71%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@coveralls
Copy link

coveralls commented Oct 23, 2022

Coverage Status

Coverage increased (+0.6%) to 76.855% when pulling 5dc0eed on make_thresholds_configurable into 6463205 on main.

Copy link
Collaborator

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good with the gathering of the thresholds in one variable! some styling suggestions inline.

activefires_pp/spatiotemporal_alarm_filtering.py Outdated Show resolved Hide resolved
activefires_pp/spatiotemporal_alarm_filtering.py Outdated Show resolved Hide resolved
activefires_pp/spatiotemporal_alarm_filtering.py Outdated Show resolved Hide resolved
activefires_pp/spatiotemporal_alarm_filtering.py Outdated Show resolved Hide resolved
adybbroe and others added 4 commits October 24, 2022 11:21
Fix spelling error / typo

Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
…tivefires-pp into make_thresholds_configurable

# Conflicts:
#	activefires_pp/spatiotemporal_alarm_filtering.py
Copy link
Collaborator

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some commented lines to remove

activefires_pp/spatiotemporal_alarm_filtering.py Outdated Show resolved Hide resolved
Remove unused code

Co-authored-by: Martin Raspaud <martin.raspaud@smhi.se>
@adybbroe adybbroe merged commit e471846 into main Oct 24, 2022
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.

4 participants