flucoma / flucoma-max

Fluid Corpus Manipulation objects for Cycling 74's Max
BSD 3-Clause "New" or "Revised" License
90 stars 17 forks source link

fluid.pca~ fittransform message breaks nameless cascading #211

Open rconstanzo opened 2 years ago

rconstanzo commented 2 years ago

When chaining fluid.datasetprocess~ objects (e.g. fluid.normalize~, fluid.pca~, etc...) you can typically just chain them together since the fittransform message cascades quite elegantly.

Except for fluid.pca~ which outputs an additional variable, the variance, which the subsequent object interprets as the name of a dataset (e.g. fittransform firstDataset 0.23523393)

Screenshot 2022-05-15 at 1 06 20 pm

This means you can't simply cascade fluid.pca~ -> fluid.umap~, or any other fluid.datasetprocess~ for that matter.

It's easy enough to code around this (zl slice 2), but it really breaks the elegance of chaining the objects, and makes anything post-fluid.pca~ require additional coding.

A simple solution would be to move the variance output to the fit message instead, which would have the added benefit of allowing for iterative looping to arrive at a suitable variance output without unintentionally processing the rest of the chain. (e.g. if I want to loop over fluid.pca~ to get >95% variance, I would have to gate the output to avoid processing the rest of the chain each loop, which could lock up the scheduler if you have a chunky fluid.umap~ downstream)

rconstanzo commented 3 weeks ago

As per @tremblap suggestion, I am going through older issues and this one still gets me every time. I get errors and after some confused troubleshooting discover, then re-remember, this issue every time.