@@ -74,6 +74,8 @@ def read_namespace(
7474 print_output_handler : PrintOutputHandler | None = None ,
7575 allow_unregulated_fixed_port_id : bool = False ,
7676 allow_root_namespace_name_collision : bool = True ,
77+ * ,
78+ strict : bool = False ,
7779) -> list [_serializable .CompositeType ]:
7880 """
7981 This function is a main entry point for the library.
@@ -103,6 +105,8 @@ def read_namespace(
103105 the same root namespace name multiple times in the lookup dirs. This will enable defining a namespace
104106 partially and let other entities define new messages or new sub-namespaces in the same root namespace.
105107
108+ :param strict: Reject features that are not [yet] part of the Cyphal Specification.
109+
106110 :return: A list of :class:`pydsdl.CompositeType` found under the `root_namespace_directory` and sorted
107111 lexicographically by full data type name, then by major version (newest version first), then by minor
108112 version (newest version first). The ordering guarantee allows the caller to always find the newest version
@@ -131,7 +135,11 @@ def read_namespace(
131135 _logger .debug (_LOG_LIST_ITEM_PREFIX + str (x ))
132136
133137 return _complete_read_function (
134- target_dsdl_definitions , lookup_directories_path_list , print_output_handler , allow_unregulated_fixed_port_id
138+ target_dsdl_definitions ,
139+ lookup_directories_path_list ,
140+ print_output_handler ,
141+ allow_unregulated_fixed_port_id = allow_unregulated_fixed_port_id ,
142+ strict = strict ,
135143 ).direct
136144
137145
@@ -142,6 +150,8 @@ def read_files(
142150 lookup_directories : None | Path | str | Iterable [Path | str ] = None ,
143151 print_output_handler : PrintOutputHandler | None = None ,
144152 allow_unregulated_fixed_port_id : bool = False ,
153+ * ,
154+ strict : bool = False ,
145155) -> tuple [list [_serializable .CompositeType ], list [_serializable .CompositeType ]]:
146156 """
147157 This function is a main entry point for the library.
@@ -232,6 +242,8 @@ def read_files(
232242 This is a dangerous feature that must not be used unless you understand the risks.
233243 Please read https://opencyphal.org/guide.
234244
245+ :param strict: Reject features that are not [yet] part of the Cyphal Specification.
246+
235247 :return: A Tuple of lists of :class:`pydsdl.CompositeType`. The first index in the Tuple are the types parsed from
236248 the ``dsdl_files`` argument. The second index are types that the target ``dsdl_files`` utilizes.
237249 A note for using these values to describe build dependencies: each :class:`pydsdl.CompositeType` has two
@@ -266,9 +278,12 @@ def read_files(
266278 )
267279
268280 definitions = _complete_read_function (
269- target_dsdl_definitions , lookup_directories_path_list , print_output_handler , allow_unregulated_fixed_port_id
281+ target_dsdl_definitions ,
282+ lookup_directories_path_list ,
283+ print_output_handler ,
284+ allow_unregulated_fixed_port_id = allow_unregulated_fixed_port_id ,
285+ strict = strict ,
270286 )
271-
272287 return (definitions .direct , definitions .transitive )
273288
274289
@@ -286,7 +301,9 @@ def _complete_read_function(
286301 target_dsdl_definitions : SortedFileList [ReadableDSDLFile ],
287302 lookup_directories_path_list : list [Path ],
288303 print_output_handler : PrintOutputHandler | None ,
304+ * ,
289305 allow_unregulated_fixed_port_id : bool ,
306+ strict : bool ,
290307) -> DSDLDefinitions :
291308
292309 lookup_dsdl_definitions = _construct_dsdl_definitions_from_namespaces (lookup_directories_path_list )
@@ -307,7 +324,11 @@ def _complete_read_function(
307324 # This is the biggie. All the rest of the wrangling is just to get to this point. This will take the
308325 # most time and memory.
309326 definitions = read_definitions (
310- target_dsdl_definitions , lookup_dsdl_definitions , print_output_handler , allow_unregulated_fixed_port_id
327+ target_dsdl_definitions ,
328+ lookup_dsdl_definitions ,
329+ print_output_handler ,
330+ allow_unregulated_fixed_port_id = allow_unregulated_fixed_port_id ,
331+ strict = strict ,
311332 )
312333
313334 # Note that we check for collisions in the read namespace only.
0 commit comments