Coding 2023-10-23

Tags:
By Max Woerner Chase

Hmmph. I'm pushing up the coverage on the matrix module, but it's getting to the point where I have to consider the names of things before I feel comfortable writing more tests.

See, there are a few supplemental classes in that module that I'm not feeling totally on-board with the current names of: AdaptiveMatrix and MappedSelection.

Let's consider MappedSelection first. Basically, it's a single selection label, plus a function to map from the type of the selection label to something that can be slotted into a Path. Put together, it allows for the creation of two matrices which can be freely combined because they have the same axis structure. The label itself and the matrices are relevant in different parts of the code.

One of those parts of the code is the AdaptiveMatrix, which combines a variable-length tuple of MappedSelections with a Matrix[T], which is constrained to iterate over exactly the same labels as are present in the tuple of MappedSelections. The AdaptiveMatrix is one of three possible things that can end up in a sequence of command-line arguments(ish):

This sounds niche, but everything breaks if I don't have it, so.

When I look at the code, I think this could potentially get a bunch more complicated, but maybe not...

Anyway.

The key perspectives of the MappedSelection:

I'm not going to put in the effort tonight, but now I wonder if something like SelectedDirectory and MatrixDirectory would strike me better. I'll sleep on it. For now, I've got other stuff I'll focus on for a bit to clear my head.

Good night.