Skip to content

Commit

Permalink
Prep for v1.0 release (#2925)
Browse files Browse the repository at this point in the history
* Prep for v1.0 release

* Update release_notes.md

* Rename op_hint to _OP_HINT

* Update release_notes.md

* Update release_notes.md
  • Loading branch information
odow authored Mar 24, 2022
1 parent d719b92 commit d7f3e15
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JuMP"
uuid = "4076af6c-e467-56ae-b986-b466b2749572"
repo = "https://github.com/jump-dev/JuMP.jl.git"
version = "0.23.2"
version = "1.0.0"

[deps]
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ embedded in [Julia](https://julialang.org/). You can find out more about us by
visiting [jump.dev](https://jump.dev).


**Latest Release**: [![version](https://juliahub.com/docs/JuMP/DmXqY/0.23.2/version.svg)](https://juliahub.com/ui/Packages/JuMP/DmXqY/0.23.2) (`release-0.23` branch):
**Latest Release**: [![version](https://juliahub.com/docs/JuMP/DmXqY/1.0.0/version.svg)](https://juliahub.com/ui/Packages/JuMP/DmXqY/1.0.0) (`release-1.0` branch):
* Installation via the Julia package manager:
* `import Pkg; Pkg.add("JuMP")`
* Get help:
* Read the [Documentation](https://jump.dev/JuMP.jl/stable/)
* Ask a question on the [Community forum]
* Testing status:
* Github Actions: [![Build Status](https://github.com/jump-dev/JuMP.jl/workflows/CI/badge.svg?branch=release-0.22)](https://github.com/jump-dev/JuMP.jl/actions?query=workflow%3ACI)
* Github Actions: [![Build Status](https://github.com/jump-dev/JuMP.jl/workflows/CI/badge.svg?branch=release-1.0)](https://github.com/jump-dev/JuMP.jl/actions?query=workflow%3ACI)
* [![deps](https://juliahub.com/docs/JuMP/deps.svg)](https://juliahub.com/ui/Packages/JuMP/DmXqY?t=2)

**Development version** (`master` branch):
Expand Down
26 changes: 26 additions & 0 deletions docs/src/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Release notes

## Version 1.0.0 (March 24, 2022)

**Read more about this release, along with an ackowledgement of all the
contributors in our [JuMP 1.0.0 is released](https://jump.dev/blog/1.0.0-release/)
blog post.**

For a detailed list of the closed issues and pull requests from this release,
see the [tag notes](https://github.com/jump-dev/JuMP.jl/releases/tag/v1.0.0).
A summary of changes are as follows:

- Breaking changes:
- The previously deprecated functions have been removed:
- `num_nl_constraints`
- `all_nl_constraints`
- `add_NL_expression`
- `set_NL_objective`
- `add_NL_constraint`
- `nl_expr_string`
- `nl_constraint_string`
- `SymMatrixSpace`
- The unintentionally exported variable `JuMP.op_hint` has been renamed to the
unexported `JuMP._OP_HINT`
- Bug fixes:
- Fixed a bug writing .nl files
- Fixed a bug broadcasting `SparseAxisArray`s

## Version 0.23.2 (March 14, 2022)

For a detailed list of the closed issues and pull requests from this release,
Expand Down
6 changes: 0 additions & 6 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,6 @@ function num_nonlinear_constraints(model::Model)
return model.nlp_data !== nothing ? length(model.nlp_data.nlconstr) : 0
end

function num_nl_constraints(::Model)
return error(
"`num_nl_constraints` has been renamed to `num_nonlinear_constraints`",
)
end

"""
object_dictionary(model::Model)
Expand Down
24 changes: 0 additions & 24 deletions src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ function all_nonlinear_constraints(model::Model)
end
end

function all_nl_constraints(::Model)
return error(
"`all_nl_constraints`` has been renamed `all_nonlinear_constraints`",
)
end

"""
is_valid(model::Model, c::NonlinearConstraintRef)
Expand Down Expand Up @@ -2254,12 +2248,6 @@ function add_nonlinear_expression(model::Model, ex)
return NonlinearExpression(model, _NonlinearExprData(model, ex))
end

function add_NL_expression(::Model, ::Expr)
return error(
"`add_NL_expression` has been renamed to `add_nonlinear_expression`",
)
end

"""
set_nonlinear_objective(
model::Model,
Expand Down Expand Up @@ -2288,12 +2276,6 @@ function set_nonlinear_objective(model::Model, sense::MOI.OptimizationSense, x)
return set_objective(model, sense, _NonlinearExprData(model, x))
end

function set_NL_objective(::Model, ::MOI.OptimizationSense, ::Expr)
return error(
"`set_NL_objective` has been renamed to `set_nonlinear_objective`",
)
end

"""
add_nonlinear_constraint(model::Model, expr::Expr)
Expand Down Expand Up @@ -2377,9 +2359,3 @@ function add_nonlinear_constraint(model::Model, ex::Expr)
)
end
end

function add_NL_constraint(::Model, ::Expr)
return error(
"`add_NL_constraint` has been renamed to `add_nonlinear_constraint`",
)
end
12 changes: 6 additions & 6 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,15 @@ end
# nonlinear function fallbacks for JuMP built-in types
###############################################################################

const op_hint = "Are you trying to build a nonlinear problem? Make sure you use @NLconstraint/@NLobjective."
const _OP_HINT = "Are you trying to build a nonlinear problem? Make sure you use @NLconstraint/@NLobjective."
for (func, _) in Calculus.symbolic_derivatives_1arg(),
typ in [:AbstractVariableRef, :GenericAffExpr, :GenericQuadExpr]

if func == :abs2 && (typ == :AbstractVariableRef || typ == :GenericAffExpr)
continue
end

errstr = "$func is not defined for type $typ. $op_hint"
errstr = "$func is not defined for type $typ. $_OP_HINT"
if isdefined(Base, func)
@eval Base.$(func)(::$typ) = error($errstr)
end
Expand All @@ -417,11 +417,11 @@ function Base.:*(
T<:GenericQuadExpr,
S<:Union{AbstractVariableRef,GenericAffExpr,GenericQuadExpr},
}
return error("*(::$T,::$S) is not defined. $op_hint")
return error("*(::$T,::$S) is not defined. $_OP_HINT")
end
function Base.:*(lhs::GenericQuadExpr, rhs::GenericQuadExpr)
return error(
"*(::GenericQuadExpr,::GenericQuadExpr) is not defined. $op_hint",
"*(::GenericQuadExpr,::GenericQuadExpr) is not defined. $_OP_HINT",
)
end
function Base.:*(
Expand All @@ -431,7 +431,7 @@ function Base.:*(
T<:GenericQuadExpr,
S<:Union{AbstractVariableRef,GenericAffExpr,GenericQuadExpr},
}
return error("*(::$S,::$T) is not defined. $op_hint")
return error("*(::$S,::$T) is not defined. $_OP_HINT")
end
function Base.:/(
::S,
Expand All @@ -440,5 +440,5 @@ function Base.:/(
S<:Union{_Constant,AbstractVariableRef,GenericAffExpr,GenericQuadExpr},
T<:Union{AbstractVariableRef,GenericAffExpr,GenericQuadExpr},
}
return error("/(::$S,::$T) is not defined. $op_hint")
return error("/(::$S,::$T) is not defined. $_OP_HINT")
end
4 changes: 0 additions & 4 deletions src/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ function nonlinear_constraint_string(
return string(nl, " ", rel, " ", _string_round(_rhs(c)))
end

@deprecate nl_constraint_string nonlinear_constraint_string

"""
constraints_string(mode, model::AbstractModel)::Vector{String}
Expand Down Expand Up @@ -405,8 +403,6 @@ function nonlinear_expr_string(model::Model, mode::MIME, c::_NonlinearExprData)
return string(_latexify_exponentials(mode, ex))
end

@deprecate nl_expr_string nonlinear_expr_string

# Change x ^ -2.0 to x ^ {-2.0}
# x ^ (x ^ 2.0) to x ^ {x ^ {2.0}}
# and so on
Expand Down
4 changes: 0 additions & 4 deletions src/sd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ julia> @variable(model, Q[1:2, 1:2] in SymmetricMatrixSpace())
"""
struct SymmetricMatrixSpace end

function SymMatrixSpace()
return error("`SymMatrixSpace` has been renamed to `SymmetricMatrixSpace`")
end

"""
SkewSymmetricMatrixSpace()
Expand Down
14 changes: 0 additions & 14 deletions test/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1280,20 +1280,6 @@ function test_dual_start_value()
return
end

function test_nonlinear_deprecations()
model = Model()
@variable(model, x)
@test_throws(ErrorException, num_nl_constraints(model))
@test_throws(ErrorException, all_nl_constraints(model))
@test_throws(ErrorException, add_NL_constraint(model, :(x[$x] <= 1)))
@test_throws(ErrorException, add_NL_expression(model, :(x[$x] + 1)))
@test_throws(
ErrorException,
set_NL_objective(model, MOI.MIN_SENSE, :(x[$x] + 1)),
)
return
end

function test_user_defined_function_checked_error_univariate()
function f(x)
if x >= 1
Expand Down

2 comments on commit d7f3e15

@odow
Copy link
Member Author

@odow odow commented on d7f3e15 Mar 24, 2022

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/57258

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.0 -m "<description of version>" d7f3e15f33f2783e4046c3ec7bf018dca918025d
git push origin v1.0.0

Please sign in to comment.