SEL-Columbia / networkplanner

Electricity infrastructure prototyping framework
networkplanner.modilabs.org
15 stars 3 forks source link

Scenario fails at final stage after running through all segments #108

Closed Naigege closed 10 years ago

Naigege commented 10 years ago

This time, NP built the network from segments and processed the segments (half of segments processed in my last time check). So I suspect it fails at the end stage.

The scenario number is 672, and the same input files are used.

The error codes:

Traceback (most recent call last): File "utilities/harvest.py", line 53, in scenario.run() File "/var/www/np/np/model/init.py", line 262, in run networkValueByOptionBySection = datasetStore.buildNetwork(networkModel, networkConfiguration, jobLogger=Job) File "/var/www/np/np/lib/dataset_store.py", line 269, in buildNetwork self.session.commit() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 614, in commit self.transaction.commit() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 385, in commit self._prepare_impl() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 369, in _prepare_impl self.session.flush() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1388, in flush self._flush(objects) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1469, in _flush flush_context.execute() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 302, in execute rec.execute(self) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 446, in execute uow File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 1878, in _save_obj execute(statement, params) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1191, in execute params) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1271, in _execute_clauseelement return self.__execute_context(context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1302, in __execute_context context.parameters[0], context=context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1401, in _cursor_execute context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1394, in _cursor_execute context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 299, in do_execute cursor.execute(statement, parameters) IntegrityError: (IntegrityError) columns node1_id, node2_id are not unique u'INSERT INTO segments (node1_id, node2_id, subnet_id, is_existing, weight) VALUES (?, ?, ?, ?, ?)' (298, 1422, 1, 0, 222.16624450683594)

chrisnatali commented 10 years ago

Fixed. See #107