Fix `sb3_contrib/common/utils.py` type hint (#120)

* Update contribution.md

* New loop struct to make mypy happy

* Update setup.cfg

* Update changelog

* Add return statement in cg solver for max_iter=0

Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
This commit is contained in:
Quentin Gallouédec 2022-11-29 10:24:44 +01:00 committed by GitHub
parent 3d28d1e5de
commit ded9f65bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -152,7 +152,7 @@ To run tests with `pytest`:
make pytest
```
Type checking with `pytype`:
Type checking with `pytype` and `mypy`:
```
make type
@ -165,7 +165,7 @@ make check-codestyle
make lint
```
To run `pytype`, `format` and `lint` in one command:
To run `type`, `format` and `lint` in one command:
```
make commit-checks
```

View File

@ -27,6 +27,7 @@ Deprecations:
Others:
^^^^^^^
- Fixed flake8 config
- Fixed ``sb3_contrib/common/utils.py`` type hint
Release 1.6.2 (2022-10-10)
--------------------------

View File

@ -133,6 +133,8 @@ def conjugate_gradient_solver(
beta = new_residual_squared_norm / residual_squared_norm
residual_squared_norm = new_residual_squared_norm
p = residual + beta * p
# Note: this return statement is only used when max_iter=0
return x
def flat_grad(

View File

@ -32,7 +32,6 @@ exclude = (?x)(
| sb3_contrib/common/recurrent/type_aliases.py$
| sb3_contrib/common/recurrent/policies.py$
| sb3_contrib/common/recurrent/buffers.py$
| sb3_contrib/common/utils.py$
| sb3_contrib/common/maskable/distributions.py$
| sb3_contrib/common/maskable/callbacks.py$
| sb3_contrib/common/maskable/policies.py$