mimiframework / Mimi.jl

Integrated Assessment Modeling Framework
https://www.mimiframework.org
Other
66 stars 34 forks source link

Explore windows broken when model included as a parameter #994

Closed jrising closed 2 months ago

jrising commented 3 months ago

(The description here might sound esoteric, but I think it's going to be a common code structure until some other Mimi changes come along.)

I regularly find that that I need to include the model itself in a component's parameters, so that I can get access to information about the model during run-time. I do this by adding a parameter model = Parameter{Model}() and setting it when I create the component.

This works fine, but when I explore the model, I see screens like this:

image

As you can see, the "Variables" list looks empty. It's not empty, it's just that the variables list has gotten no real estate on screen. What's happening here is that the model parameter is written out in a long form over many lines, so any component that includes a model parameter has this problem.

lrennels commented 2 months ago

Hi @jrising interesting, yes the Explorer is hard coded to write out the value if it recognizes it as a scalar, so it must be doing so for the Model type. I can go look into telling it to display nothing if it sees the type is a Model. I'm starting that in #1000 and can test out if it works, feel free to do the same!

lrennels commented 2 months ago

@jrising my solution here is to limit the types that are displayed in the menu to the following. I think this is a better way to organize that making Model the exception, since it will cover other unconventional types that might give us the same issues.

Note values are only displayed in the menu when there are no indexed dimensions for a Parameter or Variable, really meant to handle things like a text label or a number.

lrennels commented 2 months ago

(The description here might sound esoteric, but I think it's going to be a common code structure until some other Mimi changes come along.)

I do understand this need! Happy to talk sometime about what we could do to give more access to what you need.

jrising commented 2 months ago

Thank you! This is great and will make it much easier for me to debug my model.

lrennels commented 2 months ago

Let me know if I can improve it further for ya!