You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addressing comments in #626, this allows for tasks that exist only in certain model-specific folders to be called. If these tasks are called from a different model and don't have counterpart for that model or a generic version, it will fail. In my opinion, this is the best way to handle this, and we should handle tasks only existing for certain models by baking that logic into the scheduling in flow.cylc, i.e:
{% for model_component in model_components %}
{% if model_component == 'geos_atmosphere' %}
GenerateObservingSystemRecords-{{model_component}}
{% endif %}
{% endfor %}
Though this is somewhat complicated so I'm open to alternatives. This doesn't necessarily need #656 to work, since the scheduling is still templated in jinja there
{% for model_component in model_components %}
{% if model_component == 'geos_atmosphere' %}
GenerateObservingSystemRecords-{{model_component}}
{% endif %}
{% endfor %}
Though this is somewhat complicated so I'm open to alternatives. This doesn't necessarily need #656 to work, since the scheduling is still templated in jinja there
i guess at that point it would be
{% for model_component in model_components %}
{% if model_component == 'geos_atmosphere' %}
GenerateObservingSystemRecords-geos_atmosphere
{% endif %}
{% endfor %}
Did you start testing these model specific folders? I'm wondering how would it work in terms of listing available tasks; swell task --help if only generic, model-specific or both tasks exist?
I was able to use geos_marine specific task in my other gcm_run.j PR but I do like this solution you are proposing here rather than running and skipping tasks unnecessarily and crowding cylc workflow.
Also GPT suggested module names cannot contain hyphens (-). in regards to importlib, so use _ instead but this hasn't created a problem for me. Something to keep in mind I suppose.
Did you start testing these model specific folders? I'm wondering how would it work in terms of listing available tasks; swell task --help if only generic, model-specific or both tasks exist?
I was able to use geos_marine specific task in my other gcm_run.j PR but I do like this solution you are proposing here rather than running and skipping tasks unnecessarily and crowding cylc workflow.
It will list all tasks that are specified in an abstract sense. If you have both:
you will have TaskExample in the available tasks, same as if only one or the other exists. Yet another possible point of confusion, it'd be up to the user to make sure the proper versions for the tasks are being called in flow.cylc.
Also GPT suggested module names cannot contain hyphens (-). in regards to importlib, so use _ instead but this hasn't created a problem for me. Something to keep in mind I suppose.
I've tested this and had no problem with hyphens, but that is against PEP guidelines so I've changed it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addressing comments in #626, this allows for tasks that exist only in certain model-specific folders to be called. If these tasks are called from a different model and don't have counterpart for that model or a generic version, it will fail. In my opinion, this is the best way to handle this, and we should handle tasks only existing for certain models by baking that logic into the scheduling in flow.cylc, i.e:
Though this is somewhat complicated so I'm open to alternatives. This doesn't necessarily need #656 to work, since the scheduling is still templated in jinja there