allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.69k stars 655 forks source link

Logger: adhere to the Principle of Least Astonishment in "report_matplotlib_figure" #991

Open Make42 opened 1 year ago

Make42 commented 1 year ago
plot_tidy = data_tidy \
    .groupby('label') \
    .count() \
    .sort_values(by='text', ascending=False) \
    .plot(kind='bar', title='Number of instances per label 1', legend=False)
dataset.get_logger().report_matplotlib_figure(
    figure=plt,
    title='Dataset Statistics',
    series='Number of instances per label 2')

I must admit, that I find it a little astonishing to have plt (which is an imported module!) to be the "figure". Why is that? Has this something to do with how matplotlib works? Why is the argument called "figure" then? (If I understand, maybe I am less surprised ;-).

I would like to suggest to change "figure" to a different name for the argument, to adhere to the Principle of least astonishment.