@@ -250,16 +250,16 @@ def test_command_documentation_default_exec_values_and_doc():
250
250
"""Test `CommandDocumentation.default_exec_values` and docs."""
251
251
252
252
doc = CommandDocumentation (func_no_args )
253
- assert "nodes" not in doc .default_exec_values
254
- assert "max_workers" not in doc .default_exec_values
255
- assert "nodes" not in doc .exec_control_doc
256
- assert "max_workers" not in doc .exec_control_doc
253
+ assert ": nodes: " not in doc .default_exec_values
254
+ assert ": max_workers: " not in doc .default_exec_values
255
+ assert ": nodes: " not in doc .exec_control_doc
256
+ assert ": max_workers: " not in doc .exec_control_doc
257
257
258
258
doc = CommandDocumentation (func_no_args , is_split_spatially = True )
259
259
assert doc .default_exec_values == DEFAULT_EXEC_VALUES
260
- assert "max_workers" not in doc .default_exec_values
261
- assert "nodes" in doc .exec_control_doc
262
- assert "max_workers" not in doc .exec_control_doc
260
+ assert ": max_workers: " not in doc .default_exec_values
261
+ assert ": nodes: " in doc .exec_control_doc
262
+ assert ": max_workers: " not in doc .exec_control_doc
263
263
264
264
265
265
def test_command_documentation_required_args ():
@@ -347,6 +347,34 @@ def func(project_points):
347
347
doc = CommandDocumentation (func , is_split_spatially = True )
348
348
param_help = doc .parameter_help
349
349
350
+ section_dividers = [
351
+ any (line ) and all (c == "-" for c in line )
352
+ for line in param_help .split ("\n " )
353
+ ]
354
+ assert sum (section_dividers ) == 1
355
+ assert "Parameters" in param_help
356
+ assert "project_points" in param_help
357
+ assert "Path to project points file." in param_help
358
+ assert "execution_control :" not in param_help
359
+ assert "log_directory :" not in param_help
360
+ assert "log_level :" not in param_help
361
+
362
+
363
+ def test_command_documentation_hpc_parameter_help ():
364
+ """Test `CommandDocumentation.hpc_parameter_help`."""
365
+
366
+ def func (project_points ):
367
+ """Test func.
368
+
369
+ Parameters
370
+ ----------
371
+ project_points : str
372
+ Path to project points file.
373
+ """
374
+
375
+ doc = CommandDocumentation (func , is_split_spatially = True )
376
+ param_help = doc .hpc_parameter_help
377
+
350
378
section_dividers = [
351
379
any (line ) and all (c == "-" for c in line )
352
380
for line in param_help .split ("\n " )
@@ -397,7 +425,7 @@ def test_command_documentation_config_help(monkeypatch):
397
425
398
426
assert "my_command_name" in config_help
399
427
assert (
400
- gaps .cli .documentation ._cli_formatted (doc .parameter_help )
428
+ gaps .cli .documentation ._cli_formatted (doc .hpc_parameter_help )
401
429
in config_help
402
430
)
403
431
assert ".. tabs::" in config_help
@@ -458,7 +486,7 @@ def _func2(another_param, d=42, e=None):
458
486
}
459
487
assert doc .template_config == expected_config
460
488
461
- docstring = doc .parameter_help
489
+ docstring = doc .hpc_parameter_help
462
490
assert "Max num workers" in docstring
463
491
assert "Path to project points." in docstring
464
492
assert "More input" in docstring
@@ -481,7 +509,7 @@ def _func(another_param, d=42, e=None):
481
509
)
482
510
assert len (doc .signatures ) == 1
483
511
484
- docstring = doc .parameter_help
512
+ docstring = doc .hpc_parameter_help
485
513
assert "Max num workers" not in docstring
486
514
assert "another_param :" not in docstring
487
515
assert "d :" not in docstring
@@ -491,7 +519,7 @@ def _func(another_param, d=42, e=None):
491
519
492
520
493
521
def test_command_documentation_for_class ():
494
- """Test `CommandDocumentation` with func missing docstring ."""
522
+ """Test `CommandDocumentation` for a mix of classes and functions ."""
495
523
496
524
class TestCommand :
497
525
"""A test command as a class."""
@@ -556,7 +584,7 @@ def preprocessor(another_input, _a_private_input, another_input2=None):
556
584
)
557
585
assert len (doc .signatures ) == 3
558
586
559
- docstring = doc .parameter_help
587
+ docstring = doc .hpc_parameter_help
560
588
assert ":max_workers:" in docstring
561
589
assert "\n arg1 :" in docstring
562
590
assert "\n arg2 :" in docstring
0 commit comments