-
Notifications
You must be signed in to change notification settings - Fork 7
Allow for model-differentiated tasks #626
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
base: develop
Are you sure you want to change the base?
Conversation
|
Hmm, I started writing my tasks with different names (e.g., RunCoupledGeosExecutable) but I'm not sure about how to group them yet, I'm open to discussion. Ultimately, some tasks might be more application specific rather than model specific (GEOS-FP, MERRA3, or GEOS-IT would all use |
|
We briefly touched on this today but this PR seems to be a good first step in the right direction. I began doing this in an inelegant way in my convoluted PR #643 I guess I see two potential issues here:
I'm open to further discussion @rtodling or Skylab insight @jeromebarre @mer-a-o |
|
Since this was brought up again in #677, I've updated this and added messages to the task factory method. Hopefully this will help make it clear which task module is being used, but as noted before this does have the potential to be confusing to newer users |
|
Revisiting my comment above:
task_class = getattr(importlib.import_module(f'swell.tasks.{model}.{task_lower}-{model}'), task)
factory_logger.info(f'Using model-specific version of {task} in <swell.tasks.{model}.{task_lower}-{model}>')So tasks can have different names with
|
Yeah it's a lot to keep track of. If application-specific tasks would provide more utility, it may just be better to ditch the model-specific idea entirely and just have differently named tasks and bake more logic into flow.cylc that selects the appropriate task. If |
Let's stick with your changes for now and keep things simple. It is a good step towards model specific tasks and we can just expect different applications to name particular tasks under the model folder. |
|
I changed the file naming as suggested above so they follow |
Description
Simple pr that would allow for tasks to be differentiated by model. Inspired by #625 and recent discussions about decoupling some of the structure that might be burdened by trying to support both models at the same time.
When running
swell task <task_name> -m <model_component> config, Swell will try to import<task_name>fromsrc/swell/tasks/<model>. If it can't find it, it will just try to find one undersrc/swell/tasks/. This means that any tasks that would benefit from having a separate model-specific version can do so, and any tasks that don't can continue to use the general version.I haven't added any of these tasks yet, but they just need to be put under
src/swell/tasks/<model>(for example)