Skip to content

Flopy error while exporting shapefile #1000

@jjkennedy

Description

@jjkennedy

I'm using Python 3.7.9 installed with Anaconda and running script within a Jupyter notebook to post process groundwater model data. The groundwater model is ran using Modflow 6, with ModPath 7 also being used.
The following versions of packages are also being used:
flopy 3.3.1
numpy version: 1.19.1
matplotlib version: 3.3.1
rasterio version: 1.1.0

Using "flopy.export.utils.export_array_contours()" I continually get an error stating the following:
TypeError: init() got multiple values for argument 'shapeType'

I also get the same error when attempting to create a shapefile from Modpath 7 pathlines using "p.write_shapefile()"

The troubling aspect is that I'm using script from a co-worker which works for him on his computer. I've also sent the script to another co-worker (who is a contributor to the FloPy developement team) and the script works for him as well on his computer.

Since no one else I know can seem to replicate the error message, I have not attached all the necessary files and code and I'm wondering if anyone here has any experience as to why only my computer would throw this error? Any help/suggestions would be greatly appreciated as I dont know where else to go to try and solve the problem.

Full error message below:


TypeError Traceback (most recent call last)
in
1 flopy.export.utils.export_array_contours(grid, 'heads1_lowlands.shp', hds[0], fieldname='level',
2 levels = list(range(3900, 4200, 10)),
----> 3 prj = "..\GIS_layers\Harney_Basin_lowlands.prj")
4
5

C:\ProgramData\Anaconda3\lib\site-packages\flopy\export\utils.py in export_array_contours(modelgrid, filename, a, fieldname, interval, levels, maxlevels, epsg, prj, **kwargs)
1613 ax = plt.subplots()[-1]
1614 ctr = contour_array(modelgrid, ax, a, levels=levels)
-> 1615 export_contours(modelgrid, filename, ctr, fieldname, epsg, prj, **kwargs)
1616 plt.close()
1617

C:\ProgramData\Anaconda3\lib\site-packages\flopy\export\utils.py in export_contours(modelgrid, filename, contours, fieldname, epsg, prj, **kwargs)
1465 dtype=[(fieldname, float)]).view(np.recarray)
1466
-> 1467 recarray2shp(ra, geoms, filename, epsg=epsg, prj=prj, **kwargs)
1468 return
1469

C:\ProgramData\Anaconda3\lib\site-packages\flopy\export\shapefile_utils.py in recarray2shp(recarray, geoms, shpname, mg, epsg, prj, **kwargs)
499 # set up for pyshp 2
500 shapefile = import_shapefile()
--> 501 w = shapefile.Writer(shpname, shapeType=geomtype)
502 w.autoBalance = 1
503

TypeError: init() got multiple values for argument 'shapeType'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions