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

Issue 460 remember selected calendar period within session #467

Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jul 21, 2022

I chose to set the session data with the /chart instead of the /chart_data endpoints (for sensors and assets), because the former endpoint can be called without the need to call the latter (using include_data=true). Right now both the sensor and asset page are calling the /chart endpoint with each date pick.

Closes #460.

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added the UI label Jul 21, 2022
@Flix6x Flix6x added this to the 0.11.0 milestone Jul 21, 2022
@Flix6x Flix6x self-assigned this Jul 21, 2022
@Flix6x Flix6x requested a review from nhoening July 21, 2022 22:30
@coveralls
Copy link
Collaborator

coveralls commented Jul 21, 2022

Pull Request Test Coverage Report for Build 2723799853

  • 6 of 8 (75.0%) changed or added relevant lines in 3 files are covered.
  • 94 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.04%) to 67.577%

Changes Missing Coverage Covered Lines Changed/Added Lines %
flexmeasures/api/dev/sensors.py 1 2 50.0%
flexmeasures/api/v3_0/assets.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
flexmeasures/api/dev/sensors.py 1 61.33%
flexmeasures/api/v3_0/assets.py 1 95.4%
flexmeasures/data/models/data_sources.py 3 52.56%
flexmeasures/utils/time_utils.py 16 76.55%
flexmeasures/api/v1_2/implementations.py 19 75.16%
flexmeasures/api/v3_0/sensors.py 19 70.26%
flexmeasures/api/v1_3/implementations.py 35 67.53%
Totals Coverage Status
Change from base Build 2711605930: 0.04%
Covered Lines: 7207
Relevant Lines: 10091

💛 - Coveralls

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.

First question: why not reuse start_time and end_time?

(Can we retire them, as we used them on analytics and portfolio views?)

@Flix6x
Copy link
Contributor Author

Flix6x commented Jul 21, 2022

First question: why not reuse start_time and end_time?

(Can we retire them, as we used them on analytics and portfolio views?)

I didn't really want to involve / touch the code that re-interprets those datetimes in the server's ttimezone and stores them as datetime.datetime objects. I guess that was there for a different use case. I'm directly storing the ISO string in the session here.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@Flix6x Flix6x merged commit 327b6eb into main Jul 23, 2022
@Flix6x Flix6x deleted the Issue-460_Remember_selected_calendar_period_within_session branch July 23, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remember selected calendar period within session
3 participants