Giter VIP home page Giter VIP logo

Comments (4)

zshaheen avatar zshaheen commented on August 12, 2024 1

Yup, that's what #36 is about.

from e3sm_diags.

sterlingbaldwin avatar sterlingbaldwin commented on August 12, 2024

This isnt that important to me actually, I have no problem generating the parameters file. That said, however you're doing argument parsing should be updated to no crash when you dont give it the arguments its expecting. Right now if you just call acme_diags_driver.py with nothing it does this:

(workflow) -bash-4.1$ acme_diags_driver.py 
Traceback (most recent call last):
  File "/export/baldwin32/anaconda2/envs/workflow/bin/acme_diags_driver.py", line 4, in <module>
    __import__('pkg_resources').run_script('acme-diags==0.1', 'acme_diags_driver.py')
  File "/export/baldwin32/anaconda2/envs/workflow/lib/python2.7/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/export/baldwin32/anaconda2/envs/workflow/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1494, in run_script
    exec(code, namespace, namespace)
  File "/export/baldwin32/anaconda2/envs/workflow/lib/python2.7/site-packages/acme_diags-0.1-py2.7.egg-info/scripts/acme_diags_driver.py", line 48, in <module>
    original_parameter = parser.get_parameter(default_vars=False)
  File "/export/baldwin32/anaconda2/envs/workflow/lib/python2.7/site-packages/cdp/cdp_parser.py", line 37, in get_parameter
    self._parameter.check_values()
  File "/export/baldwin32/anaconda2/envs/workflow/lib/python2.7/site-packages/acme_diags/acme_parameter.py", line 58, in check_values
    if self.reference_data_path == '':
AttributeError: 'ACMEParameter' object has no attribute 'reference_data_path'

Im not sure what the cdp.parser uses under the hood, but argparse has a nice parser.print_help() method that I use like this:

if not args.config:
    parser.print_help()
    sys.exit()

from e3sm_diags.

sterlingbaldwin avatar sterlingbaldwin commented on August 12, 2024

Ah cool, didnt see it there.

from e3sm_diags.

zshaheen avatar zshaheen commented on August 12, 2024

Done in fbf8370

from e3sm_diags.

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.