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

drop Python 2 support #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[run]
omit =
deepdish/tests/*
deepdish/six.py

[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*__init__*
deepdish/tests/*
deepdish/six.py
12 changes: 4 additions & 8 deletions deepdish/io/hdf5io.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import division, print_function, absolute_import

import numpy as np
import tables
import warnings
Expand All @@ -18,16 +16,14 @@
except ImportError:
_sns = False

from deepdish import six

IO_VERSION = 12
DEEPDISH_IO_PREFIX = 'DEEPDISH_IO'
DEEPDISH_IO_VERSION_STR = DEEPDISH_IO_PREFIX + '_VERSION'
DEEPDISH_IO_UNPACK = DEEPDISH_IO_PREFIX + '_DEEPDISH_IO_UNPACK'
DEEPDISH_IO_ROOT_IS_SNS = DEEPDISH_IO_PREFIX + '_ROOT_IS_SNS'

# Types that should be saved as pytables attribute
ATTR_TYPES = (int, float, bool, six.string_types, six.binary_type,
ATTR_TYPES = (int, float, bool, str, bytes,
np.int8, np.int16, np.int32, np.int64, np.uint8,
np.uint16, np.uint32, np.uint64, np.float16, np.float32,
np.float64, np.bool_, np.complex64, np.complex128)
Expand Down Expand Up @@ -79,7 +75,7 @@ def _dict_native_ok(d):

# All keys must be strings
for k in d:
if not isinstance(k, six.string_types):
if not isinstance(k, str):
return False

return True
Expand Down Expand Up @@ -208,7 +204,7 @@ def _save_level(handler, group, level, name=None, filters=None, idtable=None):
new_group = handler.create_group(group, name,
"dict:{}".format(len(level)))
for k, v in level.items():
if isinstance(k, six.string_types):
if isinstance(k, str):
_save_level(handler, new_group, v, name=k, filters=filters,
idtable=idtable)

Expand All @@ -218,7 +214,7 @@ def _save_level(handler, group, level, name=None, filters=None, idtable=None):
new_group = handler.create_group(
group, name, "SimpleNamespace:{}".format(len(level.__dict__)))
for k, v in level.__dict__.items():
if isinstance(k, six.string_types):
if isinstance(k, str):
_save_level(handler, new_group, v, name=k, filters=filters,
idtable=idtable)

Expand Down
7 changes: 3 additions & 4 deletions deepdish/io/ls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Look inside HDF5 files from the terminal, especially those created by deepdish.
"""
from __future__ import division, print_function, absolute_import
from .hdf5io import (DEEPDISH_IO_VERSION_STR, DEEPDISH_IO_PREFIX,
DEEPDISH_IO_UNPACK, DEEPDISH_IO_ROOT_IS_SNS,
IO_VERSION, _sns, is_pandas_dataframe)
Expand All @@ -10,7 +9,7 @@
import sys
import os
import re
from deepdish import io, six, __version__
from deepdish import io, __version__

COLORS = dict(
black='30',
Expand Down Expand Up @@ -444,7 +443,7 @@ def __repr__(self):
return 'ValueNode(type={})'.format(type(self.value))

def info(self, colorize=True, final_level=False):
if isinstance(self.value, six.text_type):
if isinstance(self.value, str):
if len(self.value) > 25:
s = repr(self.value[:22] + '...')
else:
Expand All @@ -454,7 +453,7 @@ def info(self, colorize=True, final_level=False):
type_color='green',
extra='({})'.format(len(self.value)),
colorize=colorize)
elif isinstance(self.value, six.binary_type):
elif isinstance(self.value, bytes):
if len(self.value) > 25:
s = repr(self.value[:22] + b'...')
else:
Expand Down
Loading