mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 14:56:55 +08:00
chore(deps): replace unmaintained 'gym' with 'gymnasium'
This commit is contained in:
@@ -45,7 +45,7 @@ dependencies = [
|
|||||||
"pymongo",
|
"pymongo",
|
||||||
"loguru",
|
"loguru",
|
||||||
"lightgbm",
|
"lightgbm",
|
||||||
"gym",
|
"gymnasium",
|
||||||
"cvxpy",
|
"cvxpy",
|
||||||
"joblib",
|
"joblib",
|
||||||
"matplotlib",
|
"matplotlib",
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any, Generic, TypeVar
|
from typing import Any, Generic, TypeVar
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from gym import spaces
|
from gymnasium import spaces
|
||||||
|
|
||||||
from qlib.typehint import final
|
from qlib.typehint import final
|
||||||
from .simulator import ActType, StateType
|
from .simulator import ActType, StateType
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from typing import Any, List, Optional, cast
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from gym import spaces
|
from gymnasium import spaces
|
||||||
|
|
||||||
from qlib.constant import EPS
|
from qlib.constant import EPS
|
||||||
from qlib.rl.data.base import ProcessedDataProvider
|
from qlib.rl.data.base import ProcessedDataProvider
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ from __future__ import annotations
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, Generator, Iterable, Optional, OrderedDict, Tuple, cast
|
from typing import Any, Dict, Generator, Iterable, Optional, OrderedDict, Tuple, cast
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from gym.spaces import Discrete
|
from gymnasium.spaces import Discrete
|
||||||
from tianshou.data import Batch, ReplayBuffer, to_torch
|
from tianshou.data import Batch, ReplayBuffer, to_torch
|
||||||
from tianshou.policy import BasePolicy, PPOPolicy, DQNPolicy
|
from tianshou.policy import BasePolicy, PPOPolicy, DQNPolicy
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from __future__ import annotations
|
|||||||
import weakref
|
import weakref
|
||||||
from typing import Any, Callable, cast, Dict, Generic, Iterable, Iterator, Optional, Tuple
|
from typing import Any, Callable, cast, Dict, Generic, Iterable, Iterator, Optional, Tuple
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
from gym import Space
|
from gymnasium import Space
|
||||||
|
|
||||||
from qlib.rl.aux_info import AuxiliaryInfoCollector
|
from qlib.rl.aux_info import AuxiliaryInfoCollector
|
||||||
from qlib.rl.interpreter import ActionInterpreter, ObsType, PolicyActType, StateInterpreter
|
from qlib.rl.interpreter import ActionInterpreter, ObsType, PolicyActType, StateInterpreter
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import warnings
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from typing import Any, Callable, Dict, Generator, List, Optional, Set, Tuple, Type, Union, cast
|
from typing import Any, Callable, Dict, Generator, List, Optional, Set, Tuple, Type, Union, cast
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from tianshou.env import BaseVectorEnv, DummyVectorEnv, ShmemVectorEnv, SubprocVectorEnv
|
from tianshou.env import BaseVectorEnv, DummyVectorEnv, ShmemVectorEnv, SubprocVectorEnv
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class InfoCollector:
|
|||||||
"pymongo",
|
"pymongo",
|
||||||
"loguru",
|
"loguru",
|
||||||
"lightgbm",
|
"lightgbm",
|
||||||
"gym",
|
"gymnasium",
|
||||||
"cvxpy",
|
"cvxpy",
|
||||||
"joblib",
|
"joblib",
|
||||||
"matplotlib",
|
"matplotlib",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from tianshou.data import Batch, Collector
|
from tianshou.data import Batch, Collector
|
||||||
from tianshou.policy import BasePolicy
|
from tianshou.policy import BasePolicy
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import logging
|
|||||||
import re
|
import re
|
||||||
from typing import Any, Tuple
|
from typing import Any, Tuple
|
||||||
|
|
||||||
import gym
|
import gymnasium as gym
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from gym import spaces
|
from gymnasium import spaces
|
||||||
from tianshou.data import Collector, Batch
|
from tianshou.data import Collector, Batch
|
||||||
from tianshou.policy import BasePolicy
|
from tianshou.policy import BasePolicy
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import pytest
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from gym import spaces
|
from gymnasium import spaces
|
||||||
from tianshou.policy import PPOPolicy
|
from tianshou.policy import PPOPolicy
|
||||||
|
|
||||||
from qlib.config import C
|
from qlib.config import C
|
||||||
|
|||||||
Reference in New Issue
Block a user