Skip to content

modelx GUI error while reading complex model #153

Answered by fumitoh
bakerwy asked this question in Q&A
Discussion options

You must be logged in to vote

I made a test model from IntegratedLife in lifelib.appliedlife. The ProductBase space has more than 100 cells. I made 200 copies of it so the model has 20,000 cells.

import modelx as mx

model = mx.read_model("IntegratedLife")


for i in range(200):
    model.ProductBase.copy(model, name=f"ProductBase_{i:03}")
    
model.write("IntegratedLife_200")

Then checked how long it took to load:

>>> import modelx as mx

>>> import timeit

>>> timeit.timeit("m = mx.read_model('IntegratedLife_200')", number=1, globals=globals())
56.238088199985214

It took less than a minute. So, thre's something specific about your model that's making it open so slow.

One way to check it is to profile the loading us…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@bakerwy
Comment options

@fumitoh
Comment options

Comment options

You must be logged in to vote
1 reply
@bakerwy
Comment options

Answer selected by bakerwy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants