Skip to content

Improve examples #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 15, 2021
Merged

Improve examples #390

merged 10 commits into from
Apr 15, 2021

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