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

Sub-dimensions #35

Open
JakobBD opened this issue Sep 20, 2024 · 1 comment
Open

Sub-dimensions #35

JakobBD opened this issue Sep 20, 2024 · 1 comment
Labels

Comments

@JakobBD
Copy link
Collaborator

JakobBD commented Sep 20, 2024

Right now, in SubArrayHandler, a dimension is either kept as is, or removed completely, as otherwise a sub-dimension (i.e. with a subset of items) would be required.
However, it often seems quite handy, see for example the plots in example 2, or historic_years as a subset of years.

For this sub-dimension, we'd have to come up with a safe way to generate a dim_letter, such that einsum operations stay safe.

For example, we could enforce lower-case letters for original dimensions, and upper-case for subsets, but this would entail that two different subsets of the same dimension wouldn't be distinguishable.

A different way (quite radical) would be:

  • get rid of dim_letter altogether
  • always address dimensions by name, not by letter
  • for each np.einsum operation, create temporary index letters on the fly

Then we could append strings the the subset names, which uniquely specify the subset.
But getting rid of letters would make a lot of the notation quite bulky.

@JakobBD JakobBD changed the title SubArrayHandler: several items along one dimension Sub-dimensions Sep 20, 2024
@JakobBD
Copy link
Collaborator Author

JakobBD commented Sep 20, 2024

intermediate solution:

  • Append unique strings to dim_letters of subsets
  • In np.einsum, replace these with arbitrary single letters

This seems like quite a good middle way.

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

No branches or pull requests

1 participant