Add lalib.config for library-wide settings
Also, refactor `lalib.elements.galois` (incl. tests) to use the new settings
This commit is contained in:
parent
febed693b8
commit
cbc1f8fd3a
3 changed files with 16 additions and 10 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue