Your message dated Tue, 3 Nov 2020 08:30:18 +0200
with message-id
<cam8zjqs5-5w3nziadveokfxzqqyrovhtx_uckzac-qqomhj...@mail.gmail.com>
and subject line ctdopts autopkg tests are failing, blocking python3-defaults
has caused the Debian Bug report #973013,
regarding ctdopts autopkg tests are failing, blocking python3-defaults
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
973013: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973013
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: src:ctdopts
Version: 1.4-1
Severity: serious
Tags: sid bullseye
User: debian-pyt...@lists.debian.org
Usertags: python3.9
autopkgtest [07:37:47]: test run-example: [-----------------------
+ py3versions -r
+ echo Testing with python3.9:
+ python3.9 -c import CTDopts; print(CTDopts)
Testing with python3.9:
<module 'CTDopts' from
'/tmp/autopkgtest-lxc.e7_px4dx/downtmp/build.CLh/src/CTDopts/__init__.py'>
+ python3.9 /usr/share/doc/python3-ctdopts/examples/example.py
Model being written to exampleTool.ctd...
Model loaded from exampleTool.ctd...
For debugging purposes we can output a human readable representation of
Parameter objects. Here's the first one:
PARAMETER positive_int
type: int
default: 5
tags: advanced, magic
restrictions on numeric range: 0 to None
description: A positive integer parameter
The following parameters were registered in the model:
['positive_int', 'input_files', 'output', 'this_that', 'param_1', 'param_2',
'param_3']
The same parameters with subgroup information, if they were registered under
parameter groups:
['positive_int', 'input_files', 'output', 'this_that', 'subparams:param_1',
'subparams:param_2', 'subparams:subsubparam:param_3']
A dictionary of parameters with default values, returned by
CTDModel.get_defaults():
{ 'positive_int': 5,
'subparams': { 'param_1': 5.5,
'param_2': [0.0, 2.5, 5.0],
'subsubparam': {'param_3': 2}},
'this_that': 'this'}
As you can see, parameter values are usually stored in nested dictionaries. If
you want a flat dictionary, you canget that using CTDopts.flatten_dict(). Flat
keys can be either tuples of tree node (subgroup) names down to the parameter...
{ ('positive_int',): 5,
('subparams', 'param_1'): 5.5,
('subparams', 'param_2'): [0.0, 2.5, 5.0],
('subparams', 'subsubparam', 'param_3'): 2,
('this_that',): 'this'}
...or they can be strings where nesing levels are separated by colons:
{ 'positive_int': 5,
'subparams:param_1': 5.5,
'subparams:param_2': [0.0, 2.5, 5.0],
'subparams:subsubparam:param_3': 2,
'this_that': 'this'}
We can create dictionaries of arguments on our own that we want to validate
against the model.CTDopts can read them from argument-storing CTD files or from
the command line, but we can just define them in a nested dictionary on our own
as well. We start with defining them explicitly.
{ 'input_files': ['file1.fastq', 'file2.fastq', 'file3.fastq'],
'positive_int': 111,
'subparams': {'param_1': '999.0'}}
We can validate these arguments against the model, and get a dictionary with
parameter types correctly casted and defaults set. Note that subparams:param_1
was casted from string to a floating point number because that's how it was
defined in the model.
{ 'input_files': ['file1.fastq', 'file2.fastq', 'file3.fastq'],
'positive_int': 111,
'subparams': { 'param_1': 999.0,
'param_2': [0.0, 2.5, 5.0],
'subsubparam': {'param_3': 2}},
'this_that': 'this'}
We can write a CTD file containing these validated argument values. Just call
CTDModel.write_ctd() with an extra parameter: the nested argument dictionary
containing the actual values.
As mentioned earlier, CTDopts can load argument values from CTD files. Feel free
to change some values in exampleTool_preset_params.ctd you've just written, and
load it back.
Traceback (most recent call last):
File "/usr/share/doc/python3-ctdopts/examples/example.py", line 165, in
<module>
args_from_ctd = args_from_file('exampleTool_preset_params.ctd')
File "/usr/lib/python3/dist-packages/CTDopts/CTDopts.py", line 1230, in
args_from_file
return get_args(parameters, base=None)
File "/usr/lib/python3/dist-packages/CTDopts/CTDopts.py", line 1211, in
get_args
get_args(child, current_group)
File "/usr/lib/python3/dist-packages/CTDopts/CTDopts.py", line 1224, in
get_args
if element.getchildren():
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute
'getchildren'
autopkgtest [07:37:47]: test run-example: -----------------------]
autopkgtest [07:37:47]: test run-example: - - - - - - - - - - results - - - - -
- - - - -
run-example FAIL non-zero exit status 1
autopkgtest [07:37:48]: @@@@@@@@@@@@@@@@@@@@ summary
run-example FAIL non-zero exit status 1
--- End Message ---
--- Begin Message ---
Version: 1.4-2
--- End Message ---