Registry Mirror
Skip to content

Conversation

@dolliecoder

Copy link
Copy Markdown
Contributor

This PR fixes the documentation rendering issue for set_options by applying the workaround discussed in #10832.

Inline set/tuple defaults in the parameter list are replaced with optional, and default values and allowed options are documented explicitly in the parameter descriptions. This avoids relying on napoleon to render tuple defaults while preserving all existing information.

This is a documentation-only change; no behavior or API changes are made.

Checklist

Closes #10832

Tests added (not applicable — documentation-only change)

User visible changes (including notable bug fixes) are documented in whats-new.rst (not applicable — docs formatting fix only)

New functions/methods are listed in api.rst (not applicable — no new APIs)

@dolliecoder

Copy link
Copy Markdown
Contributor Author

The Read the Docs build failed due to excessive memory consumption during the docs environment setup (pixi install -e doc).

This appears to be an RTD infrastructure issue rather than a documentation error introduced by this PR. Happy to adjust if you’d like me to make any changes.

@keewis keewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for picking this up, @dolliecoder.

#10832 was only about netcdf_engine_order, which had a list of string as a default value (which you changed, so that's great).

However, could restore the value sets (e.g. {v1, v2, v3}), please? Those are rendered properly, and it is a bit easier to find the values that way. The other changes are nice, too, so I've added an example of what I would restore below.

Comment thread xarray/core/options.py Resolved
@keewis

keewis commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

the RTD build was flaky, it succeeded on the second try

@dolliecoder

Copy link
Copy Markdown
Contributor Author

@keewis Thanks! I've restored the value-set formatting and limited the changes strictly to netcdf_engine_order. Let me know if this now matches expectations.

@keewis keewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not quite, what I meant was to put the value-set in the place where you have optional right now. With that, the entire part would become something like:

    arithmetic_compat: {"identical", "equals", "broadcast_equals", "no_conflicts", "override", "minimal"}, default: "minimal"
        How to compare non-index coordinates of the same name for potential
        conflicts when performing binary operations. (For the alignment of index
        coordinates in binary operations, see `arithmetic_join`.)

        Allowed values are:

        - ``"identical"``: all values, dimensions and attributes of the coordinates
          must be the same.
        - ``"equals"``: all values and dimensions of the coordinates must be the
          same.
        - ``"broadcast_equals"``: all values of the coordinates must be equal after
          broadcasting to ensure common dimensions.
        - ``"no_conflicts"``: only values which are not null in both coordinates
          must be equal. The returned coordinate then contains the combination
          of all non-null values.
        - ``"override"``: skip comparing and take the coordinates from the first
          operand.
        - ``"minimal"``: drop conflicting coordinates.

(and similarly for all the other sections except netcdf_engine_order)

Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
dolliecoder and others added 3 commits February 13, 2026 15:06
Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
@dolliecoder

Copy link
Copy Markdown
Contributor Author

@

not quite, what I meant was to put the value-set in the place where you have optional right now. With that, the entire part would become something like:

    arithmetic_compat: {"identical", "equals", "broadcast_equals", "no_conflicts", "override", "minimal"}, default: "minimal"
        How to compare non-index coordinates of the same name for potential
        conflicts when performing binary operations. (For the alignment of index
        coordinates in binary operations, see `arithmetic_join`.)

        Allowed values are:

        - ``"identical"``: all values, dimensions and attributes of the coordinates
          must be the same.
        - ``"equals"``: all values and dimensions of the coordinates must be the
          same.
        - ``"broadcast_equals"``: all values of the coordinates must be equal after
          broadcasting to ensure common dimensions.
        - ``"no_conflicts"``: only values which are not null in both coordinates
          must be equal. The returned coordinate then contains the combination
          of all non-null values.
        - ``"override"``: skip comparing and take the coordinates from the first
          operand.
        - ``"minimal"``: drop conflicting coordinates.

(and similarly for all the other sections except netcdf_engine_order)

thanks for the suggestions .I have applied the changes
if anything else needs to be adjusted please let me know.

@dolliecoder

Copy link
Copy Markdown
Contributor Author

@keewis Hi, Please let me know if any additional changes are required from my side.
Happy to refine this further.

@jsignell jsignell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this @dolliecoder I went through and made some suggestions. They are almost all just about replacing optional with the set of options.

Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
Comment thread xarray/core/options.py Resolved
headtr1ck and others added 3 commits October 12, 2026 12:08
Resolve the conflicts in the set_options docstring with the new
facetgrid_figsize option and the new use_bottleneck default, and apply the
review suggestions: put the value sets with their defaults back into the
type lines instead of "optional", and restore the new values of
use_new_combine_kwarg_defaults.

netcdf_engine_order can't have its default in the type line, as napoleon
renders any list or tuple there incorrectly (pydata#10832). Put the allowed values
there instead and state the default in the description.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
display_default_indexes, display_expand_groups and enable_cftimeindex can
be set with set_options but were not documented. display_expand_groups has
no effect since the DataTree HTML repr was reworked in pydata#10816 and
enable_cftimeindex is a deprecated no-op, which is now stated as well.

Co-authored-by: Claude <noreply@anthropic.com>
@headtr1ck headtr1ck added topic-documentation plan to merge Final call for comments labels Oct 12, 2026

@headtr1ck headtr1ck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thx!

@headtr1ck
headtr1ck enabled auto-merge (squash) October 12, 2026 10:46
@headtr1ck
headtr1ck dismissed jsignell’s stale review October 12, 2026 20:35

All suggestions resolved

@headtr1ck
headtr1ck merged commit 1b7f57f into pydata:main Oct 12, 2026
44 of 46 checks passed
@welcome

welcome Bot commented Oct 12, 2026

Copy link
Copy Markdown

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

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.

Documentation rendering bug - set_options

4 participants