Skip to content

Developer Guide

Emma Hogan edited this page Feb 5, 2024 · 33 revisions

Overview

Coding requirements

  • All files must start with the following two comments, where <year> is either <year_of_first_publication> or <year_of_first_publication>-<year_of_last_modification>:
    # (C) Crown Copyright <year>, Met Office.
    # Please see LICENSE.md for license details.
    
  • Use f-strings

Cylc best practice

Rose requirements

  • When using Rose's File Creation Mode, do not use braces around any environmental variables used. For example, use [file:$MY_ENV_VAR] rather than [file:${MY_ENV_VAR}], see issue #201 for more details.
  • Use the following flow diagram to determine where an environment variable should be defined:
---
title: Where should my environment variable be defined?
---
flowchart TB
    question_multiple1{"
      Is the environmental
      variable used by multiple
      tasks?
    "}
    question_multiple2{"
      Is the environmental
      variable used by multiple
      tasks?
    "}
    question_override{"
      Should it be possible to
      override the environmental
      variable, either by the user
      or for testing purposes?
    "}
    output_global_override["
      Define the environmental
      variable in the 
      'rose-suite.conf' file
    "]
    output_app_override["
      Define the environmental
      variable in the 'env' 
      section in the 
      'rose-app.conf' file
    "]
    output_global["
      Define the environmental
      variable in the
      'root:environment' section
      in the 'flow.cylc' file
    "]
    output_app["
      Define the environmental
      variable in the 
      '(taskname):environment'
      section in the 
      'flow.cylc' file
    "]
    question_override --Yes--> question_multiple1 --Yes--> output_global_override
    question_multiple1 --No--> output_app_override
    question_override --No--> question_multiple2 --Yes--> output_global
    question_multiple2 --No--> output_app
Loading

Clone this wiki locally