sczesla / PyAstronomy

A collection of astronomy-related routines in Python
152 stars 35 forks source link

GLS fast calculation #55

Closed skiehl closed 2 years ago

skiehl commented 2 years ago

In pyTiming/pyPeriod/gls.py the doc string of the Gls class says for the freq parameter:

If given, fast and verbose option are not available.

However, an error is raised raise(ValueError("freq and fast cannot be used together.")) when the frequency is NOT given and fast=True. The error is raised for the wrong conditions. In particular, with this implementation fast=True can only be used with a manually provided frequency array, which is exactly the situation fast calculations should not work. Indeed, I in a quick test fast=True and fast=False gave inconsistent results, with a manually provided frequency array. Whereas, the results are consistent, when the same frequency array is provided manually, which would be automatically generated if freq=None.

It looks like the error raising needs to be placed differently.

sczesla commented 2 years ago

Hi, Thanks for reporting. Yes, this is true. This error appears to have been fixed recently and, as it seems, too recently to make it into the latest release. I will draft an updated release later today to get rid of this annoyance. Cheers

sczesla commented 2 years ago

New version should contain fix.