PyomoGallery icon indicating copy to clipboard operation
PyomoGallery copied to clipboard

Error with symbol_map creation in asl_io.write.write_nl

Open vvvol opened this issue 1 year ago • 2 comments

On attempt to run simplest example in asl_io.write I have an error AttributeError: 'float' object has no attribute 'model' The error occurs in line #28 of write.py in preparing symbol_cuid_pairs . I use Python 3.11.4 (miniconda) and Pyomo 6.7.1 It is the first time when I see this error on using Pyomo and your excellent asl_io functions. Bad news is that I have got the same error and with other Pyomo models...

vvvol avatar Jul 10 '24 12:07 vvvol

FYI, this error appears with various Python 3.* interpreters but for Pyomo version younger than 6.5.0 only ! For Pyomo v. 6.5.0 and older the function write.write_nl() works normally.

vvvol avatar Jul 10 '24 18:07 vvvol

Thank you for this issue - I couldn't figure the problem either, so I've downgraded my Pyomo version. I haven't been able to figure out which part of the 6.6.0 update broke this functionality. In 6.7.3, I got an error of AttributeError: 'NoneType' object has no attribute 'model' The error specifically calls to

  File "**\Python312\Lib\site-packages\pyomo\core\base\componentuid.py", line 414, in _generate_cuid
    model = component.model()
            ^^^^^^^^^^^^^^^

but I simply can't figure out what the update changed. Thank you for the functions, and if anyone can see a fix, I'd love to see it

Engberg-Jacob avatar Aug 21 '24 12:08 Engberg-Jacob