Menu

#2802 Report script settings

nextrelease
open-fixed
nobody
None
5
2026-04-22
2026-02-25
No

I need to make sure the scripting variable "params" has all the variables, even the defaults, when running from the command line so that they can easily be reported. Kristoff is interested in this. For example:

java -jar local/autoplot/opt/autoplot-dev/autoplot.devel.jar --headless --testPngFilename=foo.png --script='https://github.com/autoplot/dev/blob/master/rfe/sf/866/multiParamGraphic.jy' ncenter=5 ann=""

Interestingly ann="" doesn't seem to work, so I should check on that too.

Here's Jython code to print all the parameters, once this is done:

for p in params:
    print '%s=%s' % ( p, params[p] )

Discussion

  • Jeremy Faden

    Jeremy Faden - 2026-02-26

    I found that the command line path where we just read the script and go doesn't have all the defaults. I experimented with reading in the script first and getting all the parameters, which can be done in less than 50ms, which seems acceptible to me.

    Alternatively, we could set the default values in params to as each getParam call is made, but this would require an update to the initialization script, which is a little difficult.

     
  • Jeremy Faden

    Jeremy Faden - 2026-02-26

    Don't print warning "parameter value was null" message because PWD is set to None, this is expected.

     
  • Jeremy Faden

    Jeremy Faden - 2026-03-06

    Also, there's a format argument to the constraints, which should reformat the timerange, for example. This should be reflected in the parameters.

     
  • Jeremy Faden

    Jeremy Faden - 2026-03-06

    Running the script from the script editor doesn't load the defaults.

     
  • Jeremy Faden

    Jeremy Faden - 2026-03-07

    This is fixed. Note .jyds scripts may not show preferences. Also rfe 360 has a new "getParam" routine which needs to be implemented. This will involve pushing new Jython codes out and is a pain.

     
  • Jeremy Faden

    Jeremy Faden - 2026-03-19

    It looks like I was dropping the PWD and dom values, so scripts like this:

    resourceURI= getParam( 'resourceURI', PWD+'dust2025-01-28T22:35:12.420densZ.txt', 'example file to load' )
    

    were suddenly failing when run in the script editor.

    This is fixed.

     
  • Jeremy Faden

    Jeremy Faden - 2026-04-03

    Darrelle was affected by this new feature. She had a script where two parameters had the same name by mistake. The script would run in old Autoplots fine, but in the new Autoplot both variables would have the last default value. This demos:

    setScriptDescription('''Darrelle found a bug where she had two parameters with the
    same name (timerange).  Old Autoplots allowed this, obscuring the bug.''')
    
    week= getParam('timerange','2026-04-03/P7D')
    outer= getParam('timerange','2026-01-01/now')
    
    print week
    print outer
    

    This points out a bug where this wasn't caught by old Autoplots, since there are some modes where this wouldn't work. I now detect this condition in getGetParams.

     
  • Jeremy Faden

    Jeremy Faden - 2026-04-03

    This is allowed:

    setScriptDescription('''Darrelle found a bug where she had two parameters with the
    same name (timerange).  Old Autoplots allowed this, obscuring the bug.''')
    
    branch= getParam('branch',1,'Which branch',[1,2])
    
    if branch==1:
        week= getParam('week','2026-04-03/P7D')
        outer= getParam('outer','2026-01-01/now')
    else:
        week= getParam('week','2026-04-03/P7D')
        outer= getParam('outer','2025-01-01/2026-01-01')
    
    print week
    print outer
    
     
  • Jeremy Faden

    Jeremy Faden - 2026-04-22
    • status: open --> open-fixed
     
  • Jeremy Faden

    Jeremy Faden - 2026-04-22

    This is done.

     
MongoDB Logo MongoDB