Coding 2022-05-22

By Max Woerner Chase

Ugh, the temperature is spiking and the AC just sort-of works. Gosh, who could have predicted this? Besides me. A week ago.

Let me see what I can do in terms of nailing down the changes to MOTR.

So, ParametricCommand.build() must pass a dict in the form {Label(): ValueAdaptor()}, where... the Label is probably a ParameterLabel[PathWith[EnvironmentArgs]], and the ValueAdaptor is a ValueAdaptor[PathWith[EnvironmentArgs]]. I think. Now, that dict can be trivially derived from a ValueAdaptor[PathWith[EnvironmentArgs]]. And the ValueAdaptor[PathWith[EnvironmentArgs]] can be created by decorating a Callable[[PathWith[EnvironmentArgs]], PathStr] with @adaptive(LABEL) where LABEL is a ParameterLabel[PathWith[EnvironmentArgs]]. Because of the common logic, it probably makes sense to create a factory function that converts labels appropriately.

Now, at the other end of ParametricCommand.build(), I've got a Parametric[CommandBuilder[...]]. That needs to get properly converted, which can be done by mapping a basic parametric extraction over the relevant label and passing that into the requirements method.

I'm going to get some low-hanging fruit before I go too far.

Got it. Simple method on Parametric to pull out some redundant code.

Anyway, let's see... I think this needs some helper functions to create simple Parametric objects given Labels...

Given those helpers, I can map CommandBuilder.requirements() over the Parametrics, and lastly, I need to convert the resulting Parametric[Requirements[None]] to a Parametric[None], which should be another simple helper function.

There's still more to sketch out, but it's getting late, so I'm going to quickly put out the helper functions that I'm pretty sure I'll need.

Okay, that's done. The next areas to really focus on are:

Hopefully, I'll be thinking a bit clearer tomorrow. We'll see.

Good night.