pik-piam / sodym

MIT License
0 stars 2 forks source link

Sub-dimensions #35

Closed JakobBD closed 1 month ago

JakobBD commented 2 months ago

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:

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 commented 2 months ago

intermediate solution:

This seems like quite a good middle way.

JakobBD commented 1 month ago

Completed with #56 (Though a bit differently than suggested here)