Skip to content

Commit 2399896

Browse files
committed
whitespace and format
1 parent 86b48ec commit 2399896

File tree

2 files changed

+80
-84
lines changed

2 files changed

+80
-84
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ docker build --build-arg BASE_TAG=base/bullseye --build-arg GIT_TAG=[...] -f etc
3737
```
3838

3939
This will use `base/bullseye` as a base to build the SDK version provided in `GIT_TAG`,
40-
which should be a tagged release version. The SDK will be cloned from
40+
which should be a tagged release version. The SDK will be cloned from
4141
https://github.com/viamrobotics/viam-cpp-sdk/. This is the recommended approach for
4242
C++ module development, which should generally be done against a tagged release.
4343

@@ -47,22 +47,22 @@ docker build --build-arg BASE_TAG=base/bullseye --build-arg REPO_SETUP=copy -f e
4747
```
4848

4949
Note the use of the build argument `REPO_SETUP=copy`, which adds a Docker instruction
50-
to copy the SDK repo from the current working directory, rather than cloning from
50+
to copy the SDK repo from the current working directory, rather than cloning from
5151
GitHub. This approach may make more sense for developing on the SDK itself, or if
5252
your C++ SDK development relies on a localversion of the SDK.
5353

5454
The examples above illustrated the use of several `--build-arg` arguments, namely
55-
`BASE_TAG`, `GIT_TAG`, and `REPO_SETUP`. Please see
55+
`BASE_TAG`, `GIT_TAG`, and `REPO_SETUP`. Please see
5656
[Dockerfile.sdk-build](etc/docker/Dockerfile.sdk-build) for a complete account of
5757
all build arguments and their defaults.
5858

5959
## Building Documentation Locally for Testing
6060
The C++ sdk uses [Doxygen](https://www.doxygen.nl/) to generate documentation.
6161
An automated workflow will generate and update our documentation on each merge,
62-
and publish it to [cpp.viam.dev](https://cpp.viam.dev).
62+
and publish it to [cpp.viam.dev](https://cpp.viam.dev).
6363

6464
Generating documentation locally to observe changes while developing with the
65-
C++ SDK is simple.
65+
C++ SDK is simple.
6666
First, make sure doxygen is installed, e.g.,
6767
```
6868
(on mac) brew install doxygen
@@ -91,10 +91,10 @@ quickly as possible.
9191
## A note on logging
9292

9393
Users should only interact with logging via the macros, classes, and functions in
94-
[`viam/sdk/log/logging.hpp`](src/viam/sdk/log/logging.hpp). Logging is
94+
[`viam/sdk/log/logging.hpp`](src/viam/sdk/log/logging.hpp). Logging is
9595
implemented using Boost.Log, but this is an implementation detail subject
9696
to change without warning. In particular, using Boost.Log macros such as
97-
`BOOST_LOG_TRIVIAL` or `BOOST_LOG_SEV` is undefined behavior which will likely
97+
`BOOST_LOG_TRIVIAL` or `BOOST_LOG_SEV` is undefined behavior which will likely
9898
fail to output log messages.
9999

100100
## License

src/viam/sdk/tests/test_mlmodel.cpp

Lines changed: 73 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -56,99 +56,95 @@ namespace {
5656
using namespace ::viam::sdk;
5757
using namespace ::viam::sdktests;
5858

59-
const struct MLModelService::metadata test_metadata {
59+
const struct MLModelService::metadata test_metadata{
6060
// `name`
6161
"my model",
6262

63-
// `type`
64-
"magic",
63+
// `type`
64+
"magic",
6565

66-
// `description`,
67-
"Convolutional neural network ...",
66+
// `description`,
67+
"Convolutional neural network ...",
6868

69-
// `inputs`
70-
{{
69+
// `inputs`
70+
{{
7171

72-
// `name`
73-
"input1",
72+
// `name`
73+
"input1",
7474

75-
// `description`
76-
"the first input",
75+
// `description`
76+
"the first input",
7777

78-
// `data_type`
79-
MLModelService::tensor_info::data_types::k_float32,
78+
// `data_type`
79+
MLModelService::tensor_info::data_types::k_float32,
8080

81-
// `shape`
82-
{640, 480, -1},
81+
// `shape`
82+
{640, 480, -1},
8383

84-
// `associated_files`
85-
{{// `name`
86-
"path/to/file1.1",
84+
// `associated_files`
85+
{{// `name`
86+
"path/to/file1.1",
8787

88-
// `description`
89-
"i1f1",
88+
// `description`
89+
"i1f1",
9090

91-
// `label_type`
92-
MLModelService::tensor_info::file::k_label_type_tensor_value},
93-
{"path/to/file1.2",
94-
"i1f2",
95-
MLModelService::tensor_info::file::k_label_type_tensor_axis}},
91+
// `label_type`
92+
MLModelService::tensor_info::file::k_label_type_tensor_value},
93+
{"path/to/file1.2", "i1f2", MLModelService::tensor_info::file::k_label_type_tensor_axis}},
9694

97-
// `extra`
98-
ProtoStruct{{"foo", ProtoValue{"bar"}}}},
95+
// `extra`
96+
ProtoStruct{{"foo", ProtoValue{"bar"}}}},
9997

100-
{"input2",
101-
"the second input",
102-
MLModelService::tensor_info::data_types::k_int32,
103-
{4096, 2160, 3, -1},
104-
{{"path/to/file2.1", "i2f1", MLModelService::tensor_info::file::k_label_type_tensor_axis},
105-
{"path/to/file2.2",
106-
"i2f2",
107-
MLModelService::tensor_info::file::k_label_type_tensor_value}},
108-
ProtoStruct{{"bar", ProtoValue{false}}}}},
98+
{"input2",
99+
"the second input",
100+
MLModelService::tensor_info::data_types::k_int32,
101+
{4096, 2160, 3, -1},
102+
{{"path/to/file2.1", "i2f1", MLModelService::tensor_info::file::k_label_type_tensor_axis},
103+
{"path/to/file2.2", "i2f2", MLModelService::tensor_info::file::k_label_type_tensor_value}},
104+
ProtoStruct{{"bar", ProtoValue{false}}}}},
109105

110-
// `outputs`
111-
{{
106+
// `outputs`
107+
{{
112108

113-
// `name`
114-
"output1",
109+
// `name`
110+
"output1",
115111

116-
// `description`
117-
"the first output",
112+
// `description`
113+
"the first output",
118114

119-
// `data_type`
120-
MLModelService::tensor_info::data_types::k_int32,
115+
// `data_type`
116+
MLModelService::tensor_info::data_types::k_int32,
121117

122-
// `shape`
123-
{-1, -1},
118+
// `shape`
119+
{-1, -1},
124120

125-
// `associated_files`
126-
{{// `name`
127-
"path/to/output_file1.1",
121+
// `associated_files`
122+
{{// `name`
123+
"path/to/output_file1.1",
128124

129-
// `description`
130-
"o1f1",
125+
// `description`
126+
"o1f1",
131127

132-
// `label_type`
133-
MLModelService::tensor_info::file::k_label_type_tensor_axis},
134-
{"path/to/output_file1.2",
135-
"o1f2",
136-
MLModelService::tensor_info::file::k_label_type_tensor_value}},
128+
// `label_type`
129+
MLModelService::tensor_info::file::k_label_type_tensor_axis},
130+
{"path/to/output_file1.2",
131+
"o1f2",
132+
MLModelService::tensor_info::file::k_label_type_tensor_value}},
137133

138-
// `extra`
139-
ProtoStruct{{"baz", ProtoValue{}}}},
134+
// `extra`
135+
ProtoStruct{{"baz", ProtoValue{}}}},
140136

141-
{"output2",
142-
"the second output",
143-
MLModelService::tensor_info::data_types::k_float32,
144-
{-1, -1, 4},
145-
{{"path/to/output_file2.1",
146-
"o2f1",
147-
MLModelService::tensor_info::file::k_label_type_tensor_axis},
148-
{"path/to/output_file2.2",
149-
"o2f2",
150-
MLModelService::tensor_info::file::k_label_type_tensor_value}},
151-
ProtoStruct{{"quux", ProtoValue{3.14}}}}},
137+
{"output2",
138+
"the second output",
139+
MLModelService::tensor_info::data_types::k_float32,
140+
{-1, -1, 4},
141+
{{"path/to/output_file2.1",
142+
"o2f1",
143+
MLModelService::tensor_info::file::k_label_type_tensor_axis},
144+
{"path/to/output_file2.2",
145+
"o2f2",
146+
MLModelService::tensor_info::file::k_label_type_tensor_value}},
147+
ProtoStruct{{"quux", ProtoValue{3.14}}}}},
152148
};
153149

154150
BOOST_AUTO_TEST_SUITE(test_mock_mlmodel)
@@ -306,7 +302,6 @@ BOOST_AUTO_TEST_CASE(mock_infer_grpc_roundtrip) {
306302

307303
BOOST_AUTO_TEST_SUITE_END()
308304

309-
310305
BOOST_AUTO_TEST_SUITE(test_mlmodel_bugfixes)
311306

312307
BOOST_AUTO_TEST_CASE(RSDK_10768) {
@@ -316,13 +311,14 @@ BOOST_AUTO_TEST_CASE(RSDK_10768) {
316311
"bar",
317312
"baz",
318313
// `inputs`
319-
{{"input",
320-
"the input",
321-
MLModelService::tensor_info::data_types::k_float32,
322-
{1},
323-
{},
324-
{}},
325-
},
314+
{
315+
{"input",
316+
"the input",
317+
MLModelService::tensor_info::data_types::k_float32,
318+
{1},
319+
{},
320+
{}},
321+
},
326322
// no `outputs`
327323
{}});
328324

0 commit comments

Comments
 (0)