Skip to content

Add missing infos to docstring#14

Merged
FBumann merged 1 commit intomainfrom
fix/docstring
Jan 10, 2026
Merged

Add missing infos to docstring#14
FBumann merged 1 commit intomainfrom
fix/docstring

Conversation

@FBumann
Copy link
Owner

@FBumann FBumann commented Jan 10, 2026

Summary by CodeRabbit

  • Documentation
    • Enhanced imshow function documentation clarifying that color bounds are computed from the entire dataset by default, ensuring consistent coloring across animation frames and facets.
    • Updated parameter descriptions for improved clarity on default behaviors and override options.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

This PR adds clarifying documentation to the imshow method across two files, explaining that color bounds (zmin/zmax) are computed from the entire dataset by default to ensure consistent coloring across animation frames and facets, and describing how the robust parameter behavior defaults to min/max when disabled.

Changes

Cohort / File(s) Summary
imshow color bounds documentation
xarray_plotly/accessor.py, xarray_plotly/plotting.py
Added docstring notes clarifying that color bounds are computed from the entire dataset by default (ensuring consistent coloring across animation frames and facets) and that zmin/zmax can override this behavior. Updated robust parameter description to indicate default uses min/max when robustness is disabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A note here, a note there,
Color bounds beyond compare!
Global scales through frames so fine,
Documentation makes behavior shine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding clarifications to docstrings about color bounds computation behavior in the imshow method.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
xarray_plotly/accessor.py (1)

260-263: Consider mentioning facets for consistency and completeness.

The note mentions "consistent coloring across animation frames" but the corresponding note in plotting.py (lines 413-414) mentions "animation frames and facets". For consistency and completeness, consider including facets here as well, since the color bounds behavior applies to both.

📝 Suggested revision
         Note:
             **Difference from px.imshow**: Color bounds are computed from the
             entire dataset by default, ensuring consistent coloring across
-            animation frames. Use `zmin`/`zmax` to override.
+            animation frames and facets. Use `zmin`/`zmax` to override.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d50e2e4 and eb3bcc9.

📒 Files selected for processing (2)
  • xarray_plotly/accessor.py
  • xarray_plotly/plotting.py
🔇 Additional comments (2)
xarray_plotly/plotting.py (2)

411-417: Excellent documentation addition!

This note clearly explains the key behavioral difference from px.imshow and provides important context for users working with animations and facets. The explanation is accurate based on the implementation (lines 458-469) and helps prevent confusion about auto-scaling behavior.


433-433: Clear improvement to parameter documentation.

Explicitly stating the default behavior "(uses min/max)" makes the documentation more helpful and removes ambiguity about what happens when robust=False.

@FBumann FBumann merged commit 16bb706 into main Jan 10, 2026
9 checks passed
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.

1 participant