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

Error in precipitation variability demo #900

Closed
lee1043 opened this issue Feb 21, 2023 · 3 comments · Fixed by #901
Closed

Error in precipitation variability demo #900

lee1043 opened this issue Feb 21, 2023 · 3 comments · Fixed by #901
Assignees
Labels
Milestone

Comments

@lee1043
Copy link
Contributor

lee1043 commented Feb 21, 2023

In the Demo's cell [5], I am getting the following error.

Traceback (most recent call last):
  File "/Users/lee1043/mambaforge/envs/pmp_devel_20230218/bin/variability_across_timescales_PS_driver.py", line 4, in <module>
    __import__('pkg_resources').run_script('pcmdi-metrics==2.5.1', 'variability_across_timescales_PS_driver.py')
  File "/Users/lee1043/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/pkg_resources/__init__.py", line 672, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/lee1043/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1479, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/lee1043/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/pcmdi_metrics-2.5.1-py3.9.egg/EGG-INFO/scripts/variability_across_timescales_PS_driver.py", line 54, in <module>
IndexError: list index out of range

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
Cell In[5], line 1
----> 1 get_ipython().run_cell_magic('bash', '', 'variability_across_timescales_PS_driver.py -p basic_precip_variability_param.py\n')

File ~/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/IPython/core/interactiveshell.py:2430, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
   2428 with self.builtin_trap:
   2429     args = (magic_arg_s, cell)
-> 2430     result = fn(*args, **kwargs)
   2432 # The code below prevents the output from being displayed
   2433 # when using magics with decodator @output_can_be_silenced
   2434 # when the last Python token in the expression is a ';'.
   2435 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/IPython/core/magics/script.py:153, in ScriptMagics._make_script_magic.<locals>.named_script_magic(line, cell)
    151 else:
    152     line = script
--> 153 return self.shebang(line, cell)

File ~/mambaforge/envs/pmp_devel_20230218/lib/python3.9/site-packages/IPython/core/magics/script.py:305, in ScriptMagics.shebang(self, line, cell)
    300 if args.raise_error and p.returncode != 0:
    301     # If we get here and p.returncode is still None, we must have
    302     # killed it but not yet seen its return code. We don't wait for it,
    303     # in case it's stuck in uninterruptible sleep. -9 = SIGKILL
    304     rc = p.returncode or -9
--> 305     raise CalledProcessError(rc, cell)

CalledProcessError: Command 'b'variability_across_timescales_PS_driver.py -p basic_precip_variability_param.py\n'' returned non-zero exit status 1.
@lee1043
Copy link
Contributor Author

lee1043 commented Feb 22, 2023

@msahn guesses that is because of xcdat code trying to load xml demo input.

This xcdat_open function might be helpful.

@lee1043 lee1043 added the bug label Feb 22, 2023
@lee1043 lee1043 added this to the 3.0 milestone Feb 22, 2023
@lee1043 lee1043 linked a pull request Feb 23, 2023 that will close this issue
@msahn
Copy link
Collaborator

msahn commented Feb 23, 2023

I have removed the part for creating and reading xml file and modified it to read nc files directly. I think it is good to make the demo simple because reading xml file is not necessary here.

Pull request

@lee1043
Copy link
Contributor Author

lee1043 commented Feb 23, 2023

@msahn thank you for the update! I will merge your PR once I complete reviewing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants