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

Implements stringification for arrays #181

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kaushikcfd
Copy link
Collaborator

@kaushikcfd kaushikcfd commented Oct 28, 2021

@kaushikcfd kaushikcfd force-pushed the strify branch 5 times, most recently from 986e50a to 2007994 Compare October 29, 2021 18:32
@matthiasdiener
Copy link
Collaborator

Does this supersede #179?

@kaushikcfd
Copy link
Collaborator Author

Does this supersede #179?

Nope, I would say adds to it, as this PR doesn't define DictOfNamedArrays.__str__.

@kaushikcfd kaushikcfd linked an issue Oct 30, 2021 that may be closed by this pull request
kwargs["shape"] = tuple(self.rec(dim) for dim in expr.shape)
return p.CallWithKwargs("IndexLambda",
parameters=(),
kw_parameters=kwargs)
Copy link
Owner

Choose a reason for hiding this comment

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

Missing the expression? :)

return next(filter(pred, iterable), default)


def _get_einsum_spec(einsum: Einsum) -> str:
Copy link
Owner

Choose a reason for hiding this comment

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

Test this against "parse_einsum" to be "post-normalization inverse".


# {{{ stringify mapper

class StringifyMapper(StringifyMapperBase):
Copy link
Owner

Choose a reason for hiding this comment

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

Exponential complexity in string concat?

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.

Array nodes should have a __repr__
3 participants