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 plot_api return all observations for response #9087

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

yngve-sk
Copy link
Contributor

@yngve-sk yngve-sk commented Oct 29, 2024

Issue
Resolves #9077

Tested on RGS for stable and bleeding:
Before (left is rendering only one instead of 3 observations):

After:
Screenshot 2024-10-30 at 11 56 24

@yngve-sk yngve-sk force-pushed the bugfix-few-observations-rendered branch from 9ac354a to aaefcbb Compare October 30, 2024 10:38
@yngve-sk yngve-sk changed the title Make plot_api return all observations Make plot_api return all observations for response Oct 30, 2024
@yngve-sk yngve-sk added the release-notes:bug-fix Automatically categorise as bug fix in release notes label Oct 30, 2024
@yngve-sk yngve-sk self-assigned this Oct 30, 2024
Copy link
Contributor

@frode-aarstad frode-aarstad left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@DanSava DanSava left a comment

Choose a reason for hiding this comment

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

Looks ok as is but with some structure/style comments 🐎


observations = response.json()
observations_dfs = []

if not response.json():
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not replace if not response.json(): with if not observations: if you already declared observations = response.json() on ln 209

if not response.json():
continue
try:
obs = response.json()[0]
response.json()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar why not replace response.json()[0] with observations[0]

Comment on lines 214 to 220
try:
obs = response.json()[0]
response.json()[0]
except (KeyError, IndexError, JSONDecodeError) as e:
raise httpx.RequestError(
f"Observation schema might have changed key={key}, ensemble_name={ensemble.name}, e={e}"
) from e
Copy link
Contributor

Choose a reason for hiding this comment

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

It is unclear to me what the purpose of this section is now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure either, but am also not confident to just remove it here as part of this bugfix, although I think this entire module, PlotAPI/Dark storage could be simplified alot

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with keeping it for now

@yngve-sk yngve-sk force-pushed the bugfix-few-observations-rendered branch from 1a724db to 3a852ef Compare October 30, 2024 11:35
@yngve-sk yngve-sk force-pushed the bugfix-few-observations-rendered branch from 3a852ef to 781d473 Compare October 31, 2024 14:22
@yngve-sk yngve-sk enabled auto-merge (squash) October 31, 2024 14:29
@yngve-sk yngve-sk merged commit c077aad into equinor:main Oct 31, 2024
56 checks passed
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.75%. Comparing base (d294930) to head (781d473).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/gui/tools/plot/plot_api.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9087   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         350      350           
  Lines       21778    21781    +3     
=======================================
+ Hits        19764    19767    +3     
  Misses       2014     2014           
Flag Coverage Δ
cli-tests 39.03% <0.00%> (+0.01%) ⬆️
gui-tests 71.72% <92.30%> (+0.03%) ⬆️
performance-tests 49.24% <0.00%> (+0.03%) ⬆️
unit-tests 79.59% <84.61%> (-0.02%) ⬇️

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:bug-fix Automatically categorise as bug fix in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Only one observation rendered on migrated storage
4 participants