Skip to content

Commit

Permalink
Merge commit 'a2096baf7a4d50f142ea0ccc4569786c01b5fa0a' into streamer
Browse files Browse the repository at this point in the history
# Conflicts:
#	.pre-commit-config.yaml
#	sharrow/categorical.py
#	sharrow/digital_encoding.py
#	sharrow/relationships.py
#	sharrow/tests/conftest.py
#	sharrow/tests/test_categorical.py
  • Loading branch information
jpn-- committed Dec 5, 2023
2 parents 13aa10c + a2096ba commit ef83d70
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sharrow/digital_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
Expand Down
3 changes: 3 additions & 0 deletions sharrow/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sharrow/relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions sharrow/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def _filter(
ds_ = ds

if _names:

result = (
getattr(ds_, _func)(**loaders)
.digital_encoding.strip(_names)
Expand Down

0 comments on commit ef83d70

Please sign in to comment.