diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcb1561..30a97c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,8 +29,3 @@ repos: rev: 23.3.0 hooks: - id: black - -- repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 - hooks: - - id: flake8 diff --git a/sharrow/digital_encoding.py b/sharrow/digital_encoding.py index 22a8b27..e260022 100644 --- a/sharrow/digital_encoding.py +++ b/sharrow/digital_encoding.py @@ -167,7 +167,7 @@ def digitize_by_dictionary(arr, bitwidth=8): bin_edges = (bins[1:] - bins[:-1]) / 2 + bins[:-1] except TypeError: # bins are not numeric - bin_map = {x: n for n, x in enumerate(bins)} + bin_map = {x:n for n,x in enumerate(bins)} u, inv = np.unique(arr.data, return_inverse=True) result.data = np.array([bin_map.get(x) for x in u])[inv].reshape(arr.shape) result.attrs["digital_encoding"] = { diff --git a/sharrow/flows.py b/sharrow/flows.py index 20636c1..e36e335 100644 --- a/sharrow/flows.py +++ b/sharrow/flows.py @@ -1741,6 +1741,9 @@ def __initialize_2( if with_root_node_name is None: with_root_node_name = self.tree.root_node_name + if with_root_node_name is None: + with_root_node_name = self.tree.root_node_name + root_dims = list( presorted( self.tree._graph.nodes[with_root_node_name]["dataset"].dims, diff --git a/sharrow/relationships.py b/sharrow/relationships.py index f3ffdc6..59ea78f 100644 --- a/sharrow/relationships.py +++ b/sharrow/relationships.py @@ -1037,7 +1037,7 @@ def drop_dims(self, dims, inplace=False, ignore_missing_dims=True): while boot_queue: b = boot_queue.pop() booted.add(b) - for up, dn, _n in obj._graph.edges.keys(): + for (up, dn, _n) in obj._graph.edges.keys(): if up == b: boot_queue.add(dn) diff --git a/sharrow/selectors.py b/sharrow/selectors.py index b057f89..927cfaa 100644 --- a/sharrow/selectors.py +++ b/sharrow/selectors.py @@ -134,6 +134,7 @@ def _filter( ds_ = ds if _names: + result = ( getattr(ds_, _func)(**loaders) .digital_encoding.strip(_names)