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

DOC: correct return type in disjoint_set.subsets docstring #13926

Merged
merged 1 commit into from Apr 23, 2021

Conversation

pmla
Copy link
Contributor

@pmla pmla commented Apr 23, 2021

What does this implement/fix?

The docstring of the scipy.cluster.hierarchy.disjoint_set.subsets method states that the return value is a set. It is in fact a list, but I think that an iterator would be more in the spirit of modern python.

I have changed the return type to an iterator and updated the docstring. This is a breaking change, albeit a small one in a new module - @rgommers could you advise?

@pmla pmla added enhancement A new feature or improvement scipy.cluster Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels Apr 23, 2021
@rgommers
Copy link
Member

While DisjointSet likely won't have many users yet, we try to make a habit of not making such changes.

I agree the new API is a little nicer, but I think if you want to make this change you should use some graceful switch-over method. It's not that easy to do nicely (adding a simple FutureWarning can't be worked around for example), so perhaps adding a iterator=False keyword is the way to go.

@pmla pmla force-pushed the disjoint-set-subsets-iterator branch from 70bdc0d to de81c72 Compare April 23, 2021 10:32
@pmla pmla changed the title DOC/ENH: return iterator in disjoint_set.subsets DOC: correct return type in disjoint_set.subsets docstring Apr 23, 2021
@pmla
Copy link
Contributor Author

pmla commented Apr 23, 2021

OK - thanks Ralf. I have just corrected the docstring instead to reflect the current return type. Will merge when CI is green.

@pmla pmla merged commit 6ed5715 into scipy:master Apr 23, 2021
@tylerjereddy tylerjereddy added this to the 1.7.0 milestone Apr 23, 2021
patnr added a commit to patnr/scipy that referenced this pull request May 3, 2021
* master: (164 commits)
  DOC: Add Karl Pearson's reference to chi-square test (scipy#13971)
  BLD: fix build warnings for causal/anticausal pointers in ndimage
  MAINT: stats: Fix unused imports and a few other issues related to imports.
  DOC: fix typo
  MAINT: Remove duplicate calculations in sokalmichener
  BUG: spatial: fix weight handling of `distance.sokalmichener`.
  DOC: update Readme (scipy#13910)
  MAINT: QMCEngine d input validation (scipy#13940)
  MAINT: forward port 1.6.3 relnotes
  REL: add PEP 621 (project metadata in pyproject.toml) support
  EHN: signal: make `get_window` supports `general_cosine` and `general_hamming` window functions. (scipy#13934)
  ENH/DOC: pydata sphinx theme polishing (scipy#13814)
  DOC/MAINT: Add copyright notice to qmc.primes_from_2_to (scipy#13927)
  BUG: DOC: signal: fix need argument config and add missing doc link for `signal.get_window`
  DOC: fix subsets docstring (scipy#13926)
  BUG: signal: fix get_window argument handling and add tests. (scipy#13879)
  ENH: stats: add 'alternative' parameter to ansari (scipy#13650)
  BUG: Reactivate conda environment in init
  MAINT: use dict built-in rather than OrderedDict
  Revert "CI: Add nightly release of NumPy in linux workflows (scipy#13876)" (scipy#13909)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org enhancement A new feature or improvement scipy.cluster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants