Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed Nov 5, 2024
1 parent 354f155 commit 226e751
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/gluonts/testutil/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import typing
import waitress
from contextlib import closing, contextmanager
from dataclasses import dataclass
from dataclasses import dataclass, field
from multiprocessing.context import ForkContext
from pathlib import Path
from typing import Any, ContextManager, Dict, Iterable, List, Optional, Type
Expand Down Expand Up @@ -119,7 +119,7 @@ def free_port() -> int:
class Server:
env: ServeEnv
forecaster_type: Optional[Type[Predictor]]
settings: Settings = Settings()
settings: Settings = field(default_factory=Settings)

def run(self):
flask_app = make_flask_app(
Expand Down
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

try:
import mxnet as mx
except ImportError:
except (ImportError, OSError):
mx = None

try:
Expand Down
7 changes: 3 additions & 4 deletions test/core/test_serde_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
@serde.dataclass
class Estimator:
prediction_length: int
context_length: int = serde.OrElse(
lambda prediction_length: prediction_length * 2
)
context_length: int = serde.EVENTUAL

use_feat_static_cat: bool = True
cardinality: List[int] = serde.EVENTUAL

def __eventually__(self, cardinality):
def __eventually__(self, context_length, cardinality):
context_length.set_default(self.prediction_length * 2)
if not self.use_feat_static_cat:
cardinality.set([1])
else:
Expand Down

0 comments on commit 226e751

Please sign in to comment.