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

Env to skip aqi data download in development #299

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smannist
Copy link
Contributor

Add this line to local backend .env file to skip aqi data download in development:

ENVIRONMENT = "development"

(or anything that's not "production" really)

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #299 (cec8ce2) into main (3a5931e) will decrease coverage by 1.59%.
Report is 1 commits behind head on main.
The diff coverage is 45.45%.

❗ Current head cec8ce2 differs from pull request most recent head b1015c6. Consider uploading reports for the commit b1015c6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
- Coverage   80.55%   78.97%   -1.59%     
==========================================
  Files          55       55              
  Lines        1445     1460      +15     
  Branches      169      175       +6     
==========================================
- Hits         1164     1153      -11     
- Misses        257      280      +23     
- Partials       24       27       +3     
Files Changed Coverage Δ
recommender-back/src/apis/manager.py 47.56% <33.33%> (+0.72%) ⬆️
recommender-back/src/apis/current.py 70.37% <40.00%> (-23.22%) ⬇️
...mmender-back/src/services/scoring/indoor_scorer.py 91.42% <50.00%> (-2.52%) ⬇️
...mender-back/src/services/scoring/outdoor_scorer.py 91.42% <50.00%> (-2.52%) ⬇️
recommender-back/src/apis/poi.py 93.75% <57.14%> (-6.25%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Contributor

@JoJoensuu JoJoensuu left a comment

Choose a reason for hiding this comment

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

Maybe write a test to see that scoring works if air_quality is not fetched (eg. air quality is 0)?

Some nitpicking about redundant code.

Otherwise looks good and logical.

Comment on lines +77 to +90
if weather_data.get('air_quality'):
data['Score'] = scorer.score(
weather_data['temperature'], weather_data['wind_speed'],
weather_data['humidity'], weather_data['precipitation'],
weather_data['clouds'], weather_data['air_quality'],
sunrise_time, sunset_time, current_time
)
else:
data['Score'] = scorer.score(
weather_data['temperature'], weather_data['wind_speed'],
weather_data['humidity'], weather_data['precipitation'],
weather_data['clouds'], 0,
sunrise_time, sunset_time, current_time
)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's some duplicate code here that could be refactored.
For example:
`temperature = weather_data.get('temperature')
wind_speed = weather_data.get('wind_speed')
humidity = weather_data.get('humidity')
precipitation = weather_data.get('precipitation')
clouds = weather_data.get('clouds')
air_quality = weather_data.get('air_quality', 0)

data['Score'] = scorer.score(
temperature, wind_speed, humidity, precipitation, clouds, air_quality,
sunrise_time, sunset_time, current_time
)`

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.

2 participants