I’m going to give this a try. Might be too much, but if you get something out of it, awesome. I think it helps that I play piano because I can see everything laid out on a keyboard. I’m not going to go into anything too complex because I still sometimes have trouble remembering these things, and I studied them. I’ve always wondered why whistles were made in so many keys, and I suspect it has much to do with the limited (2 octaves plus a bit more if get creative) range you get on each instrument.
If you simply look at written music, the number of flats or sharps will give you the key signature only, but unless you specify whether it’s a major or minor scale, that could cause confusion. The link below to the circle of fifths that was mentioned above by tstermitz will at least give an idea of first what to look for in terms of key signatures with the major scales and the relative minor scales.
https://en.wikipedia.org/wiki/Relative_key#/media/File:Circle_of_fifths_deluxe_4.svg
In the case of a D whistle, it’s keyed in the D major scale (D-E-F#-G-A-B-C#-D) with its relative minor scale B. Diatonic refers to the specific spread of 5 whole steps and 2 half steps (or semitone) in pitch across the octave. For D major, you have semitones between the 3rd (F#) and 4th (G), then between the 7th (C#) and the 8th (D). Then we get into modes. In the D mixolydian mode, you end up with a flatted 7th so that C# becomes C, and you end up with only the one sharped F. This is the same key signature for G major with relative minor E. Speaking of E minor, E Dorian is essentially the E minor scale with a sharped 6th (C to C#). Thus, you get the same key signature as the D major scale again. If you read through the link below, there are more details. In terms of modes, the major scale is the Ionian mode, and the relative (natural) minor is the Aeolian mode. Yes, I had to look these up again because I could not remember the names, only the theory behind them. As a side note, the natural minor is the true relative minor of a particular key signature. Harmonic and melodic minor scales involve changes to specific notes that would change the key signatures, even though the first note of the scale (tonic) remains the same. I mixed these up a lot when I was taking piano as a kid.
https://en.wikipedia.org/wiki/Diatonic_scale
Realistically, on a D whistle, you can easily play any of the key signatures / modes that use the two octaves of the notes D-E-F#-G-A-B-C#-D, and C with oxxooo or oxxxoo fingering. Other flats or sharps require half-holing or some creative fingering and checking with a tuner; I would recommend half-holing as I found that to be more accurate in terms of the pitch. But if you do anything other than the D major, or even the E minor or Dorian, but anything else will limit the the number of upper notes you can play in those scales/modes/whatever you want to call them.