fumitoh / modelx

Use Python like a spreadsheet!

Home Page:https://modelx.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Writing several modelx with the same pandas object names

alexeybaran opened this issue · comments

I have several model loaded with the same structure and names of input tables defined as modelx pandas objects. When writing the models, modelx tries to write tables from all the models into every model, ends up overwriting them several times. As a result, all the saved models contain the same input tables.
The bug seems to be in the io/baseio.py/IOManager/write_ios(), which is writing ios from all the models into a single model path. The following code change helped:

def write_ios(self, root, model):
      for key_io, a_io in self.ios.items():
          if key_io[0] == model:
              self.write_io(a_io, root)

@alexeybaran Thanks for the report. I'll reflect the fix.