Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Sep 8, 2025

meant to be executed directly, but to be further processed via
:meth:`reduce`.
"""
return self._from_cyclebane(self._cbgraph.groupby(node))
Copy link
Member

@SimonHeybrock SimonHeybrock Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is working. Doesn't it create some sort of broken object that looks like a regular DataGraph (will the usual methods), but actually only certain types of reduce calls will work, because that is all the object returned from groupby in Cyclebane can do)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a weird/broken object. To avoid this, we could either create a GroupbyGraph in sciline as well, or just combine the groupby+reduce in a single call so we never return the broken object.

I would favor the second option. Something like mapped_wf.groupby(key=RawData, reduce=merge_function)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't we need extra args, making it complicated? Adding GroubyGraph should not be difficult, right?

@nvaytet
Copy link
Member Author

nvaytet commented Sep 10, 2025

We should wait for #221

@nvaytet

This comment was marked as resolved.

@nvaytet

This comment was marked as resolved.

"import sciline\n",
"\n",
"_fake_filesytem = {\n",
" 'file102.txt': [1, 2, float('nan'), 3],\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you undo the reformat? This is hard to review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it was done by mistake, not easy to undo...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git checkout -p main -- the/file.ipynb maybe?

# We forward the constructor so this can be used by both DataGraph and Pipeline
self._graph_maker = graph_maker

def reduce(self, *, func: Callable[..., Any], **kwargs: Any) -> DataGraph:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is user-facing we should repeat all the args (for auto-complete) and docstrings, instead of just using kwargs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants