Becksteinlab / kda

Python package used for the analysis of biochemical kinetic diagrams.
GNU General Public License v3.0
3 stars 1 forks source link

MAINT: Change plotting function `label`/`path` behavior #51

Open nawtrey opened 2 years ago

nawtrey commented 2 years ago

The public plotting functions have parameters label and path that allow a user to specify a unique file name (without extension) and a save path to store their plot/plots. The way this is implemented is a bit awkward. It's probably sufficient to simply have a single parameter filename which, if specified, stores the plot/plots in the current working directory. It may not be the worst idea to give the option of specifying a separate path, but the current implementation requires both parameters, which is not ideal.

It would also be nice to save figures with different file types (e.g. .png, .pdf, .svg) based on user preference. For example, if the filename kinetic_diagram.svg is specified it will save it as this type, but if only kinetic_diagram is specified without an extension it defaults to .pdf. This will require some string parsing since not all file types would be supported, but it would be nice to have the option to choose the file type without too much hassle.

nawtrey commented 1 week ago

Right now most figures are being closed (i.e. plt.close()) right before returning. I think we should change this slightly -- if a save path is given I think figures should be automatically closed, but if not I think it may be useful for some diagrams to be left open. Might be worth adding a check for the number of diagrams and raising a warning if the number exceeds 20 or something.