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

Docs delim section #5

Closed
rofinn opened this issue Mar 8, 2021 · 1 comment · Fixed by #51
Closed

Docs delim section #5

rofinn opened this issue Mar 8, 2021 · 1 comment · Fixed by #51
Labels
documentation Improvements or additions to documentation

Comments

@rofinn
Copy link
Member

rofinn commented Mar 8, 2021

Since we're aiming for explicit delimiters we should probably have a section explaining some of the decisions.

  1. Why do we need delimiters if keys should be tuples?
  • NamedTuples need names to be symbols
  • Dimension names are also represented by symbols
  1. Why do we need multiple delimiters?
  • To identify slightly different types of operations that may be important for code that automatically parses / tokenizes the results.
    • : Common identifier for flattening arbitrary nested structures
    • ˣ: Flattening dimensions of an array (new dimensions and keys are the product of the flattened dimensions)
    • : Arrays have been concatenated along that dimensions
@rofinn rofinn mentioned this issue Mar 8, 2021
@rofinn rofinn added the documentation Improvements or additions to documentation label Mar 11, 2021
@rofinn
Copy link
Member Author

rofinn commented Apr 19, 2021

In retrospect, I wonder if we should avoid default delimiters altogether. We could default to using Tuples whenever possible to avoid having an opinion and require a delim argument be provided whenever it's required (e.g., NamedTuple, dimname). This has a few benefits.

  1. Tuples preserve type information that can be used to generate stringified names after the fact
  2. Erroring if delim isn't provide and is required provides means we don't need to have yet another separator debate. In practice we've also found that we usually want to provide a new dimname when flattening or concatenating keyed arrays anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant