ray/python
Sebastián Ramírez 8bde3f5dd7
🎨 Update type annotations to include options in ray.remote() (#25999)
The current type annotations expect and support using:

```Python
@ray.remote
def do_things(x: int, y: float):
    return x * y
```

...without options.

This PR adds type annotations for passing options, as in:

```Python
@ray.remote(num_cpus=3)
def do_more_things(name: str, value: float):
    return f"{name}: {value}"
```

Before:

<img width="687" alt="Screenshot 2022-06-22 at 04 49 11" src="https://user-images.githubusercontent.com/1326112/174999689-80bdc3ce-b437-464f-b05c-7613b3f8f89b.png">

After (autocompletion):

<img width="687" alt="Screenshot 2022-06-22 at 04 50 34" src="https://user-images.githubusercontent.com/1326112/174999899-5062335a-17ee-44a8-ad5c-97335e201e7b.png">

...and no errors:

<img width="687" alt="Screenshot 2022-06-22 at 04 51 15" src="https://user-images.githubusercontent.com/1326112/175000001-0a978871-8835-426f-9e09-5848194639fd.png">
2022-06-23 17:50:25 -07:00
..
ray 🎨 Update type annotations to include options in ray.remote() (#25999) 2022-06-23 17:50:25 -07:00
requirements [air] Move python/ray/ml to python/ray/air (#25449) 2022-06-03 21:53:44 +01:00
asv.conf.json [docs] Move all /latest links to /master (#11897) 2020-11-10 10:53:28 -08:00
build-wheel-macos-arm64.sh [python3.10] build python310 wheels (#24829) 2022-05-16 12:36:33 -07:00
build-wheel-macos.sh [python3.10] build python310 wheels (#24829) 2022-05-16 12:36:33 -07:00
build-wheel-manylinux2014.sh [python3.10] build python310 wheels (#24829) 2022-05-16 12:36:33 -07:00
build-wheel-windows.sh [python3.10] build python310 wheels (#24829) 2022-05-16 12:36:33 -07:00
MANIFEST.in [hotfix] Revert "Exclude Bazel build files from Ray wheels (#25679)" (#25950) 2022-06-20 20:59:48 -07:00
README-building-wheels.md [build] Build wheels with manylinux2014 (#11621) 2020-11-03 19:36:32 -08:00
requirements.txt [Core] update protobuf to 3.19.4 (#25648) 2022-06-18 16:06:56 -07:00
requirements_linters.txt Add import sorting to format.sh (#25678) 2022-06-13 14:08:51 -07:00
requirements_ml_docker.txt [AIR] Add distributed torch_geometric example (#23580) 2022-04-21 09:48:43 -07:00
setup.py [tune/structure] Move CLI files into subpackage (#26011) 2022-06-22 23:05:26 +01:00