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

No valueerror for underdetermined #6453

Merged
merged 11 commits into from Aug 27, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jul 31, 2022

Description

If accepted, this PR closes #6452.

Checklist

  • Neither the LineModelND docstring nor the CircleModel docstring documented the ValueError.
  • I could not find any examples that demonstrated the ValueErrors.
  • Benchmark in ./benchmarks, if your changes aren't covered by an
    existing benchmark
  • This PR includes changes to tests in skimage/measure. I ran all tests and none failed. 11 tests were skipped and 16 warnings were produced. It does not seem that the changes in this PR caused any of the warnings. I pasted my command line output below for reference.

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.
  • There is a bot to help automate backporting a PR to an older branch. For
    example, to backport to v0.19.x after merging, add the following in a PR
    comment: @meeseeksdev backport to v0.19.x
  • To run benchmarks on a PR, add the run-benchmark label. To rerun, the label
    can be removed and then added again. The benchmark output can be checked in
    the "Actions" tab.

Tests

================================================= warnings summary =================================================
skimage/future/graph/tests/test_rag.py::test_cut_normalized
skimage/future/graph/tests/test_rag.py::test_ncut_stable_subgraph
skimage/future/graph/tests/test_rag.py::test_reproducibility
  /Users/juancheeto/Desktop/scikit-image-dev/my_fork/skimage/future/graph/_ncut.py:25: DeprecationWarning: 
  
  The scipy.sparse array containers will be used instead of matrices
  in Networkx 3.0. Use `to_scipy_sparse_array` instead.
    W = nx.to_scipy_sparse_matrix(graph, format='csc')

skimage/io/tests/test_pil.py::test_imread_separate_channels
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (3, 16, 8) and dtype 'float64' are stored as RGB with separate component planes. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' and 'planarconfig' parameters are specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape1]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape2]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape1]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape2]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape1]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape2]
  /Users/juancheeto/miniforge3/envs/skimage-dev/lib/python3.10/site-packages/tifffile/tifffile.py:1145: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default unless the 'photometric' parameter is specified.
    result = tif.write(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================ 7950 passed, 11 skipped, 16 warnings in 115.39s (0:01:55) =============================```

Juan Fernandez and others added 5 commits July 16, 2022 13:38
Analog classes to LineModelND do not raise a ValueError when
inputs are under determined but instead return False.

Please see issue #6452, Proposed changes 1 and 2.

This commit also removes redundancies in test_fit.py.
Analog classes to CircleModel do not raise a ValueError when
inputs are under determined but instead return False.

Please see issue #6452, Proposed changes 3 and 4.
@pep8speaks
Copy link

pep8speaks commented Jul 31, 2022

Hello @judafe! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 151:80: E501 line too long (80 > 79 characters)

Comment last updated at 2022-08-26 22:00:51 UTC

Copy link
Member

@rfezzani rfezzani left a comment

Choose a reason for hiding this comment

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

Thank you @judafe, as I mentioned in #6452, a deprecation is probably necessary, but otherwise everything is fine 😉

@grlee77
Copy link
Contributor

grlee77 commented Aug 7, 2022

Thanks @judafe, good to see you back here. I wouldn't worry about those warnings. I had been meaning to fix the I/O ones for awhile, so this was a good motivation to go ahead and do it (see #6460)

skimage/measure/fit.py Outdated Show resolved Hide resolved
Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
@mkcor
Copy link
Member

mkcor commented Aug 26, 2022

CI is failing for linux-cp3.8-mini-req-eager-import and linux-cp3.8-mini-req-optional-deps with

ImportError: "<function show_rag at 0x7fe5b0767160>" in "skimage.future.graph.rag" requires "matplotlib >=3.5"

although

@require("matplotlib", ">=3.3")
🤔

@ghost
Copy link
Author

ghost commented Aug 26, 2022

ImportError: "<function show_rag at 0x7fe5b0767160>" in "skimage.future.graph.rag" requires "matplotlib >=3.5"

@mkcor, @require("matplotlib", ">=3.5") was brought by this commit a few days ago. That was reverted in this other commit.

@mkcor mkcor merged commit f8dfea6 into scikit-image:main Aug 27, 2022
@mkcor
Copy link
Member

mkcor commented Aug 27, 2022

Thanks, @judafe! I guess I didn't refresh my page 🙃

@jarrodmillman jarrodmillman added this to the 0.20 milestone Oct 4, 2022
lagru added a commit to lagru/scikit-image that referenced this pull request Oct 29, 2022
Instead of raising a ValueError, since
f8dfea6 [1] this is addressed by
returning `False`.

[1] scikit-image#6453
grlee77 added a commit that referenced this pull request Nov 30, 2022
* Complete deprecation of selem parameter

in favor of footprint. Though removed_version points at 1.0, the
deprecation is finished in 0.20 which was not planned at the time of
0.19's release.

* Complete deprecation of selem module

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of in_place parameter

in favor of "out".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of max_iterations parameter

in favor of "max_num_iter".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of max_iter parameter

in favor of "max_num_iter".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of iterations parameter

in favor of "num_iter".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of n_iter_max parameter

in favor of "max_num_iter".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of compute_hessian_eigenvalues

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of input parameter

in favor of "label_image".

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of greyco* functions

Though removed_version points at 1.0, the deprecation is finished in
0.20 which was not planned at the time of 0.19's release.

* Complete deprecation of multichannel kwarg

Though the default removed_version of deprecate_multichannel_kwarg
points at 1.0, the deprecation is finished in 0.20 which was not planned
at the time of 0.19's release.

* Remove unused deprecate_multichannel_kwarg

This decorator is no longer necessary since the deprecation of
multichannel is completed with 0.20 (previously 1.0).

Make test's independent of temporary decorations of library functions
such as hog and pyramid_gaussian. Their deprecation decorator was
removed.

* Complete deprecation of height, width in rectangle

and remove unused imports.

* Remove completed items in TODO.txt

For filters.inverse(), the removed_version targets 0.21 and not 0.20. So
move.

* Complete deprecation of neighbourhood parameter

I think removed_version="1.2" is actually supposed to be 1.0 (or 0.20).

* Remove deprecated grey and greyreconstruct modules

These deprecations are already part of 0.19. So it should be fine to
remove them in 0.20.

* Remove warning about deprecated *_iter

Missed this earlier.

* Revert "Complete deprecation of compute_hessian_eigenvalues"

This reverts commit 56f0431.

The deprecation of `compute_hessian_eigenvalues` was introduced after
all 0.19.x releases (see git tag --contains d2689f5)! So the target
should be 0.21.

* Deprecate automatic channel detection in gaussian

Automatic detection of the color channel based on the old deprecated
`multichannel=None` was broken in version 0.19. This commit recovers
the old behavior for 0.20 using a proxy object `ChannelAxisNotSet`.
The behavior is still deprecated though and should be removed completely
in 0.21.

Note that the warning is only raised if the automatic behavior deviates
from the behavior that will be the new default in 0.21, which is
`channel_axis=None`. This way we only notify users that were affected
by the broken behavior in 0.19 and now deprecated behavior in 0.20.

* Complete deprecation of coordinates parameter

in `regionprops` (since 0.16) and `active_contour` (since 0.18).

* Remove outdated TODO for CircleModel.estimate

Instead of raising a ValueError, since
f8dfea6 [1] this is addressed by
returning `False`.

[1] #6453

* Remove removed files from meson.build

These were removed in d951774 and
b53b46a.

* Remove obsolete tests for coordinates parameter

* Catch expected warning for deprecated color channel inference in gaussian

* Update skimage/_shared/filters.py

Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>

* Explain proxy value in more clearly

Co-authored-by: Gregory Lee <grlee77@gmail.com>
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 type: API Involves API change(s) 🔧 type: Maintenance Refactoring and maintenance of internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return False from LineModelND and CircleModel when inputs are underdetermined
5 participants