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

Error in pyomo_fastbuild without using fast build #68

Closed
uvchik opened this Issue Jan 26, 2016 · 9 comments

Comments

Projects
None yet
3 participants
@uvchik
Copy link
Member

uvchik commented Jan 26, 2016

@simonhilpert , @ckaldemeyer

I get an error running the storage_invest.py on the dev branch. The error occurs in the pyomo_fastbuild module but I did not change an attribute.

Traceback (most recent call last):
  File "/home/uwe/rli-lokal/git_home/oemof_base/examples/storage_optimization/storage_invest.py", line 157, in <module>
    om = OptimizationModel(energysystem=energysystem)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 121, in __init__
    assembler.registry[cls](e=None, om=self, block=block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 470, in _
    om.default_assembler(block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 179, in default_assembler
    block.optimization_options[option](self, block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 464, in linear_constraints
    lc.add_simple_io_relation(om, block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/linear_constraints.py", line 183, in add_simple_io_relation
    block.indexset)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/pyomo_fastbuild.py", line 60, in l_constraint
    v._data[i] = pyomo.core.base.constraint._GeneralConstraintData(None, v)
AttributeError: 'module' object has no attribute '_GeneralConstraintData'

@uvchik uvchik added bug urgent labels Jan 26, 2016

@uvchik uvchik added this to the January 2016 Release milestone Jan 26, 2016

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Jan 26, 2016

I do not get an error on the dev branch using this example...(without and with fast_build=True)

what pyomo version are you using? (I use: Pyomo 4.2.10784)

pyomo --version in the console will print out the version

But I get an error from the outputlib...

@uvchik

This comment has been minimized.

Copy link
Member Author

uvchik commented Jan 26, 2016

That is strange. My version is Pyomo 4.1.10527 which is not a very old version.

It's not your fault but it is annoying if one gets an error having a version that is a few month old.

An update fixed it but I still do not understand why python goes into this module when I do not choose the fast build. That should not happen.

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Jan 26, 2016

Good that it fixed it. It should actually not load this module...i guess.
that is acutally the answer to your question, why we do not implement the fast_build as a standard way,
because it's based on a specific version / internal pyomo structure.

But of course it should not throw an error if you do not select fats_build.

@uvchik uvchik removed the urgent label Jan 26, 2016

@uvchik

This comment has been minimized.

Copy link
Member Author

uvchik commented Jan 26, 2016

So it is not urgent any more but could you or anybody else fix it anyway?

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Jan 26, 2016

@gnn can you have a look at it?

@simnh simnh assigned gnn and unassigned simnh Jan 26, 2016

@gnn

This comment has been minimized.

Copy link
Member

gnn commented Jan 29, 2016

Yeah, I'll look into it, but probably not before the release.

@uvchik

This comment has been minimized.

Copy link
Member Author

uvchik commented Feb 19, 2016

I found out what causes the problem. If it is not set it is a tuple by default.

>>> print(type(model.energysystem.simulation.fast_build))
<class 'tuple'>
>>> print(model.energysystem.simulation.fast_build)
(False,)
>>> print(not model.energysystem.simulation.fast_build)
False

@simonhilpert , @ckaldemeyer , @gnn : Could anybody, who merged this feature fix this bug!

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Feb 19, 2016

Thanks, there was a ',' too much...check if it works now , then close please

@uvchik

This comment has been minimized.

Copy link
Member Author

uvchik commented Feb 22, 2016

Thank you, seems to work now.

@uvchik uvchik closed this Feb 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment