Add lalib.config for library-wide settings

Also, refactor `lalib.elements.galois`
(incl. tests) to use the new settings
This commit is contained in:
Alexander Hess 2024-10-14 14:50:02 +02:00
commit cbc1f8fd3a
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
3 changed files with 16 additions and 10 deletions

View file

@ -11,6 +11,7 @@ import sys
import pytest
from lalib import config
from lalib.elements import galois
@ -26,17 +27,15 @@ GF2Element, GF2One, GF2Zero = ( # not part of the official API
type(galois.zero), # are deleted in `lalib.elements.galois`
)
_THRESHOLD = galois.THRESHOLD
del galois
CROSS_REFERENCE = not os.environ.get("NO_CROSS_REFERENCE")
default_threshold = _THRESHOLD
within_threshold = _THRESHOLD / 10
not_within_threshold = _THRESHOLD * 10
default_threshold = config.THRESHOLD
within_threshold = config.THRESHOLD / 10
not_within_threshold = config.THRESHOLD * 10
strict_one_like_values = (
1,