Giter VIP home page Giter VIP logo

Comments (4)

lizadams avatar lizadams commented on August 28, 2024

Tested latest build from Tony. The config file with two spaces after the configFile definition still causes a failure, but now VERDI gives an error message, and the plots are not created.

./verdi_batch.csh
2024.01.25 15:14:47.791 [main] ERROR anl.verdi.commandline.BatchScriptHandler - Error in BatchScriptHandler.processTasks: Task is null. Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
BatchScriptHandler: Error in BatchScriptHandler.processTasks: Task is null. Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
java.lang.NullPointerException: Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
at anl.verdi.plot.gui.FastTilePlot.configure(FastTilePlot.java:2667)
at anl.verdi.commandline.task.TilePlotTask.run(TilePlotTask.java:148)
at anl.verdi.commandline.BatchScriptHandler.processTasks(BatchScriptHandler.java:146)
at anl.verdi.commandline.BatchScriptHandler.run(BatchScriptHandler.java:125)
at anl.verdi.core.VerdiPlugin.run(VerdiPlugin.java:150)
at saf.core.runtime.CorePlugin.runApplicationRunnable(CorePlugin.java:93)
at saf.core.runtime.CorePlugin.run(CorePlugin.java:48)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at saf.core.runtime.Boot.run(Boot.java:178)
at saf.core.runtime.Boot.main(Boot.java:388)

However, it gives this error whether there are two spaces after the configFile or not.
It isn't reading the configFile, even if it points to a valid configFile.

from verdi.

lizadams avatar lizadams commented on August 28, 2024

Using the following command line script, all three versions of VERDI that I am testing work to read the provided configFile and correctly generates the tile plot using the colorMap and legendBins used in the config file.

#!/bin/csh -f

cd /Users/lizadams/Downloads/VERDI_2.1.5_01_03/
./verdi.command -configFile /Users/lizadams/downloads/nolte_test/11bin.cfg -f /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_Ref_2015 -s "PM25[1]" -f  /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_2015_2015 -s "PM25[2]" -s "PM25[2]-PM25[1]" -g tile -saveImage "png" /Users/lizadams/Downloads/nolte_test/PM25_Ref-2015_01-03gui -quit

cd /Users/lizadams/Downloads/VERDI_2.1.5_01_24/
./verdi.command -configFile /Users/lizadams/downloads/nolte_test/11bin.cfg -f /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_Ref_2015 -s "PM25[1]" -f  /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_2015_2015 -s "PM25[2]" -s "PM25[2]-PM25[1]" -g tile -saveImage "png" /Users/lizadams/Downloads/nolte_test/PM25_Ref-2015_01-24gui -quit

cd /Users/lizadams/Downloads/VERDI_2.1.5_01_30/
./verdi.command -configFile /Users/lizadams/downloads/nolte_test/11bin.cfg -f /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_Ref_2015 -s "PM25[1]" -f  /Users/lizadams/downloads/nolte_test/yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_2015_2015 -s "PM25[2]" -s "PM25[2]-PM25[1]" -g tile -saveImage "png" /Users/lizadams/Downloads/nolte_test/PM25_Ref-2015_01-30gui -quit

Using the same config file using batch command line, fails for all except for the 01-03 build. Tony tried to fix the issue of spaces causing VERDI not to read and use the configFile for the 01-24 and 01-30 builds, but this fix does not work. An error is created for all of the versions except for the 01-03 build, but that build just ignores the configFile if there are blank spaces after the definition of the configFile. The configFile used for this test does not have any blank spaces, so VERDI should be able to read it, and produce plots that match the above CLI option.

#!/bin/csh -f

/Users/lizadams/downloads/VERDI_2.1.5_01_03/verdi.command -batch /Users/lizadams/Downloads/nolte_test/tileplot_png.txt
ls -lrt *.png
mv PM25_Ref-2015.png PM25_Ref-2015-01-03.png
mv PM25_OA_Ref-2015.png  PM25_OA_Ref-2015-01-03.png

/Users/lizadams/downloads/VERDI_2.1.5_01_24/verdi.command -batch /Users/lizadams/Downloads/nolte_test/tileplot_png.txt
mv PM25_Ref-2015.png Ref-2015-01-24.png
mv PM25_OA_Ref-2015.png  PM25_OA_Ref-2015-01-24.png
ls -lrt *.png

/Users/lizadams/downloads/VERDI_2.1.5_01_24/verdi.command -batch /Users/lizadams/Downloads/nolte_test/tileplot_png.txt
mv PM25_Ref-2015.png Ref-2015-01-30.png
mv PM25_OA_Ref-2015.png  PM25_OA_Ref-2015-01-30.png
ls -lrt *.png

Contents of tileplot_png.txt

####################################################################################
# NOTE: Batch Scripting Language                                                   
#                                                                                  
#    * All parameter/value pairs should be inside one of the two blocks --
#        <Global/> or <Task/>
#    * Number of blocks is not limited
#    * Only one <Global/> block is recommended. <Global/> blocks should
#        contains different items if use multiple <Global/> blocks
#    * Parameter values in <Task/> blocks will override those in <Global/>
#    * Currently supported parameters (keys, case insensitive):
#        configFile    -- configuration file full path
#        f             -- dataset file path/name
#        dir           -- dataset file folder
#        pattern       -- dataset file name pattern
#        gtype         -- plot type (tile, line, bar, vector)
#        vector        -- vector plot variables
#        vectorTile    -- vector plot variables
#        s             -- variable name
#        ts            -- time step
#        titleString   -- plot title
#        subdomain     -- xmin ymin xmax ymax
#        subTitle1     -- plot subtitle one
#        subTitle2     -- plot subtitle two
#        saveImage     -- image file type (png, jpeg, eps, etc.)
#        imageFile     -- image file path/name
#        imageDir      -- image file folder
#        drawGridLines -- draw grid lines on the tile plot if 'yes'
#        imageWidth    -- image width
#        imageHeight   -- image height
#        unitString    -- units
#
#
####################################################################################


<Global>
  dir=/Users/lizadams/downloads/nolte_test
  configFile=/Users/lizadams/downloads/nolte_test/11bin.cfg
  f=yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_Ref_2015
  f=yearlyavg_aelmo_gmt_v54_cb6r3_ae7_aq_WR413_MYR_GCAM2CMAQ_12US1_2015_2015
  #pattern=*CCTM46*
  #s=[1]
  saveImage=png
  imageDir=/Users/lizadams/downloads/nolte_test
  #subdomain=20 10 75 50
</Global>

#######################
# Data files picked   #
# up from patterns    #
# specified for names #
#######################

<Task>
  s=PM25[1]-PM25[2]
  imageFile=PM25_Ref-2015
  gtype=tile
</Task>

<Task>
  s=PM25_OA[1]-PM25_OA[2]
  imageFile=PM25_OA_Ref-2015
  gtype=tile
</Task>

Contents of the 11bin.cfg

<PlotConfig>
        <property type="java.awt.Font" key="anl.verdi.plot.config.PlotConfiguration.domain_font" value="Lucida Grande-plain-13" />
        <property type="java.awt.Color" key="anl.verdi.plot.config.PlotConfiguration.obs_legend_color" value="-16777216" />
        <property type="java.awt.Font" key="anl.verdi.plot.config.PlotConfiguration.units_tick_font" value="Lucida Grande-plain-13" />
        <property type="java.awt.Color" key="anl.verdi.plot.config.PlotConfiguration.domain_color" value="-12566464" />
        <property type="java.awt.Color" key="anl.verdi.plot.config.PlotConfiguration.range_tick_color" value="-12566464" />
        <property type="java.awt.Color" key="anl.verdi.plot.config.PlotConfiguration.footer_line_2_color" value="-16777216" />
        <ColorMap intervalType="CUSTOM" scaleType="LINEAR" paletteType="DIVERGING" min="-2.5" max="2.5">
                <Format type="java.text.DecimalFormat" pattern="#0.00" />
                <Scale description="Color Scale">
                        <Step>-2.50</Step>
                  <Step>-2.00</Step>
                  <Step>-1.50</Step>
                  <Step>-0.50</Step>
                  <Step>-0.01</Step>
                  <Step> 0.01</Step>
                  <Step> 0.05</Step>
                  <Step> 0.50</Step>
                  <Step> 1.00</Step>
                  <Step> 1.50</Step>
                  <Step> 2.00</Step>
                  <Step> 2.50</Step>
                </Scale>
                <Palette description="Newton RGB (AVS)">
                <Color>-0010455</Color>
                <Color>-2615280</Color>
                <Color>-10218999</Color>
                <Color>-166217106</Color>
                <Color>-217239139</Color>
                <Color>-255255191</Color>
                <Color>-254224139</Color>
                <Color>-25317497</Color>
                <Color>-24410967</Color>
                <Color>-2154839</Color>
                <Color>-1650038</Color>
                </Palette>
        </ColorMap>


</PlotConfig>

Java Error message

2024.01.30 18:02:40.977 [main] ERROR anl.verdi.commandline.BatchScriptHandler - Error in BatchScriptHandler.processTasks: Task is null. Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
BatchScriptHandler: Error in BatchScriptHandler.processTasks: Task is null. Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
java.lang.NullPointerException: Cannot invoke "anl.verdi.plot.config.PlotConfiguration.getConfigFileName()" because "config" is null
	at anl.verdi.plot.gui.FastTilePlot.configure(FastTilePlot.java:2667)
	at anl.verdi.commandline.task.TilePlotTask.run(TilePlotTask.java:148)
	at anl.verdi.commandline.BatchScriptHandler.processTasks(BatchScriptHandler.java:146)
	at anl.verdi.commandline.BatchScriptHandler.run(BatchScriptHandler.java:125)
	at anl.verdi.core.VerdiPlugin.run(VerdiPlugin.java:150)
	at saf.core.runtime.CorePlugin.runApplicationRunnable(CorePlugin.java:93)
	at saf.core.runtime.CorePlugin.run(CorePlugin.java:48)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at saf.core.runtime.Boot.run(Boot.java:178)
	at saf.core.runtime.Boot.main(Boot.java:388)

from verdi.

yadongxuEPA avatar yadongxuEPA commented on August 28, 2024

Tested VERDI_2.1.5_linux64_20240130.tar.gz on Atmos, tried both running the batch script from command window and directly open the batch text file in VERDI GUI, it did not work.
Below is the error message when ran the text file directly from VERDI GUI by File >>View Script Editor >>Run :
(this error also showed up when used the text file without extra white space)
issue_335_extra_space_config_file
Below is the error message from the command window:

image

from verdi.

lizadams avatar lizadams commented on August 28, 2024

Tested latest build VERDI_2.1.5_mac_20240131.tar.gz on mac.

Confirmed that the verdi batch script is able to read the configuration file and create plots using the settings in the configuration File for the following cases.

  1. batch script configuration file is specified as follows: configFile=/Users/lizadams/downloads/nolte_test/11bin.cfg
  2. batch script configuration file is specified as above, but with two blank spaces after the name
  3. batch script configuration file specifies a config file that uses hex colors

This issue is resolved.

from verdi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.