diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Scripts/approximate.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -1 +1,2 @@ *.meta +.*.sw[po] diff --git a/Scripts/approximate.py b/Scripts/approximate.py index 1bfe13f..fb39283 100644 --- a/Scripts/approximate.py +++ b/Scripts/approximate.py @@ -278,7 +278,7 @@ def main(argv: list[str] | None = None) -> int: ) theta = 2.0 * np.pi * (xs - args.start) / length - sorted_terms = sorted(terms, key=lambda term: term.amplitude, reverse=True) + sorted_terms = sorted(terms, key=lambda term: abs(term.amplitude), reverse=True) available_components = len(sorted_terms) if args.terms > available_components: |
