Skip to content

Commit 93e7c0e

Browse files
committed
docs: using : syntax instead of :
1 parent c93272a commit 93e7c0e

File tree

7 files changed

+73
-66
lines changed

7 files changed

+73
-66
lines changed

doc/source/user_guide/source_code.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,21 @@ into account and added to the Python docstring:
146146
147147
Parameters
148148
----------
149-
nl1 : str
149+
nl1: str
150150
Number of the first line to be hit (touched by the end of the new line). If negative, assume ``P1`` (see below) is the second keypoint of the line instead of the first
151-
nl2 : str
151+
nl2: str
152152
Number of the second line to be hit. If negative, assume ``P3`` is the second keypoint of the line instead of the first.
153153
154-
ang1 : str
154+
ang1: str
155155
Angle of intersection (usually zero or 180) of generated line with tangent to first line.
156156
157-
ang2 : str
157+
ang2: str
158158
Angle of intersection (usually zero or 180) of generated line with tangent to second line.
159159
160-
phit1 : str
160+
phit1: str
161161
Number to be assigned to keypoint generated at hit location on first line (defaults to lowest available keypoint number ( :ref:`numstr` )).
162162
163-
phit2 : str
163+
phit2: str
164164
Number to be assigned to keypoint generated at hit location on second line (defaults to lowest available keypoint number ( :ref:`numstr` )).
165165
166166
Returns

src/pyconverter/xml2py/ast_tree.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,10 @@ class Argument:
21662166
"""Argument object."""
21672167

21682168
def __init__(
2169-
self, element: str | Element, initial_argument: List, description: Element | str | None = None
2169+
self,
2170+
element: str | Element,
2171+
initial_argument: List,
2172+
description: Element | str | None = None,
21702173
) -> None:
21712174
if description is None:
21722175
if isinstance(element[0], Term):
@@ -2371,7 +2374,11 @@ def to_py_docstring(
23712374
rst_description = self._description
23722375
else:
23732376
rst_description = self._description.to_rst(
2374-
indent=indent, max_length=max_length, links=links, base_url=base_url, fcache=fcache
2377+
indent=indent,
2378+
max_length=max_length,
2379+
links=links,
2380+
base_url=base_url,
2381+
fcache=fcache,
23752382
)
23762383
description_indent = " " * 4 + indent
23772384
if not "* " in rst_description:
@@ -2468,15 +2475,15 @@ def arg_desc(self) -> List[Argument]:
24682475
arguments = ArgumentList(elem, self.args)
24692476
else:
24702477
arguments += ArgumentList(elem, self.args)
2471-
2478+
24722479
if arguments is not None:
24732480
if len(arguments.py_arg_names) < len(arguments.initial_args):
24742481
for arg in arguments.initial_args:
24752482
if arg not in arguments.py_arg_names:
24762483
new_arg = Argument(arg, arguments.initial_args, "")
24772484
if new_arg.py_arg_name != "":
24782485
arguments.arguments.append(new_arg)
2479-
2486+
24802487
return arguments.arguments
24812488

24822489
else:

src/pyconverter/xml2py/custom_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_docstring_lists(filename: str) -> Tuple[list[str], list[str], list[str],
3131
3232
Parameters
3333
----------
34-
filename : str
34+
filename: str
3535
Path containing the Python file.
3636
3737
Returns

src/pyconverter/xml2py/directory_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ def get_paths(
6161
6262
Parameters
6363
----------
64-
path : Path
64+
path: Path
6565
Path object of the directory with the predefined format.
66-
graph_path : Path, optional
66+
graph_path: Path, optional
6767
Path object of the directory containing the graphics. The default is ``None``,
6868
in which case the XML predefined directory format is used.
69-
link_path : Path, optional
69+
link_path: Path, optional
7070
Path object of the directory containing the links. The default is ``None``,
7171
in which case the XML predefined directory format is used.
72-
term_path : Path, optional
72+
term_path: Path, optional
7373
Path object of the directory containing the terms. The default is ``None``,
7474
in which case the XML predefined directory format is used.
75-
xml_path : Path, optional
75+
xml_path: Path, optional
7676
Path object of the directory containing the XML files. The default is ``None``,
7777
in which case the XML predefined directory format is used.
7878

src/pyconverter/xml2py/load_xml_doc.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def load_links(link_path: Path) -> dict:
3737
3838
Parameters
3939
----------
40-
link_path : Path
40+
link_path: Path
4141
Path to the links directory.
4242
4343
Returns
@@ -85,7 +85,7 @@ def load_fcache(graph_path: Path) -> dict:
8585
8686
Parameters
8787
----------
88-
graph_path : Path
88+
graph_path: Path
8989
Path object of the graphic directory.
9090
9191
Returns
@@ -109,7 +109,7 @@ def load_docu_global(term_path: Path) -> dict:
109109
110110
Parameters
111111
----------
112-
term_path : Path
112+
term_path: Path
113113
Path object of the terms directory.
114114
115115
Returns
@@ -160,24 +160,24 @@ def load_terms(
160160
161161
Parameters
162162
----------
163-
term_path : Path
163+
term_path: Path
164164
Path object of the terms directory.
165-
docu_global : dict
165+
docu_global: dict
166166
Dictionary containing the entity names from the documentation and their path.
167-
links : dict
167+
links: dict
168168
Dictionary containing the link names and the needed information to render the links.
169-
fcache : dict
169+
fcache: dict
170170
Dictionary containing the base names of the graphics and their path.
171-
variable_file : str, optional
171+
variable_file: str, optional
172172
Name of the file containing the variable terms to import.
173173
The default value is ``"build_variables.ent"``.
174-
global_terms_file : str, optional
174+
global_terms_file: str, optional
175175
Name of the file containing the global terms to import.
176176
The default is ``"terms_global.ent"``.
177-
manual_file : str, optional
177+
manual_file: str, optional
178178
Name of the file containing the manual entities to import.
179179
The default is ``"manuals.ent"``.
180-
character_directory : str, optional
180+
character_directory: str, optional
181181
Name of the directory containg the entities for the special characters.
182182
The default is ``"ent"``.
183183

src/pyconverter/xml2py/utils/utils.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def parse_yaml(yaml_path: Path) -> dict:
3333
3434
Parameters
3535
----------
36-
yaml_path : Path
36+
yaml_path: Path
3737
Path object of the YAML file.
3838
3939
Returns
@@ -55,9 +55,9 @@ def get_config_data_value(yaml_path: Path, value: str) -> Union[str, dict, list,
5555
5656
Parameters
5757
----------
58-
yaml_path : Path
58+
yaml_path: Path
5959
Path object of the YAML file.
60-
value : str
60+
value: str
6161
Key to search for in the YAML file.
6262
"""
6363
config_data = parse_yaml(yaml_path)
@@ -70,9 +70,9 @@ def create_name_map(meta_command: list[str], yaml_file_path: Path) -> dict:
7070
7171
Parameters
7272
----------
73-
meta_command : list[str]
73+
meta_command: list[str]
7474
List of command names.
75-
yaml_file_path : Path
75+
yaml_file_path: Path
7676
Path object of the YAML file.
7777
7878
Returns
@@ -141,11 +141,11 @@ def import_handler(
141141
142142
Parameters
143143
----------
144-
filename : Path
144+
filename: Path
145145
Path object of the Python file.
146-
additional_content : str
146+
additional_content: str
147147
Additional content to add to the Python file.
148-
str_before_def : str
148+
str_before_def: str
149149
String before the function definition.
150150
"""
151151

@@ -177,7 +177,7 @@ def split_trail_alpha(text: str) -> Tuple[str, str]:
177177
178178
Parameters
179179
----------
180-
text : str
180+
text: str
181181
String to split.
182182
"""
183183
for ii, char in enumerate(text):
@@ -195,7 +195,7 @@ def is_numeric(text: str) -> bool:
195195
196196
Parameters
197197
----------
198-
text : str
198+
text: str
199199
String to check.
200200
201201
Returns
@@ -216,7 +216,7 @@ def get_refentry(filename: Path) -> list:
216216
217217
Parameters
218218
----------
219-
filename : Path
219+
filename: Path
220220
Path object of an XML file.
221221
"""
222222
root = fromstring(open(filename, "rb").read())

src/pyconverter/xml2py/writer.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def convert(directory_path):
5959
6060
Parameters
6161
----------
62-
directory_path : Path
62+
directory_path: Path
6363
Path to the directory containing the XML files to convert.
6464
6565
Returns
@@ -84,7 +84,7 @@ def load_commands(
8484
8585
Parameters
8686
----------
87-
xml_path : Path
87+
xml_path: Path
8888
Path object of the directory containing the XML files to convert.
8989
9090
Examples
@@ -159,7 +159,7 @@ def load_commands(
159159
name_map = create_name_map(meta_command, Path("config.yaml"))
160160
ast.NameMap(name_map)
161161

162-
# TODO : accept conversion of a single command
162+
# TODO: accept conversion of a single command
163163

164164
# convert a single command
165165
# if command is not None:
@@ -181,13 +181,13 @@ def copy_template_package(template_path: Path, new_package_path: Path, clean: bo
181181
182182
Parameters
183183
----------
184-
template_path : Path
184+
template_path: Path
185185
Path object containing the directory to copy.
186186
187-
new_package_path : Path
187+
new_package_path: Path
188188
Path object containing the directory where the new files and directorys are to be added.
189189
190-
clean : bool, optional
190+
clean: bool, optional
191191
Whether the directories in the path for the new package must be cleared before adding
192192
new files. The default value is ``False``.
193193
@@ -219,7 +219,7 @@ def write_global__init__file(library_path: Path) -> None:
219219
220220
Parameters
221221
----------
222-
library_path : Path
222+
library_path: Path
223223
Path object of the directory containing the generated package.
224224
"""
225225
mod_file = library_path / "__init__.py"
@@ -245,7 +245,7 @@ def write__init__file(library_path: Path) -> None:
245245
246246
Parameters
247247
----------
248-
library_path : Path
248+
library_path: Path
249249
Path object of the directory containing the generated package.
250250
"""
251251

@@ -273,9 +273,9 @@ def get_library_path(new_package_path: Path, config_path: Path) -> Path:
273273
274274
Parameters
275275
----------
276-
new_package_path : Path
276+
new_package_path: Path
277277
Path objecy of the new package directory.
278-
config_path : str
278+
config_path: str
279279
Path to the configuration file.
280280
281281
Returns
@@ -296,9 +296,9 @@ def get_module_info(library_path: Path, command: ast.XMLCommand) -> Tuple[str, s
296296
297297
Parameters
298298
----------
299-
library_path : Path
299+
library_path: Path
300300
Path object to the library directory.
301-
command : ast.XMLCommand
301+
command: ast.XMLCommand
302302
Command object.
303303
304304
Returns
@@ -323,9 +323,9 @@ def get_class_info(initial_class_name: str, module_path: Path) -> Tuple[str, str
323323
324324
Parameters
325325
----------
326-
initial_class_name : str
326+
initial_class_name: str
327327
Initial class name.
328-
module_path : Path
328+
module_path: Path
329329
Path object of the module directory.
330330
331331
Returns
@@ -360,28 +360,28 @@ def write_source(
360360
361361
Parameters
362362
----------
363-
command_map : dict
363+
command_map: dict
364364
Dictionary with the following format: ``{"initial_command_name": command_obj}``.
365-
name_map : dict
365+
name_map: dict
366366
Dictionary with the following format: ``{"initial_command_name": "python_name"}``.
367-
xml_doc_path : Path
367+
xml_doc_path: Path
368368
Path object containing the XML directory to convert.
369-
target_path : Path
369+
target_path: Path
370370
Path object to generate the new package to.
371-
path_custom_functions : Path, optional
371+
path_custom_functions: Path, optional
372372
Path object containing the customized functions. The default value is ``None``.
373-
template_path : Path, optional
373+
template_path: Path, optional
374374
Path object of the template to use. If no path is provided, the default template is used.
375-
config_path : Path, optional
375+
config_path: Path, optional
376376
Path object of the configuration file. The default value is ``Path(config.yaml)``.`.
377-
clean : bool, optional
377+
clean: bool, optional
378378
Whether the directories in the new package path must be cleared before adding
379379
new files. The default value is ``True``.
380-
structured : bool, optional
380+
structured: bool, optional
381381
Whether the package should be structured. The default value is ``True``.
382-
check_structure_map : bool, optional
382+
check_structure_map: bool, optional
383383
Whether the structure map must be checked. The default value is ``False``.
384-
check_files : bool, optional
384+
check_files: bool, optional
385385
Whether the files must be checked. The default value is ``False``.
386386
387387
Returns
@@ -518,12 +518,12 @@ def write_docs(
518518
519519
Parameters
520520
----------
521-
package_path : Path
521+
package_path: Path
522522
Path object of the new package folder.
523-
package_structure : dict, optional
523+
package_structure: dict, optional
524524
Dictionary with the following format:
525525
``{'python_module_name': [{'python_class_name': python_names_list}]}``.
526-
config_path : Path, optional
526+
config_path: Path, optional
527527
Path object of the configuration file. The default value is ``Path(config.yaml)``.
528528
529529
Returns

0 commit comments

Comments
 (0)