geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
164 stars 154 forks source link

Inconsistent indentation in geoschem_config.yml #1516

Closed barronh closed 1 year ago

barronh commented 1 year ago

What institution are you from?

US EPA

Description of the problem

Not a problem for GEOS-Chem (that I am aware of). Just an inconsistency in with the geoschem_config.yml yaml format that effect yaml processing by other software.

The yml currently has inconsistent spacing. I feel silly making an "issue" and didn't mean to label it "bug". I thought maybe it happens to other people too and it won't take any time to fix for everyone.

I was trying to use the yml to identify the transport tracer order, and I noticed this minor thing.

import yaml
cfg = yaml.load(open('geoschem_config.yml'))
trcs = cfg['operations']['transport']['transported_species']
for spc in ['NO2', 'CH2O', 'SO2', 'CO', 'O3']:
    print(spc, trcs.index(spc))

Error:

...
yaml.parser.ParserError: while parsing a block mapping
  in "geoschem_config.yml", line 373, column 3
expected <block end>, but found '<block mapping start>'
  in "geoschem_config.yml", line 403, column 5

Description of troubleshooting performed

The output_menu and schedule_output_for_??? elements should be indented 4 spaces, but are currently 5.

On a minor but related note, is HOCH2SO3- in the species database meant to be a utf-8 hyphen (\xe2\x88\x92) instead of a simple ascii dash? This is not a problem for yaml. It's just the only utf-8 character in the file.

GEOS-Chem version

14.0.1

Description of modifications

N/A

Log files

N/A

Software versions

yantosca commented 1 year ago

Thanks for writing @barronh, The spacing has been corrected in PR #1505, which is going into the 14.0.2 patch version. (Also, eventually the bpch diagnostics will go away entirely, once the TOMAS updates come into 14.1.0.).

The UTF - might have come in with a cut-and-paste operation. If it's an issue then let us know.

barronh commented 1 year ago

I should have known you were already on it! I had searched issues, but didn't see #1505 some how... sorry.

wrt UTF, I don't care one way or the other. I just noticed it. I agree that it was probably a cut-and-paste, so I would lean toward removing it to avoid needless pain in ascii-only application. But like I said, I just noticed...