这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e3b28cc
Update contributor info
opcode81 Oct 14, 2025
e9c302e
Remove package tianshou.policy
opcode81 Oct 14, 2025
f45b543
Add overview of learning process with glossary of terms
opcode81 Oct 14, 2025
22f1705
Add documentation page on Tianshou's dual APIs
opcode81 Oct 14, 2025
023aa8b
Change 'Concepts' page to 'Internals'
opcode81 Oct 14, 2025
95928de
Update docs landing page, fixing links to classes
opcode81 Oct 14, 2025
d0d24e1
Remove outdated document on DQN application/explanation of core concepts
opcode81 Oct 14, 2025
ca37fd0
Upgrade sensai-utils to v1.6
opcode81 Oct 21, 2025
b562117
Apply formatter
opcode81 Oct 21, 2025
9bb1c1b
High-level API: Add option to specify CollectorFactory in ExperimentB…
opcode81 Oct 21, 2025
4091fbc
Import wandb only locally, fully avoiding the import when it is not used
opcode81 Oct 21, 2025
dfd0b43
Allow newer versions of numpy (to support newer versions of Python), …
opcode81 Oct 21, 2025
6554061
Updated ruff, removed black
MischaPanch Oct 21, 2025
1c1f946
Pin exact ruff version
opcode81 Oct 21, 2025
71b6e7e
Merge branch 'dev-v2' into py313-support
opcode81 Oct 21, 2025
b317a92
Make assertions compatible with newer versions of numpy
opcode81 Oct 21, 2025
7bfe09f
Extend pytest CI job to test not only the pinned dev env but also an …
opcode81 Oct 21, 2025
43f773e
Allow newer versions of gymnasium (0.28 is lower bound)
opcode81 Oct 21, 2025
763bce0
Upgrade wandb to >= 0.16 because the old version pulled in pathtools
opcode81 Oct 21, 2025
98c1eb3
Do not install envpool for py_latest (supported for <= 3.11 only)
opcode81 Oct 21, 2025
1c02ba5
Only upload coverage for py_pinned
opcode81 Oct 21, 2025
e25d543
Make attribute getting behaviour of DummyEnvWorker compatible with gy…
opcode81 Oct 21, 2025
eae3304
Update change log with information on version compatibility
opcode81 Oct 21, 2025
80a1fde
Reinstate ruff check auto-fixing
opcode81 Oct 21, 2025
c33d19f
Ignore additional ruff rules (newly required because of ruff version …
opcode81 Oct 21, 2025
f15f089
Reformatting due to switch to ruff
opcode81 Oct 21, 2025
2b01d1a
Merge branch 'dev-v2' into py313-support
opcode81 Oct 21, 2025
ad544bc
Remove unused import
opcode81 Oct 21, 2025
178c560
Update lock file
opcode81 Oct 21, 2025
9122fb9
Merge branch 'dev-v2' into py313-support
opcode81 Oct 21, 2025
34d662b
Update wandb usage, remove unused 'type: ignore'
opcode81 Oct 22, 2025
950fdf0
Disable coverage for py_latest env
opcode81 Oct 22, 2025
28e887b
Disable env cache when not using lock file
opcode81 Oct 22, 2025
f15f6cb
List dependencies in CI
opcode81 Oct 22, 2025
152dda2
Require a higher ray version, because the old version caused infinite…
opcode81 Oct 22, 2025
3fadf5b
Add 'type: ignore' to most ray calls in the worker module
opcode81 Oct 22, 2025
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
61 changes: 51 additions & 10 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,94 @@ on:
required: false
default: false


# This job runs the test suite in two environments:
# - py_pinned: uses Python 3.11 with the existing poetry.lock file (our stable, pinned dev environment)
# - py_latest: latest Python version we want to support, without the lock file to furthermore install the newest dependency versions
#
# This ensures compatibility with both our controlled dev setup and the latest upstream packages,
# helping catch issues introduced by dependency updates or newer Python versions.
jobs:
cpu:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
python-version: ["3.11"]
include:
- env_name: py_pinned
python-version: "3.11"
use_lock: true
- env_name: py_latest
python-version: "3.13"
use_lock: false

steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# use poetry and cache installed packages, see https://github.com/marketplace/actions/python-poetry-action

- name: Install poetry
uses: abatilo/actions-poetry@v2

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file

- name: Remove poetry.lock for latest dependency test
if: ${{ !matrix.use_lock }}
run: rm -f poetry.lock

- name: Define a cache for the virtual environment based on the dependencies lock file
if: matrix.use_lock
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
key: venv-${{ matrix.env_name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ matrix.env_name }}-

- name: Install the project dependencies
run: |
poetry install --with dev --extras "envpool eval"
if [ "${{ matrix.env_name }}" = "py_latest" ]; then
poetry install --with dev --extras "eval"
else
poetry install --with dev --extras "envpool eval"
fi

- name: List installed packages
run: |
poetry run pip list

- name: wandb login
run: |
poetry run wandb login e2366d661b89f2bee877c40bee15502d67b7abef

- name: Test with pytest
# ignore test/throughput which only profiles the code
run: |
poetry run poe test
if [ "${{ matrix.env_name }}" = "py_pinned" ]; then
poetry run poe test
else
poetry run poe test-nocov
fi
- name: Upload coverage to Codecov
if: matrix.env_name == 'py_pinned'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
flags: ${{ matrix.env_name }}
name: codecov-${{ matrix.env_name }}
fail_ci_if_error: false
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Developers:
* Dr. Dominik Jain (@opcode81)
* Michael Panchenko (@MischaPanch)

### Runtime Environment Compatibility

Tianshou v2 is now compatible with
* Python 3.12 and Python 3.13 #1274
* newer versions of gymnasium (v1+) and numpy (v2+)

Our main test environment remains Python 3.11-based for the time being (see `poetry.lock`).

### Trainer Abstraction

* The trainer logic and configuration is now properly separated between the three cases of on-policy, off-policy
Expand Down Expand Up @@ -228,6 +236,9 @@ Developers:
contain parameter `repeat_per_collect`).
* All parameter names have been aligned with the new names used by `TrainerParams` (see above).

* Add option to customize the factory for the collector (`ExperimentBuilder.with_collector_factory`),
adding the abstraction `CollectorFactory`. #1256

### Peripheral Changes

* The `Actor` classes have been renamed for clarity (#1091):
Expand Down
Loading