-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow user-defined runtime workflow #52
Comments
A intermediate option between the current, fixed workflow and the flexible workflow defined above would be to keep fixed @xs.process
class Diffusion(object):
@xs.run_step(level=0, args='clock,clock_diff')
def run_one_step_first(self, t, dt):
# use t or dt
@xs.run_step(level=1, args=None)
def then_run_another_step(self):
# ... |
For my usage of xarray-simlab in the current version of the Phydra package, with GEKKO as a backend solver, this issue is quite relevant as referenced in the issue on the Phydra repo automatically linked above. Specifically the model processes would be much easier to implement if there were different levels of the |
Note that the suggestions in the comments above are still very elusive. I'm not sure at all if it is a good idea. At least it deserves carefull thinking to make the right design decisions. I'd like to avoid adding too much complexity and confusion. I haven't looked in detail at your use case, but I wonder if you couldn't solve it by re-arranging your process classes, maybe by adding some aggregation classes (i.e., using |
Thank you for the feedback! I am not sure if #62 could solve my issues and commented over there for clarification. To extend on your previous ideas and hopefully specify my use case: It would be useful if there was an interface to xarray-simlab that by default provides the standard runtime stages (i.e. I describe my current (incomplete) solution in more detail over on the phydra repo issue. I am using the construct of |
NOTE: these are preliminary notes.
For some cases like time-independent simulations or runge-kutta time stepping schemes, the runtime workflow that is currently defined in the framework, i.e.,
initialize+master_clock*(run_step+finalize_step)+finalize
may not be the most appropriate. More flexibility would be nice.Any runtime workflow may actually be defined in a very abstract manner, i.e., as multiple passes through the whole DAG of processes in a model, each pass executing a specific method implemented in each process class (or doing nothing if the process don't implement that method). The implementation of this abstract concept shouldn't be too challenging.
Regarding the API, we might simply use a "signature" string like the one above to define a particular workflow. The most simple workflow would have the signature
run
, which consist of one pass through the DAG executing therun
method of each process (topologically sorted). What is more challenging is when the "signature" contains other information than method names (likemaster_clock
above).The right place to define such signature is probably either as an argument of
xs.Model
or when setting a simulation driver.The text was updated successfully, but these errors were encountered: