Uploaded image for project: 'Pegasus'
  1. Pegasus
  2. PM-1819 5.0.3 Python API Improvements
  3. PM-1822

improve parsing of value in Mixins._to_mb(value)

XMLWordPrintable

      To avoid errors like the following, Mixins._to_mb should use a better regex to parse value in _to_mb(value). Example: (\d+) *([MGTPE]?B)

      Traceback (most recent call last):
      File "/project/xwang787_675/software/pegasus/default/lib64/python3.6/site-packages/Pegasus/api/mixins.py", line 204, in to_mb
      return int(tokens[0])
      ValueError: invalid literal for int() with base 10: '4GB'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "/project/xwang787_675/workflow/YifanLab/src/pacbio/_main_.py", line 37, in pacbio
      generate(sub_bam, ref_genome, base_path, site)
      File "/project/xwang787_675/workflow/YifanLab/src/pacbio/_workflow.py", line 27, in generate
      wf = _generate(sub_bam, ref_genome, base_path, site)
      File "/project/xwang787_675/workflow/YifanLab/src/pacbio/_workflow.py", line 125, in _generate
      wf.add_transformation_catalog(_generate_tc(base_path, site))
      File "/project/xwang787_675/workflow/YifanLab/src/pacbio/_workflow.py", line 197, in _generate_tc
      ).add_condor_profile(request_memory="4GB")
      File "/project/xwang787_675/software/pegasus/default/lib64/python3.6/site-packages/Pegasus/api/mixins.py", line 179, in wrapped_f
      new_kw[nk] = vf(v)
      File "/project/xwang787_675/software/pegasus/default/lib64/python3.6/site-packages/Pegasus/api/mixins.py", line 221, in to_mb
      value
      ValueError: value: 4GB should be a str formatted as '<int> [MB | GB | TB | PB | EB]'

            Assignee:
            mayani Rajiv Mayani
            Reporter:
            tanaka Ryan Tanaka (Inactive)
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: