|
1 | 1 | #= |
2 | 2 | This file gathers all the deprecated names (structures, functions, or variables) which will be removed in the future major release. |
3 | 3 |
|
4 | | -- Before the major release, the deprecated names will just throw errors when they are called. |
| 4 | +- Before the major release, the deprecated names will show warnings or just throw errors when they are called. |
5 | 5 | - If the deprecated names were once exported, we will still export them here until next major release. |
6 | 6 | - If we decide to push a major release, cleanup this file. |
7 | 7 |
|
8 | | -Example: |
9 | | -
|
| 8 | +Example 1 [throw errors if the deprecation is fundamental, and there is no replacement for it]: |
| 9 | +``` |
10 | 10 | export deprecated_foo |
| 11 | +deprecated_foo(args...; kwargs...) = error("`deprecated_foo` is deprecated and will be removed in next major release.") |
| 12 | +``` |
| 13 | +
|
| 14 | +Example 2 ["force" show warning and tell the users that there is a replacement for the deprecated function]: |
11 | 15 |
|
| 16 | +``` |
| 17 | +export deprecated_foo |
12 | 18 | function deprecated_foo(args...; kwargs...) |
13 | | - error("`deprecated_foo` has been deprecated and will be removed in next major release, please use `new_foo` instead.") |
| 19 | + Base.depwarn("`deprecated_foo` is deprecated and will be removed in next major release, use `new_foo` instead.", :deprecated_foo, force = true) |
| 20 | + new_foo(args...; kwargs...) |
14 | 21 | end |
| 22 | +``` |
15 | 23 | =# |
16 | 24 |
|
17 | | -export evolution, SteadyState, C |
18 | | - |
19 | | -SteadyState(args...; kwargs...) = error("`SteadyState` has been deprecated, please use `steadystate` instead.") |
| 25 | +export SteadyState |
| 26 | +function SteadyState(args...; kwargs...) |
| 27 | + Base.depwarn( |
| 28 | + "`SteadyState` is deprecated and will be removed in next major release, use `steadystate` instead.", |
| 29 | + :SteadyState, |
| 30 | + force = true, |
| 31 | + ) |
| 32 | + return steadystate(args...; kwargs...) |
| 33 | +end |
20 | 34 |
|
21 | | -evolution(args...; kwargs...) = error("`evolution` has been deprecated, please use `HEOMsolve` instead.") |
| 35 | +export evolution |
| 36 | +function evolution(args...; kwargs...) |
| 37 | + Base.depwarn( |
| 38 | + "`evolution` is deprecated and will be removed in next major release, use `HEOMsolve` instead.", |
| 39 | + :evolution, |
| 40 | + force = true, |
| 41 | + ) |
| 42 | + return HEOMsolve(args...; kwargs...) |
| 43 | +end |
22 | 44 |
|
23 | | -C(args...; kwargs...) = error("`C` has been deprecated, please use `correlation_function` instead.") |
| 45 | +export C |
| 46 | +function C(args...) |
| 47 | + Base.depwarn( |
| 48 | + "`C` is deprecated and will be removed in next major release, use `correlation_function` instead.", |
| 49 | + :C, |
| 50 | + force = true, |
| 51 | + ) |
| 52 | + return correlation_function(args...) |
| 53 | +end |
24 | 54 |
|
25 | 55 | _HEOMSuperOp_deprecated_method_error() = error( |
26 | 56 | "Specifying `mul_basis = \"L\", \"R\", or \"LR\"` to `HEOMSuperOp` has been deprecated, try to construct system SuperOperator manually by using `spre`, `spost`, or `sprepost`.", |
|
0 commit comments