WAM2layers/Moisture_tracking_intercomparison

Standard naming of scripts and figures

Opened this issue · 3 comments

Hi all,
browsing through this repo and the plots on the Leiden driven a few days after the workshop, I am having trouble finding the same plot for all cases (just by the name) and the script that created a specific figure. Can we also introduce a rough naming convention for scripts and figure files?

To illustrate what I mean:

image

What does corr_matrix.png show?

image

The file without case name probably refers to Pakistan, but what do the different versions refer to?

Thanks, that is a good point, one suggestion could be:

FigNumber_plotname_case.png
E.g. Fig3_MoistureSources_Pakistan.png

I don't think we would need a version number anymore.

Just an idea: perhaps we could also add some metadata to each of the figures? I see two ways in which we could do that.

  1. A sidecar file, same name as the figure but different extension, with some metadata. This is common e.g. for several image formats.
  2. Add metadata into the PNG directly. That is supported by matplotlib, but it requires more effort to get it out.

Example for option1:

plt.savefig("Fig3_MoistureSources_Pakistan.png")
with open("Fig3_MoistureSources_Pakistan.txt") as sidecar:
    sidecar.write("This figure show ....")

Example for option 2 (see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html):

metadata = {
    "Title": "Moisture sources Pakistan",
    "Description": "This figure shows ...",
}
plt.savefig("Fig3_MoistureSources_Pakistan.png", metadata=metadata)