-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
best way to write a wrapper function for tree_at #784
Comments
Is there any reason you need to modify them after-the-fact? Can this all just happen at initialization? At any rate the construction you have here looks a little odd. Assuming everything is functionally pure (I sure hope so!) then code like self = eqx.tree_at(lambda m: m.unit1, self, F0)
self = eqx.tree_at(lambda m: m.unit1, self, self.unit1.run_sol() should be equivalent to self = eqx.tree_at(lambda m: m.unit1, self, F0.run_sol() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to rewrite my process flowsheet simulator in equinox. I'm able to solve individual components fine by creating my classes as follows:
However, when I want to connect components and update them sequentially I'm only doing this through repeated use of
eqx.tree_at
as follows:and this can be executed as follows:
This all executes fine, however I'm wondering if it may be possible to do this through a wrapper method like
connect(Flange1, Flange2)
that could handle the connections and also allow me to add some additional features such as graph generation using mermaid which I have in the numpy version of my framework.I know this is out of scope of equinox and a long shot, but any help would be much appreciated :)
The text was updated successfully, but these errors were encountered: