mapbox / mapbox/make-surface

ValueError: too many values to unpack (expected 2)

Open
#69 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
91
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Am i doing something wrong?

$ makesurface vectorize gfs.t00z.pgrb2.0p25.f000 p.shp -g
Traceback (most recent call last):
File "/usr/local/bin/makesurface", line 9, in
load_entry_point('makesurface==0.0.8dev', 'console_scripts', 'makesurface')()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 610, in call
return self.main(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 590, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 782, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 416, in invoke
return callback(_args, **kwargs)
File "/disk/src/make-surface/makesurface/scripts/cli.py", line 57, in vectorize
makesurface.vectorize(infile, outfile, classes, classfile, weight, nodata, smoothing, band, carto, globewrap, axonometrize, nosimple, setnodata, nibble, rapfix)
File "/disk/src/make-surface/makesurface/init.py", line 4, in vectorize
vectorize_raster.vectorizeRaster(infile, outfile, classes, classfile, weight, nodata, smoothing, band, cartoCSS, globeWrap, axonometrize, nosimple, setNoData, nibbleMask, rapFix)
File "/disk/src/make-surface/makesurface/scripts/vectorize_raster.py", line 84, in vectorizeRaster
band = filter(lambda i: src.tags(i)['GRIB_ELEMENT'] == band, src.indexes)
File "/disk/src/make-surface/makesurface/scripts/vectorize_raster.py", line 84, in
band = filter(lambda i: src.tags(i)['GRIB_ELEMENT'] == band, src.indexes)
File "rasterio/_base.pyx", line 501, in rasterio._base.DatasetReader.tags (rasterio/_base.c:8978)
ValueError: too many values to unpack (expected 2)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the command shown in the issue, then inspect makesurface/scripts/vectorize_raster.py at line 84 and the rasterio DatasetReader.tags call in the traceback. Done means the vectorize command no longer raises this ValueError for the reported input and produces the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.