-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Decouple names from system construction #48
Comments
I can certainly take a look. An option is to explicitly map the initial and final subtypes (e.g. But I think there is a bigger issue than naming and is the fact that certain DSL will also require to create their own types that eventually lower into a |
The issue there is that it will never be inferrable, so we'd want to avoid types as otherwise things could slow to a crawl because every piece of code becomes dynamic. As we have it, most things are non-dynamic except for Expression vectors. This is a lot like Julia's AST which uses symbols for things like functions in order to avoid overtyping. But,
That shouldn't lose any information if we just allow information by composition. If we just allow a boxed composition pointer, then most of the generic routines can safely ignore that without an issue.
I don't think we need to explicitly map since making the names flexible will have other advantages anyways. |
Generic composition is now allowed via the |
(1) is complete. |
I want the names that a system assumes to be decoupled from the actual usage of the system itself. The reason is because the importance of this package is really to be an intermediate of model transformations that DSLs can plug into. We are already starting to build many different DSLs which utilize this intermediate, and one thing I've noticed is that we don't want to be constrained in subtype naming due to the systems that we want to target. For example, we want to have some biological model (like @AleMorales 's) and name things
Reactants
and stuff like that, but when we build the ODE we want to just say "these variables are the dependent variables, these are the independent variables, etc." and have it run to generate ODEs from there, as opposed to requiringDependentVariable
,IndependentVariable
, etc. (these won't go away, but will just be the defaults).Most of the change was pretty simple. 2132199 did most. However, there are two problems to fix up:
extract_derivatives
handle aliasing. For example, right here is a hack that allows both:Variable
and:DependentVariable
to be used in the nonlinear system ( https://github.com/JuliaDiffEq/SciCompDSL.jl/blob/master/src/systems/nonlinear/nonlinear_system.jl#L8-L13 ), but we should make this more general and allowextract_elements
to take in a vector of symbols and extract both subtypes into that form.extract_elements
should also have a place of putting "all other names", i.e. not giving them special treatment. For example, in the DiffEqSystem we want:Variable
to be used for just some intermediate calculations, but in reality it's just anything that's not an independent or dependent variable that should be treated like that.If we have this, then I think that we can build DSLs with its own naming systems and all of that, but still pull from the same transformation, Jacobian building, and compilation system, which is the ultimate goal.
@YingboMa can you look at (1)? @AleMorales can you take a look at (2)?
The text was updated successfully, but these errors were encountered: