-
-
Notifications
You must be signed in to change notification settings - Fork 401
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
Add Pluralization of @NLparameters (#2593) #2619
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2619 +/- ##
=======================================
Coverage 93.50% 93.50%
=======================================
Files 44 44
Lines 5544 5544
=======================================
Hits 5184 5184
Misses 360 360
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest that you make clear the syntax for begin ... end blocks:
"Distinct parameters need to be placed on seperate lines without base_names as in the following example."
This is because other objects (such as variables and constraints) can be assigned names.
Sure, I'll update it. |
What was meant is that somewhere it should be clear that, unlike variables
and constraints, parameters cannot be given a ```name::String```.
…On Tue, Jun 1, 2021 at 6:49 AM Oscar Dowson ***@***.***> wrote:
***@***.**** approved this pull request.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2619 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKZONACETRL4RTAV7J334UDTQPY6DANCNFSM452FJUIA>
.
|
This is covered in the docstring of |
We wouldn't want any redundancy now would we :) I think you're assuming that someone will first learn the singular and then the plural. But things don't always work that way in practice. The fact that NLparameters is a pluralisation of NLparameter and constructed via a macro is incidental to the way JuMP was built. It has nothing to do with the perspective of the user. |
We link to the Error messages should tell what people did wrong (this isn't the greatest example because it actually looks like a bug!: julia> @NLparameter(model, p == 1, base_name = "x")
ERROR: LoadError: At REPL[7]:1: `@NLparameter(model, p == 1)`: Too many arguments.
Stacktrace:
[1] error(::String, ::String)
@ Base ./error.jl:42
[2] _macro_error(macroname::Symbol, args::Tuple{Symbol, Expr}, source::LineNumberNode, str::String)
@ JuMP ~/.julia/dev/JuMP/src/macros.jl:1365
[3] (::JuMP.var"#_error#122"{LineNumberNode, Symbol, Expr})(str::String)
@ JuMP ~/.julia/dev/JuMP/src/macros.jl:2114
[4] var"@NLparameter"(__source__::LineNumberNode, __module__::Module, m::Any, ex::Any, extra::Vararg{Any, N} where N)
@ JuMP ~/.julia/dev/JuMP/src/macros.jl:2118
in expression starting at REPL[7]:1 Edit: I opened an issue: #2620 |
Fixes Issue #2593 .
Please suggest ways in which this PR can be improved :)