Skip to content

Commit

Permalink
ensure AnnData.add is always a dict
Browse files Browse the repository at this point in the history
as expected by code elsewhere
  • Loading branch information
flying-sheep authored May 1, 2017
1 parent 2d10bdd commit 5c935ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scanpy/classes/ann_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def __init__(self, data, smp=None, var=None, add=None, dtype='float32', single_c
self.var = BoundStructArray(var, VAR_INDEX, (self, 'var'), self.n_vars, var_keys_multicol)
self._check_dimensions()

self.add = add
self.add = add or {}

def __contains__(self, k):
raise AttributeError("AnnData has no attribute __contains__, don't check `in adata`.")
Expand Down

0 comments on commit 5c935ad

Please sign in to comment.