Skip to content

Conversation

@oleksandr-pavlyk
Copy link
Contributor

This change modified Cython examples, as well as Python examples.

It add two files, examples/python/device_selection.py and examples/python/subdevices.py.

Please look them over, and suggest ideas for further examples.

Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device selection example functions are not being run anywhere in the example. Please fix that. Except for that we are golden.

Used run_examples routine implemented in _runner that
support comand-line arguments, allows introspect available
examples and run all of them, or any subset individually.

E.g.

```
(idp) [09:37:14 nuc04 python]$ python subdevices.py -q --run subdivide_root_cpu_device

cpu_d is a root device.
Sub-device #EU:  [4, 4, 4]
Sub-device is_root:  [False, False, False]
Sub-device parent is what we expected:  [True, True, True]
Sub-sub-device #EU:  [[1, 3], [1, 3], [1, 3]]
```
@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review April 15, 2021 15:23
@oleksandr-pavlyk oleksandr-pavlyk added this to the 0.7.0 milestone Apr 15, 2021
@oleksandr-pavlyk oleksandr-pavlyk merged commit 926e315 into master Apr 15, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the improve-examples branch April 15, 2021 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants