Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
"pymongo",
"loguru",
"lightgbm",
"gym",
"gymnasium<=0.26.2",
"cvxpy",
"joblib",
"matplotlib",
Expand Down
4 changes: 2 additions & 2 deletions qlib/rl/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from typing import Any, Generic, TypeVar

import gym
import gymnasium as gym
import numpy as np
from gym import spaces
from gymnasium import spaces

from qlib.typehint import final
from .simulator import ActType, StateType
Expand Down
2 changes: 1 addition & 1 deletion qlib/rl/order_execution/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import numpy as np
import pandas as pd
from gym import spaces
from gymnasium import spaces

from qlib.constant import EPS
from qlib.rl.data.base import ProcessedDataProvider
Expand Down
4 changes: 2 additions & 2 deletions qlib/rl/order_execution/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from pathlib import Path
from typing import Any, Dict, Generator, Iterable, Optional, OrderedDict, Tuple, cast

import gym
import gymnasium as gym
import numpy as np
import torch
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.policy import BasePolicy, PPOPolicy, DQNPolicy

Expand Down
4 changes: 2 additions & 2 deletions qlib/rl/utils/env_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import weakref
from typing import Any, Callable, cast, Dict, Generic, Iterable, Iterator, Optional, Tuple

import gym
from gym import Space
import gymnasium as gym
from gymnasium import Space

from qlib.rl.aux_info import AuxiliaryInfoCollector
from qlib.rl.interpreter import ActionInterpreter, ObsType, PolicyActType, StateInterpreter
Expand Down
2 changes: 1 addition & 1 deletion qlib/rl/utils/finite_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from contextlib import contextmanager
from typing import Any, Callable, Dict, Generator, List, Optional, Set, Tuple, Type, Union, cast

import gym
import gymnasium as gym
import numpy as np
from tianshou.env import BaseVectorEnv, DummyVectorEnv, ShmemVectorEnv, SubprocVectorEnv

Expand Down
2 changes: 1 addition & 1 deletion scripts/collect_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def qlib(self):
"pymongo",
"loguru",
"lightgbm",
"gym",
"gymnasium",
"cvxpy",
"joblib",
"matplotlib",
Expand Down
2 changes: 1 addition & 1 deletion tests/rl/test_finite_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from collections import Counter

import gym
import gymnasium as gym
import numpy as np
from tianshou.data import Batch, Collector
from tianshou.policy import BasePolicy
Expand Down
4 changes: 2 additions & 2 deletions tests/rl/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import re
from typing import Any, Tuple

import gym
import gymnasium as gym
import numpy as np
import pandas as pd
from gym import spaces
from gymnasium import spaces
from tianshou.data import Collector, Batch
from tianshou.policy import BasePolicy

Expand Down
2 changes: 1 addition & 1 deletion tests/rl/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import torch
import torch.nn as nn
from gym import spaces
from gymnasium import spaces
from tianshou.policy import PPOPolicy

from qlib.config import C
Expand Down
Loading