Skip to content

Add deprecated message for conversions number to interval #98

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

Merged
merged 4 commits into from
May 11, 2022

Conversation

hyrodium
Copy link
Collaborator

@hyrodium hyrodium commented Apr 2, 2022

This PR fixes #97.

I just removed the conversion methods. Should we add deprecation messages instead?
I guess the conversions are probably not well used.

@codecov
Copy link

codecov bot commented Apr 2, 2022

Codecov Report

Merging #98 (36c1dc5) into master (4a6e746) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 36c1dc5 differs from pull request most recent head d9ba6b9. Consider uploading reports for the commit d9ba6b9 to get more accurate results

@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
+ Coverage   99.19%   99.23%   +0.04%     
==========================================
  Files           3        3              
  Lines         248      261      +13     
==========================================
+ Hits          246      259      +13     
  Misses          2        2              
Impacted Files Coverage Δ
src/IntervalSets.jl 99.17% <100.00%> (+0.09%) ⬆️
src/interval.jl 99.10% <0.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a6e746...d9ba6b9. Read the comment docs.

@timholy
Copy link
Member

timholy commented Apr 3, 2022

I would favor a deprecation, that way we don't have to bump the minor version immediately.

@dlfivefifty
Copy link
Member

I don’t remember writing these conversions. @daanhb was it you? Any comments?

@hyrodium
Copy link
Collaborator Author

hyrodium commented Apr 3, 2022

I don’t remember writing these conversions. @daanhb was it you? Any comments?

@dlfivefifty
Maybe by you? 😄

@hyrodium
Copy link
Collaborator Author

hyrodium commented Apr 3, 2022

I would favor a deprecation, that way we don't have to bump the minor version immediately.

I thought the next release will be v0.7.0 if we resolve #86 with #93. (cf #94)
I propose dropping support for 1..missing and making 1..missing throws an error.

We can release v0.6.1 with deprecation messages for the conversion of a number to an interval, but I think very few people need this deprecation.

(This is not a strong opinion and I'm okay with the deprecation messages.)

@hyrodium
Copy link
Collaborator Author

hyrodium commented Apr 3, 2022

I'll update this PR with the deprecation messages (x-ref #94 (comment))

@timholy
Copy link
Member

timholy commented Apr 3, 2022

I like the idea of the deprecation because the standard Julia package management makes it easy to see how to fix things:

  • receive a CompatHelper PR proposing to update the [compat]
  • but the PR CI fails...let's make sure it really works on the current version
  • run the tests, see the hint about how to fix it, and profit

@daanhb
Copy link
Contributor

daanhb commented Apr 3, 2022

I don’t remember writing these conversions. @daanhb was it you? Any comments?

I don't think I will miss these conversions, at least I don't recall ever using them. In any case there are other ways of converting a number to a domain.

@hyrodium hyrodium force-pushed the fix/number_conversion branch from beb832e to 0a4423e Compare April 4, 2022 14:28
@hyrodium
Copy link
Collaborator Author

hyrodium commented Apr 4, 2022

I updated the conversions with deprecated messages.

$ julia --depwarn=yes
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.1 (2021-12-22)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using IntervalSets

julia> convert(ClosedInterval, 1)
┌ Warning: `The conversion number to interval will be removed.
│   caller = top-level scope at REPL[2]:1
└ @ Core REPL[2]:1
1..1

@hyrodium hyrodium changed the title Remove conversion number to interval Add deprecated message for conversions number to interval Apr 4, 2022
Co-authored-by: Tim Holy <[email protected]>
@timholy
Copy link
Member

timholy commented Apr 4, 2022

Note there are quite a few others that should be changed similarly.

@hyrodium hyrodium merged commit e7d0d3e into JuliaMath:master May 11, 2022
@JeffFessler JeffFessler mentioned this pull request May 14, 2022
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.

Drop support for convert(ClosedInterval,3)?
4 participants