Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grandulate causes issues with import statements in the py file #49

Open
zshaheen opened this issue Dec 13, 2018 · 0 comments
Open

Grandulate causes issues with import statements in the py file #49

zshaheen opened this issue Dec 13, 2018 · 0 comments

Comments

@zshaheen
Copy link
Contributor

When you have an input Python file with an import statement, the granulate feature doesn't work. The error is TypeError: can't pickle NotImplementedType objects caused when a Parameters object is copied with copy.deepcopy(params). The full error is below.

My guess is that objects of ModuleType aren't pickable. Maybe remove them from the object before CDPParser.granulate() is called?

(acme_diags_env_dev) shaheen2@shaheen2ml:~/github/acme_diags/tests/system$ e3sm_diags -p all_sets.py -d all_sets.cfg 
Traceback (most recent call last):
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/bin/e3sm_diags", line 11, in <module>
    load_entry_point('e3sm-diags==1.6.0', 'console_scripts', 'e3sm_diags')()
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/site-packages/e3sm_diags-1.6.0-py2.7.egg/acme_diags/acme_diags_driver.py", line 200, in main
    parameters = get_parameters(parser)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/site-packages/e3sm_diags-1.6.0-py2.7.egg/acme_diags/acme_diags_driver.py", line 167, in get_parameters
    parameters = parser.get_parameters(cmd_default_vars=False, argparse_vals_only=False)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/site-packages/cdp-1.4.1-py2.7.egg/cdp/cdp_parser.py", line 481, in get_parameters
    final_parameters = self.granulate(final_parameters)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/site-packages/cdp-1.4.1-py2.7.egg/cdp/cdp_parser.py", line 406, in granulate
    p = copy.deepcopy(param)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Users/shaheen2/anaconda2/envs/acme_diags_env_dev/lib/python2.7/copy.py", line 182, in deepcopy
    rv = reductor(2)
TypeError: can't pickle NotImplementedType objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant