-
Notifications
You must be signed in to change notification settings - Fork 35
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
Proposition: Change meta
(add get(nlp, :thing)
)
#92
Comments
We could probably use an overarching nvar(model::AbstractNLPModel) = model.meta.nvar
ncon(model::AbstractNLPModel) = model.meta.nvar
... which may look more intuitive than |
Yes, this also works for my use case. I'll try this change on the |
What I missed before is that these names are fairly common choices for variables, and thye would conflict. nvar = nvar(nlp)
...
nvar(nlp) # error in the same scope On the other hand, usually you would either have a single function FeasModel(nlp :: AbstractNLPModel; name::String = name(nlp))
...
end in which case, Do you see this becoming a problem? |
I was wrong, foo(a) = a+1
function bar()
foo = foo(2)
end
bar() # ERROR: UndefVarError: foo not defined I think the best approach here would be create a descriptive function call, e.g. |
How about |
Not implementing as discussed in #237. |
Instead of using
nlp.meta.nvar
, useget(nlp, :nvar)
orgetfield
.In particular, a related problem is in the
NLS
#91nls_meta
. Since we don't have OO, we can't havenls_meta
extendingmeta
only includingnequ
. With the proposed change, though, we can defineThe text was updated successfully, but these errors were encountered: