Skip to content
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

Possibility to set AS variables as lowercase/uppercase #13

Open
LuiggiTenorioK opened this issue Jul 19, 2024 · 4 comments
Open

Possibility to set AS variables as lowercase/uppercase #13

LuiggiTenorioK opened this issue Jul 19, 2024 · 4 comments

Comments

@LuiggiTenorioK
Copy link
Member

In GitLab by @ainagaya on Jul 19, 2024, 12:34

Hi!!

I think that it would be useful to be able to change the variables to uppercase/lowercase. For example,

SECTION:
  VARIABLE: "Watermelon"

But then, when using the variable, if in the template/other config file when it is used:

BASH_VARIABLE1=%SECTION.VARIABLE^^%
BASH_VARIABLE2=%SECTION.VARIABLE,,%

That would translate in BASH_VARIABLE1=WATERMELON, BASH_VARIABLE2=watermelon. In the templates, we can do this in bash, its true. But my usecase is more in the configuration files, for example, the bootstrap. Here we are defining some paths:

DEFAULT:
  CUSTOM_CONFIG:
    PRE:
      # Basic configuration: platforms, jobs and defaults
      - "%PROJDIR%/conf/platforms.yml"
      - "%PROJDIR%/conf/jobs_%RUN.WORKFLOW%.yml" 
      - "%PROJDIR%/conf/defaults_%RUN.WORKFLOW%.yml"

.To avoid user errors, it would be amazing to have

DEFAULT:
  CUSTOM_CONFIG:
    PRE:
      # Basic configuration: platforms, jobs and defaults
      - "%PROJDIR%/conf/platforms.yml"
      - "%PROJDIR%/conf/jobs_%RUN.WORKFLOW,,%.yml" 
      - "%PROJDIR%/conf/defaults_%RUN.WORKFLOW,,%.yml"

In that way, this would work with RUN.WORKFLOW: MODEL, Model, MoDeL, or model. Right now, if the word is not capitalized correctly, the file is not found. It also happens a lot with "true", "True" values, and others.

@LuiggiTenorioK
Copy link
Member Author

In GitLab by @ainagaya on Jul 19, 2024, 12:35

Tagging @dbeltrankyl @kinow @LuiggiTenorioK and also @franra9 @Lerriola :)

@LuiggiTenorioK
Copy link
Member Author

In GitLab by @dbeltrankyl on Jul 19, 2024, 13:02

Hello @ainagaya .

Thanks for the suggestion!, for me it would be a good addition,

We should take care of the following:

  • Perhaps the ^^ and ,, syntax is a bit strange for people not used to bash; I'm not sure if there could be another char or syntax more similar to YAML?. If not, I'm okay with that.
    • I searched a bit, and there doesn't seem to be a native YAML function (or type ) that does this.
  • ^ char that is already used ex: %^variable_to_load_last%. So it may confuse users. ( In the code, it is doable to use ^^ at the end; it is just a matter of changing the regex. )
  • Match %hola,,% == %hola% and %hola% == %Hola^^%, etc for the variable override procedure

@LuiggiTenorioK
Copy link
Member Author

In GitLab by @ainagaya on Jul 22, 2024, 10:13

mentioned in merge request digital-twins/de_340-2/workflow!365

@LuiggiTenorioK
Copy link
Member Author

In GitLab by @ainagaya on Sep 3, 2024, 09:29

mentioned in merge request digital-twins/de_340-2/workflow!294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant