Git Product home page Git Product logo

runner's People

Contributors

perrette avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alex-robinson

runner's Issues

Working with multiple input parameter files.

I would like to use job run ... -p group1.p1=1 group2.p1=2 ... for the case where the parameter group group1 appears in one namelist file and the parameter group group2 appears in another namelist file.

Typically to modify parameters in a parameter/namelist file I use the following steps:

    # Read param file runner.json always written by runner to rundir
    rjson = os.path.join(rundir, 'runner.json')
    js    = json.load(open(rjson))

    # Load default namelist parameters
    params = nml.load(open(par_path))

    # Update default parameters with runner.json parameter values
    params.update(js['params']) 

    # Write updated parameter file to rundir
    par_path_new = os.path.join(rundir,os.path.basename(par_path))
    nml.dump(params, open(par_path_new, 'w'))

The params.update step is what takes the given set of parameters and updates it with my command line options. So the simplest method I see, to handle multiple input parameter files is to just call the above lines once per namelist file. It will find the parameter groups and parameters that exist and modify them as needed. However, I've noticed that if a parameter group like group2 does not exist in the first parameter file, then it is added as a new parameter group. This makes the above strategy unworkable, since a bunch of irrelevant parameters may be added to a parameter file needlessly.

So,
(1) Is there a better way to achieve what I want than the strategy above?
(2) Is it possible to modify ext/namelist.py so that it only writes parameters to the namelist file if it finds that they exist already? Or via an argument?

Thanks!
Alex

List folder names in ensemble summary file params.txt

Hi Mahé,

Great tool!! I am now using runner regularly for ensemble simulations. However, as we've discussed, I find myself urgently in need of an additional column in the ensemble summary file, which lists the path associated with a given set of parameter values. You already know that I think this has value in many contexts and is conceptually more complete. But I am learning that it would be especially useful when the run option -a is used, setting the folder name based on the parameter choices, which sometimes I prefer. Having this column would then let me load the folders easily in R/Python for later analysis. Could you please implement this??

Thanks!
Alex

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.