Open ES-Alexander opened 5 months ago
Very interesting to see this.
There is an additional use case of no plotting at all - only returning raw data. This is a very useful output so does need to remain, but I understand your statement in the issue #90 that it's bad practice to have conditional return types.
In fact, the fc.transform()
function already has multiple return types, but that seems like a logical rule-break since a transformation to gcode or to a visualisation are clearly not going to return the same thing. However, I do see that tranforming to 'plot', and then having a second-condition for the returned object type can get confusing.
It may be best practice to move that functionality out of the 'plot' transform option. It could be a new standalone transform option of 'plot_data'. I mean that the user writes fc.transform(steps, 'plot_data')
instead of the current approach of fc.transform(steps, 'plot', fc.GcodeControls(raw_data=True)
What are your thoughts?
Fixes #90, per this comment
⚠️ Untested, so it's likely worth checking that it actually works for the main use-cases:
- plotting and displaying a new Figure (standard behaviour)
- plotting, displaying, and returning a Figure (extended behaviour)
- plotting and returning a Figure, with
controls.show = False
(new behaviour)- inputting a preconfigured Figure (new behaviour)
Fixes #90, per this comment
⚠️ Untested, so it's likely worth checking that it actually works for the main use-cases:
controls.show = False
(new behaviour)