Skip to content

Commit

Permalink
Use fiona.odict.OrderedDict instead of collections
Browse files Browse the repository at this point in the history
OrderedDict was introduced in Python 2.7. Fiona uses the
ordereddict module for versions < 2.7. Use fiona.odict rather
than duplicating its effort
  • Loading branch information
jwass committed Dec 2, 2014
1 parent ec53ec7 commit 98d7ad5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions geopandas/io/file.py
@@ -1,7 +1,7 @@
import collections
import os

import fiona
from fiona.odict import OrderedDict
import numpy as np
from shapely.geometry import mapping

Expand Down Expand Up @@ -81,7 +81,7 @@ def convert_type(in_type):
out_type = 'int'
return out_type

properties = collections.OrderedDict([
properties = OrderedDict([
(col, convert_type(_type)) for col, _type in
zip(df.columns, df.dtypes) if col != 'geometry'
])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_geodataframe.py
@@ -1,6 +1,5 @@
from __future__ import absolute_import

import collections
import json
import os
import tempfile
Expand All @@ -12,6 +11,7 @@
from shapely.geometry import Point, Polygon

import fiona
from fiona.odict import OrderedDict
from geopandas import GeoDataFrame, read_file, GeoSeries
from .util import unittest, download_nybb, assert_geoseries_equal, connect, \
create_db, validate_boro_df, PANDAS_NEW_SQL_API
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_to_file_schema(self):
"""
tempfilename = os.path.join(self.tempdir, 'test.shp')
properties = collections.OrderedDict([
properties = OrderedDict([
('Shape_Leng', 'float:19.11'),
('BoroName', 'str:40'),
('BoroCode', 'int:10'),
Expand Down

0 comments on commit 98d7ad5

Please sign in to comment.