cloudsci / cloudmetrics

Toolkit for computing 15+ metrics characterising 2D cloud patterns
16 stars 8 forks source link

Bugfix: Windowing should only be applied if there are no periodic bcs #36

Closed martinjanssens closed 2 years ago

martinjanssens commented 3 years ago

A colleague of mine found that my refactored spectrum calculation only applied windowing if periodic_domain==True, while we want the opposite. Have fixed this here!

leifdenby commented 2 years ago

Looks good to me :) Does it makes sense that this wasn't caught by a test?

leifdenby commented 2 years ago

@martinjanssens just double-checking this, should we add a test for this? Seems like this should've been caught by a test earlier if there was something amiss...

martinjanssens commented 2 years ago

Sorry, I had forgotten about this. It makes sense that this wasn't caught by a test, as the fourier metrics are only tested for correctness on periodic domains. I've added a test that tries to just run the code for all possible inputs to make sure it doesn't crash, that should catch errors like these in the future :)