-
Notifications
You must be signed in to change notification settings - Fork 526
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
Variable indexed by Any #1050
Comments
It looks like this was partially documented in an old rst file that was lost during the documentation reorganization (https://github.com/Pyomo/pyomo/blob/cc58252fca1bc489789527038ea4a1c290b6b726/doc/attic/old_sphinx_files/tutorial/index.rst) but I agree that our current documentation should include this point either in the section describing |
This should definitely be included in the Var documentation. In addition, this is indeed a poor error message. PEP #326 would introduce more consistent handling of infinite Set objects. At that point, we could do one of two things:
|
#2184 added a nice warning when you don't specify |
It came as a bit of a surprise to me that
m.maybe = Var(Any)
throws an error:RuntimeError: Cannot iterate over abstract Set 'Any' before it has been constructed (initialized).
m.maybe=Var(Any, dense=False)
works as expected, which makes some sense after digging into the code. But it seems like this is something that should at least be documented, especially since this is unique to indexing a Var by Any. (And I think this is still a reasonable thing to do since VarList does not give you control over the names of the keys.)The text was updated successfully, but these errors were encountered: