Skip to content

Add indent to unit attr check block

Ethan Nelson requested to merge (removed):fix-attr-block into master

It looks like in 6da82ab0 the code block re-added to yori/run_yori.py was under-indented one level. This can lead to an error:

$ yori-grid sample_test_config.yml SAMPLE_INPUT_VNPCLDPROP.A2014033.0000.2017205215553.nc test
Traceback (most recent call last):
  File "/mnt/software/support/yori/1.3.9/bin/yori-grid", line 10, in <module>
    sys.exit(main())
  File "/mnt/software/support/yori/1.3.9/lib/python3.6/site-packages/yori/tools/grid.py", line 27, in main
    compression=args.compression)
  File "/mnt/software/support/yori/1.3.9/lib/python3.6/site-packages/yori/run_yori.py", line 186, in callYori
    Yori.runYori(debug, compression)
  File "/mnt/software/support/yori/1.3.9/lib/python3.6/site-packages/yori/run_yori.py", line 174, in runYori
    self.grid_size, self.ymlSet, self.fv, edges=myGrid.edges)
  File "/mnt/software/support/yori/1.3.9/lib/python3.6/site-packages/yori/run_yori.py", line 214, in write_output
    if (attr['name'] == 'units'):
UnboundLocalError: local variable 'attr' referenced before assignment

using the config file:

grid_settings:
  gridsize: 1
  projection: conformal
  lat_in: latitude 
  lon_in: longitude
  lat_out: latitude
  lon_out: longitude
  fill_value: -9999

variable_settings:
  - name_in: Cloud_Effective_Radius
    name_out: EFFR_water
    masks:
    - Cloud_Mask_Water
    - CER_Mask

Merge request reports