is compares object ids. It is possible for a variable to contain the string 'radar' without being the same object as another string 'radar'. Use == to compare objects to literals.
def compare(bar):
print(f"{id(bar)=}")
print(f"{id('radar')=}")
print(f"{bar is 'radar'=}")
print(f"{bar == 'radar'=}")
foo = 'rad'
foo += 'ar'
compare(foo)
id(bar)=2523833253296
id('radar')=2523833249968
bar is 'radar'=False
bar == 'radar'=True
https://github.com/nasa-jpl/autoRIFT/blob/2ed6e78a2c7e71b1ba4042efe9e9cbd34ffcfeeb/netcdf_output.py#L184
is
compares object ids. It is possible for a variable to contain the string 'radar' without being the same object as another string 'radar'. Use==
to compare objects to literals.