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

seamore mis-treats Capitalised or Camel case variable names as Ruby Constants #7

Open
siligam opened this issue Jun 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@siligam
Copy link
Collaborator

siligam commented Jun 15, 2024

Capitalised variables or Camel case variables are realised as Ruby Constants and there by throwing a NameError as they are invoked with out prior initialisation. The error message looks as follows:

error: uninitialized constant #<Class:#<CMORizer::Project:0x000055d6bcccad38>>::CO2f_day (NameError)

The above error is triggered when seamore process encounters the following line in the script

cmorize CO2f_day => [fgco2_Omon]

In Ruby, variable names which are in capitals or Camel case are treated as constants and it is required to set a value to constant variable prior to using them. Here CO2f_day is treated as Ruby constant since it is starting with a capital letter C and it is invoked (or called) with out prior initialization, resulting in an Error.

Apparently, a simple fix in the script is to first setting a value to this variable before calling it as follows:

CO2f_day = "CO2f_day"
cmorize CO2f_day => [fgco2_Omon]

Question: Does the seamore tool support variable with Camel case or which are Capitalised?

P.S.:
test_cmorizer.rb does not cover this edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant