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

Add support for Seaborn figures #1613

Merged
merged 6 commits into from
Jan 4, 2024
Merged

Add support for Seaborn figures #1613

merged 6 commits into from
Jan 4, 2024

Conversation

szysad
Copy link
Contributor

@szysad szysad commented Dec 28, 2023

Before submitting checklist

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you ask the docs owner to review all the user-facing changes?

Szymon Sadkowski added 2 commits December 28, 2023 12:48
Additionally:
  1. Adds related e2e tests
  2. Renames 'is_seaborn_axisgrid' to 'is_seaborn_figure'
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8013fc4) 80.09% compared to head (ef2eddd) 73.84%.

Files Patch % Lines
src/neptune/internal/utils/images.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1613      +/-   ##
==========================================
- Coverage   80.09%   73.84%   -6.25%     
==========================================
  Files         292      292              
  Lines       14554    14278     -276     
==========================================
- Hits        11657    10544    -1113     
- Misses       2897     3734     +837     
Flag Coverage Δ
e2e ?
e2e- ?
e2e-management ?
e2e-s3 ?
e2e-s3-gcs ?
e2e-standard ?
macos 73.56% <91.66%> (-6.27%) ⬇️
macos-latest ?
py3.10 ?
py3.7 73.84% <91.66%> (-5.61%) ⬇️
py3.7.16 ?
py3.8 ?
py3.9 ?
ubuntu 73.70% <91.66%> (-6.01%) ⬇️
ubuntu-latest ?
unit 73.84% <91.66%> (-0.54%) ⬇️
windows 73.02% <91.66%> (-6.64%) ⬇️

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.

@szysad szysad marked this pull request as ready for review December 28, 2023 13:26
@szysad szysad marked this pull request as draft December 28, 2023 13:31
@szysad szysad marked this pull request as ready for review December 28, 2023 13:41
normandy7
normandy7 previously approved these changes Dec 28, 2023
@SiddhantSadangi SiddhantSadangi linked an issue Dec 28, 2023 that may be closed by this pull request
src/neptune/internal/utils/images.py Outdated Show resolved Hide resolved
tests/e2e/plot_utils.py Outdated Show resolved Hide resolved
@AleksanderWWW
Copy link
Contributor

@szysad
My bad, forgot to let you know to start your branch name with your initials - let's do that in the future PRs :)

@AleksanderWWW
Copy link
Contributor

CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines 48 to 54
SEABORN_GRID_CLASSES = set(
[
"FacetGrid",
"PairGrid",
"JointGrid",
]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

While this is technically correct, the syntax is slightly confusing and IDEs like PyCharm complain about it.
Let's replace it with a set literal:
SEABORN_GRID_CLASSES = {"FacetGrid", "PairGrid", "JointGrid"}

Also, what happened to 'pairplot' and 'jointplot'?

Copy link
Contributor Author

@szysad szysad Jan 4, 2024

Choose a reason for hiding this comment

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

pairplot and jointplot are functions provided to user in seaborn axisgrid but they always return instances of FacetGrid, PairGrid or JointGrid so it was redundant in the first place

 - fix `generate_seaborn_figure` function so it works with seabron 0.11.2
 - move seaborn grid classes list to const var
 - fix CHANGELOG.md header format
 - apply given-when-then test comment convention
@szysad szysad merged commit 51a8377 into master Jan 4, 2024
4 checks passed
@szysad szysad deleted the dev/seaborn-figures-support branch January 4, 2024 13:49
@@ -45,6 +45,7 @@ altair = { version = "*", optional = true }
bokeh = { version = "*", optional = true }
freezegun = { version = "*", optional = true }
matplotlib = { version = "*", optional = true }
seaborn = { version = "*", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

We have to add it as a part of dev group as well (see lines between 112 and 143) 😉. This works as seaborn is probably a dependency of some of the other packages.

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.

Feature Request: Add support for Seaborn figures
4 participants