-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaults
returns internal stuff
#3408
Comments
What is internal here? |
Sorry, you mean what is the internal fields od |
If you mean the julia> ModelingToolkit.get_defaults(osys)
Dict{Any, Any} with 1 entry:
Initial(X(t)) => 0 I.e. |
|
I am not really sure, but werenät the And if not, shouldn't it have been marked, or at least mentioned, as a breaking change? |
They are very much a part of the model.
This was done because
Why? We never maintain that |
Sorry, it just seemed non-intuitive to me that
and there is not really anything suggestion that these act in a fundamentally different way. Even with |
Let's take a step back. What are you trying to do where giving you all of the parameters is not the right thing to do? Let's find a use case and come up with a solution. |
And let's just stop the argument about "breaking" here. You obviously understand that it's an ill-defined question and not being asked in good faith. It's documented as giving "all parameters", "all defaults". The definition is just not precise enough for this case, we all understand that. You could argue there was a bug before because the initial conditions have always implicitly been parameters of the system (they are mathematically equivalent to parameters) and so omitting them was a bug. You could argue that it's breaking because they weren't there before. The fact of the matter is, Initial(x) is a parameter, and so it's a case that fell through the cracks of the previous definitions. We all understand this, and we can at least all agree that the previous definitions in the docs were not sufficiently precise enough to say whether or not this information should be included or not. So, if we are going to move forward, let's discuss:
|
When creating a model, users are able to define and add various stuffs to them. That includes e.g. events, observables, and default values. I think it would be useful for a user to be able to extract these defaults from a system (e.g. those not related to initialization). |
What are you trying to extract and why would you want to have the subset that does not include the initialization variables/parameters? |
My personal application was a case in which I had various models. In each there are some (intermediary) species which I know start at |
Can you share some code? I'm having trouble parsing what you're doing there. |
I have a code base where I run simulations for different models. I have changed my code now. If you guy wants/don't want to reimplement the old defaults function that is fine. I just raised this because I thought I found a bug (as mentioned, from the docs it is not very clear they treat initial conditions differently), and then pointed out that there might be code depending on the defaults function's previous behaviour. |
After the latest update,
defaults
is broken:The text was updated successfully, but these errors were encountered: