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

Forecasts limited to registered sensors #13

Merged
merged 6 commits into from
Jul 26, 2023

Conversation

Ahmad-Wahid
Copy link
Contributor

@Ahmad-Wahid Ahmad-Wahid commented Jul 20, 2023

Previously, our focus was on mapping all the available sensors, but this approach restricted us to obtaining forecasts for just one or two sensors. In this pull request (PR), I've implemented a sensor check. This means that if a sensor is not registered, it will be disregarded during the forecasting process.

@Ahmad-Wahid Ahmad-Wahid linked an issue Jul 20, 2023 that may be closed by this pull request
@Ahmad-Wahid Ahmad-Wahid changed the title Get forecasts for only registered sensors Forecasts are limited to registered sensors Jul 20, 2023
@Ahmad-Wahid Ahmad-Wahid changed the title Forecasts are limited to registered sensors Forecasts limited to registered sensors Jul 20, 2023
* change owm version to 3 and add version checker

* rais a warning

* try black only

* make API_VERSION a module constant and add tested versions to the warning

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

---------

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

This is a little mit more tricky than I had thought, but we're getting closer :)

I even made two new tickets while thinking about this PR.

Here is one other comment I have - an different improvement I saw while looking at the code:

The line owm.py:107 (data_source = get_or_create_owm_data_source()) can move one upwards, outside of the for-loop (we use the same data source for all sensors).

flexmeasures_openweathermap/utils/owm.py Outdated Show resolved Hide resolved
@nhoening nhoening merged commit 9645e6d into main Jul 26, 2023
1 of 2 checks passed
@nhoening nhoening deleted the 11-save-data-for-those-sensor-which-are-present branch July 26, 2023 11:12
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.

Save data for those sensor which are present
2 participants