fumitoh / modelx

Use Python like a spreadsheet!
https://modelx.io
GNU Lesser General Public License v3.0
96 stars 21 forks source link

New dynamic space reference model error #37

Closed alexeybaran closed 3 years ago

alexeybaran commented 3 years ago

Below is an illustration of the blocking issue I have after upgrading modelx to the recent version with updated dynamic reference structure:

import modelx as mx
m = mx.new_model()
m.new_space('a')

def t_arg():
    pass

m.new_space('b')
m.new_space('c', formula=t_arg, refs={'x': m.b})
m.a.new_space('d',refs={'c':m.c()})
print(m.a.d.c)
mx.write_model(m,'m')
m2 = mx.read_model('m')
print(m2.a.d.c)
fumitoh commented 3 years ago

What modelx version did you confirm this was working with before?

alexeybaran commented 3 years ago

version 0.9.0