Skip to content

Commit c3919c0

Browse files
authored
Updated docs/overview.md and docs/vscode.md files. (#1057)
* updated docs * modified docs/overview.md
1 parent 6e97430 commit c3919c0

File tree

2 files changed

+40
-38
lines changed

2 files changed

+40
-38
lines changed

docs/overview.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66

77
# TensorFlow I/O
88

9-
TensorFlow I/O is a collection of file systems and file formats that are not
10-
available in TensorFlow's built-in support.
11-
12-
TensorFlow I/O has integrations with many systems and cloud vendors such as
13-
Prometheus, Apache Kafka, Apache Ignite, Google Cloud PubSub, AWS Kinesis,
14-
Microsoft Azure Storage, Alibaba Cloud OSS etc.
9+
TensorFlow I/O is an extension package to Tensorflow, which encompasses io support for
10+
a collection of file systems and file formats that are not available in TensorFlow's built-in support.
11+
Integrations with many systems and cloud vendors include (but not limited to):
12+
13+
- Prometheus
14+
- Apache Kafka
15+
- Apache Ignite
16+
- Google Cloud BigQuery
17+
- Google Cloud PubSub
18+
- AWS Kinesis
19+
- Microsoft Azure Storage
20+
- Alibaba Cloud OSS etc.
1521

1622
## Community
1723

docs/vscode.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
# Configuring Visual Studio Code
22

3-
Visual Studio is a free code editor, which runs on the macOS, Linux, and Windows operating systems.
4-
5-
It has nice tooling for Python and C++ development, visual debugger, git integration, and many more
6-
useful features. It is a great editor to use for TensorFlow IO development, but it takes some effort
7-
to configure it properly. VSCode configuration is very flexible, it allows compiling project using
8-
bazel, and running code under Python and C++ debuggers. This manual is for Linux, other OSes
9-
might have specifics, but approach should be similar.
10-
3+
Visual Studio Code (VSCode) is a free code editor, which runs on the macOS, Linux, and Windows operating systems. It has elegent tooling support which supports Python & C++ development, visual debugging, integration with git and many more interesting features. Owing to the ease of use and extension management, it is a great editor for TensorFlow IO development. However, some effort is necessary
4+
to configure it properly. Since VSCode configuration is very flexible, it allows developers to
5+
compile project using bazel and run the code under Python and C++ debuggers. The base tool setup might differ based on the operation systems, but the configuration approach should be similar.
116

127
## Extensions
13-
To install an extension click the extensions view icon (Extensions) on the Sidebar, or use the shortcut Ctrl+Shift+X.
14-
Then searh for keyword below.
8+
9+
To install an extension click the extensions view icon (Extensions) on the Sidebar, or use the shortcut Ctrl+Shift+X. Then searh for keyword below.
1510

1611
- [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - Official C++ extension from Microsoft
1712
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - Official Python extension from Microsoft
1813
- [Python Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-extension-pack) - another useful extension for Python development
1914

2015
## Compiling projects
16+
2117
TensorFlow IO is compiled using bazel build command:
2218

2319
```sh
@@ -28,9 +24,9 @@ See project [README](https://github.com/tensorflow/io#ubuntu-18042004) file for
2824
--compilation_mode dbg flag here indicates that produced binary should have debug symbols.
2925
Once you can compile project from command line, you can also configure VSCode to be able to invoke same command.
3026

31-
Open View->Command Pallete (Ctrl+Shift+P) and start typing: "Tasks: Configure Build Task".
27+
Open View->Command Pallete (**Ctrl+Shift+P**) and start typing: "Tasks: Configure Build Task".
3228
If you are doing this for the first time, editor is going to suggest creating tasks.json file.
33-
Once you have it, paste following json:
29+
Once you have it, paste the following json:
3430

3531
```jsonc
3632
{
@@ -50,29 +46,28 @@ Once you have it, paste following json:
5046
}
5147
```
5248

53-
Now, you can press "Ctrl+Shift+B", and VSCode is going to use the command above to build the project.
54-
It uses its own terminal window, where all links are clickable. So when compilation error occurs, you can
55-
just click the link, and editor will open corresponding file and navigate to the line.
49+
Now, you can press **Ctrl+Shift+B**, and VSCode is going to use the command above to build the project.
50+
It uses its own terminal window, where all links are clickable. So when a compilation error occurs, you open the corresponding file and navigate to the line by just clicking on the link in the terminal window.
5651

5752
## Debugging projects
58-
Debugging Python code is trivial, follow official documentation to figure out how to configure VSCode to enable that: https://code.visualstudio.com/docs/python/debugging
59-
Debugging C++ code requires GDB to be installed on your system.
60-
If you have a bq_sample_read.py python script that is using tensorflow-io library that is normally
61-
executed like:
53+
54+
Debugging Python code is trivial, follow official documentation to figure out how to configure VSCode to enable that: https://code.visualstudio.com/docs/python/debugging.
55+
56+
However, debugging C++ code requires [GDB](https://www.gnu.org/software/gdb/) to be installed on your system. If you have a `bq_sample_read.py` python script that uses `tensorflow-io` library and is normally executed in the follow manner:
57+
6258
```sh
6359
python3 bq_sample_read.py --gcp_project_id=...
6460
```
6561

66-
In order to execute it under GDB, run following:
62+
You can execute it under GDB using the following:
63+
6764
```sh
6865
gdb -ex r --args python3 bq_sample_read.py --gcp_project_id=...
6966
```
7067

71-
If application crashes in C++ code, you can run ```backtrace``` in GDB console to get stacktrace.
68+
If the application crashes in the C++ code phase, you can run ```backtrace``` in GDB console to get the stacktrace of the error.
7269

73-
VSCode also has GDB debugger support, it allows adding breakpoints, see values of variables and step through the code.
74-
To add debug configuration press the Debug View icon (Debug) on the Sidebar, or use the shortcut Ctrl+Shift+D. Here press the little down arrow next to the play button and select "Add Configuration...".
75-
It will create launch.json file, add following config here:
70+
VSCode also has GDB debugger support. It allows adding breakpoints, observe values of variables and step through the code in a step by step manner. To add debug configuration press the Debug View icon (Debug) on the Sidebar, or use the shortcut **Ctrl+Shift+D**. Here, press the little down arrow next to the play button and select "Add Configuration...". It will now create a `launch.json` file, to which, please add the following config:
7671

7772
```jsonc
7873
{
@@ -107,28 +102,29 @@ It will create launch.json file, add following config here:
107102
}
108103
```
109104

110-
If everything is configured correctly, you should be able to do Run -> Start Debugging (F5) or Run -> Run Without Debugging (Ctrl + F5). This will run your code under debugger:
105+
If everything is configured correctly, you should be able to do _Run -> Start Debugging_ (**F5**) or _Run -> Run Without Debugging_ (**Ctrl + F5**). This will run your code under debugger:
111106

112107
![VSCode debugger](./images/vscode_debugger.png)
113108

114-
One other thing worth doing to simplify debugging experience is configuting GDB to skip standard C++ libraries, so you don't step into code you don't care about. In order to do this, create ```~/.gdbinit``` file with following content:
109+
In order to further simplify the debugging experience, you can configure GDB to skip standard C++ libraries. This allows you to ignore the code that you don't care about. To do this, create a ```~/.gdbinit``` file with the following content:
110+
115111
```
116112
skip -gfi /usr/include/c++/*/*/*
117113
skip -gfi /usr/include/c++/*/*
118114
skip -gfi /usr/include/c++/*
119115
```
120116

121117
## Formatting files
122-
You can always reformat C++ or Python file by Right Click -> Format Document (Ctrl + Shift + I), but VSCode uses different style conention. Luckily it is easy to change.
118+
119+
You can always reformat C++ or Python file by _Right Click -> Format Document_ (**Ctrl + Shift + I**), but VSCode uses a different style convention. Luckily, it is easy to change.
123120

124121
For Python formatting, see https://donjayamanne.github.io/pythonVSCodeDocs/docs/formatting/
125122

126-
To configure C++ formatter, do following:
123+
For C++ formatting, do the following:
127124

128-
- Go Preferences -> Settings
129-
- Search C_Cpp.clang_format_fallbackStyle
130-
- Modify the file:setting.json directly
131-
- Add following
125+
- Go to _Preferences -> Settings_
126+
- Search for "C_Cpp.clang_format_fallbackStyle"
127+
- Modify the `file:setting.json` file directly by adding the following content
132128

133129
```
134130
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google}"

0 commit comments

Comments
 (0)