Skip to content

Commit

Permalink
Import OrderedDict from collections
Browse files Browse the repository at this point in the history
Summary: `typing.OrderedDict` is a deprecated alias of `collections.OrderedDict`: https://docs.python.org/3/library/typing.html#typing.OrderedDict

Differential Revision: D56795174
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Apr 30, 2024
1 parent 1be47e1 commit defdbfa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ax/models/torch/botorch_modular/surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
from __future__ import annotations

import inspect
from collections import OrderedDict
from collections.abc import Sequence
from copy import deepcopy
from logging import Logger
from typing import Any, Dict, List, Optional, OrderedDict, Tuple, Type, Union
from typing import Any, Dict, List, Optional, Tuple, Type, Union

import torch
from ax.core.search_space import SearchSpaceDigest
Expand Down
3 changes: 2 additions & 1 deletion ax/models/torch/botorch_modular/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
# pyre-strict

import warnings
from collections import OrderedDict
from collections.abc import Sequence
from logging import Logger
from typing import Any, Callable, Dict, List, Optional, OrderedDict, Tuple, Type
from typing import Any, Callable, Dict, List, Optional, Tuple, Type

import torch
from ax.core.search_space import SearchSpaceDigest
Expand Down
3 changes: 2 additions & 1 deletion ax/models/torch/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
# pyre-strict

import dataclasses
from collections import OrderedDict
from contextlib import ExitStack
from copy import deepcopy
from typing import Dict, OrderedDict, Type
from typing import Dict, Type
from unittest import mock
from unittest.mock import Mock

Expand Down
3 changes: 2 additions & 1 deletion ax/models/torch/tests/test_surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import dataclasses
import math
from typing import Any, Dict, OrderedDict, Tuple, Type
from collections import OrderedDict
from typing import Any, Dict, Tuple, Type
from unittest.mock import MagicMock, Mock, patch

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion ax/models/torch/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# pyre-strict

import warnings
from typing import OrderedDict
from collections import OrderedDict

import numpy as np
import torch
Expand Down

0 comments on commit defdbfa

Please sign in to comment.