Skip to content

Commit 0617e1a

Browse files
Arm backend: Make get_output_format private
Rename `get_output_format()` to `_get_output_format()` and update internal callers so it is no longer exposed in generated docs. Change-Id: I2a58173b497d54254b086b41f719c05a23ad3c54 Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
1 parent e42adf6 commit 0617e1a

8 files changed

Lines changed: 12 additions & 22 deletions

File tree

backends/arm/common/arm_compile_spec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ def from_list(cls, compile_specs: list[CompileSpec]): # noqa: C901
117117
raise ValueError("No tosa_spec in compile spec.")
118118
if output_format is None:
119119
raise ValueError("No output_format in compile spec.")
120-
if output_format != cls.get_output_format():
120+
if output_format != cls._get_output_format():
121121
raise ValueError(
122-
f"Incorrect output format '{output_format}' for {cls.__name__}, expected '{cls.get_output_format()}'"
122+
f"Incorrect output format '{output_format}' for {cls.__name__}, expected '{cls._get_output_format()}'"
123123
)
124124
if compiler_flags is None:
125125
compiler_flags = []
@@ -170,7 +170,7 @@ def to_list(self):
170170
# Add output format to identify kind of compile spec.
171171
compile_spec.append(
172172
CompileSpec(
173-
ArmCompileSpec._OUTPUT_FORMAT_KEY, self.get_output_format().encode()
173+
ArmCompileSpec._OUTPUT_FORMAT_KEY, self._get_output_format().encode()
174174
)
175175
)
176176

@@ -285,5 +285,5 @@ def get_output_order_workaround(self) -> bool:
285285

286286
@classmethod
287287
@abstractmethod
288-
def get_output_format(cls) -> str:
288+
def _get_output_format(cls) -> str:
289289
"""Returns a constant string that is the output format of the class."""

backends/arm/ethosu/compile_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _validate(self):
144144
)
145145

146146
@classmethod
147-
def get_output_format(cls) -> str:
147+
def _get_output_format(cls) -> str:
148148
"""Return the artifact format emitted by this compile spec."""
149149
return "vela"
150150

backends/arm/test/tester/arm_tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ def _get_tosa_operator_distribution(
12261226
raise NotImplementedError("Can not get operator distribution for VGF.")
12271227
else:
12281228
raise NotImplementedError(
1229-
f"Unknown output format '{compile_spec.get_output_format()}'."
1229+
f"Unknown output format '{compile_spec._get_output_format()}'."
12301230
)
12311231
id += 1
12321232
if id == 0:

backends/arm/tosa/compile_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _validate(self):
3434
pass
3535

3636
@classmethod
37-
def get_output_format(cls) -> str:
37+
def _get_output_format(cls) -> str:
3838
"""Return the artifact format emitted by this compile spec."""
3939
return "tosa"
4040

backends/arm/util/_factory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 Arm Limited and/or its affiliates.
1+
# Copyright 2025-2026 Arm Limited and/or its affiliates.
22
#
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
@@ -25,11 +25,11 @@ def parse_compile_spec(compile_specs: list[CompileSpec]) -> ArmCompileSpec:
2525
break
2626
else:
2727
raise ValueError("Compile spec without output format.")
28-
if output_format == TosaCompileSpec.get_output_format():
28+
if output_format == TosaCompileSpec._get_output_format():
2929
return TosaCompileSpec.from_list(compile_specs)
30-
if output_format == EthosUCompileSpec.get_output_format():
30+
if output_format == EthosUCompileSpec._get_output_format():
3131
return EthosUCompileSpec.from_list(compile_specs)
32-
if output_format == VgfCompileSpec.get_output_format():
32+
if output_format == VgfCompileSpec._get_output_format():
3333
return VgfCompileSpec.from_list(compile_specs)
3434
raise ValueError(f"Unknown output format {output_format}")
3535

backends/arm/vgf/compile_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _validate(self):
6363
)
6464

6565
@classmethod
66-
def get_output_format(cls) -> str:
66+
def _get_output_format(cls) -> str:
6767
"""Return the artifact format emitted by this compile spec."""
6868
return "vgf"
6969

docs/source/backends/arm-ethos-u/arm-ethos-u-overview.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ pte.
8282
Returns:
8383
Path where intermediate results are saved.
8484

85-
```python
86-
def EthosUCompileSpec.get_output_format() -> str:
87-
```
88-
Return the artifact format emitted by this compile spec.
89-
9085
```python
9186
def EthosUCompileSpec.get_output_order_workaround(self) -> bool:
9287
```

docs/source/backends/arm-vgf/arm-vgf-overview.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ pte.
7373
Returns:
7474
Path where intermediate results are saved.
7575

76-
```python
77-
def VgfCompileSpec.get_output_format() -> str:
78-
```
79-
Return the artifact format emitted by this compile spec.
80-
8176
```python
8277
def VgfCompileSpec.get_output_order_workaround(self) -> bool:
8378
```

0 commit comments

Comments
 (0)