From 0b5488a97f00b789958ca172815f43999469c63d Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 8 Sep 2024 19:34:38 -0400 Subject: [PATCH] Does this fix the docstring issue? --- .../tool_util/verify/assertion_models.py | 58 +++++++++---------- lib/galaxy/tool_util/verify/codegen.py | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/galaxy/tool_util/verify/assertion_models.py b/lib/galaxy/tool_util/verify/assertion_models.py index dc0d13912fd4..b669c81535c7 100644 --- a/lib/galaxy/tool_util/verify/assertion_models.py +++ b/lib/galaxy/tool_util/verify/assertion_models.py @@ -79,7 +79,7 @@ def check_non_negative_if_int(v: typing.Any): class has_line_model(AssertionModel): - """Asserts the specified output contains the line specified by the + r"""Asserts the specified output contains the line specified by the argument line. The exact number of occurrences can be optionally specified by the argument n""" @@ -148,7 +148,7 @@ class has_line_model(AssertionModel): class has_line_matching_model(AssertionModel): - """Asserts the specified output contains a line matching the + r"""Asserts the specified output contains a line matching the regular expression specified by the argument expression. If n is given the assertion checks for exactly n occurences.""" @@ -215,7 +215,7 @@ class has_line_matching_model(AssertionModel): class has_n_lines_model(AssertionModel): - """Asserts the specified output contains ``n`` lines allowing + r"""Asserts the specified output contains ``n`` lines allowing for a difference in the number of lines (delta) or relative differebce in the number of lines""" @@ -279,7 +279,7 @@ class has_n_lines_model(AssertionModel): class has_text_model(AssertionModel): - """Asserts specified output contains the substring specified by + r"""Asserts specified output contains the substring specified by the argument text. The exact number of occurrences can be optionally specified by the argument n""" @@ -348,7 +348,7 @@ class has_text_model(AssertionModel): class has_text_matching_model(AssertionModel): - """Asserts the specified output contains text matching the + r"""Asserts the specified output contains text matching the regular expression specified by the argument expression. If n is given the assertion checks for exacly n (nonoverlapping) occurences.""" @@ -406,7 +406,7 @@ class has_text_matching_model(AssertionModel): class not_has_text_model(AssertionModel): - """Asserts specified output does not contain the substring + r"""Asserts specified output does not contain the substring specified by the argument text""" that: Literal["not_has_text"] = "not_has_text" @@ -437,7 +437,7 @@ class not_has_text_model(AssertionModel): class has_n_columns_model(AssertionModel): - """Asserts tabular output contains the specified + r"""Asserts tabular output contains the specified number (``n``) of columns. For instance, ````. The assertion tests only the first line. @@ -512,7 +512,7 @@ class has_n_columns_model(AssertionModel): class attribute_is_model(AssertionModel): - """Asserts the XML ``attribute`` for the element (or tag) with the specified + r"""Asserts the XML ``attribute`` for the element (or tag) with the specified XPath-like ``path`` is the specified ``text``. For example: @@ -560,7 +560,7 @@ class attribute_is_model(AssertionModel): class attribute_matches_model(AssertionModel): - """Asserts the XML ``attribute`` for the element (or tag) with the specified + r"""Asserts the XML ``attribute`` for the element (or tag) with the specified XPath-like ``path`` matches the regular expression specified by ``expression``. For example: @@ -602,7 +602,7 @@ class attribute_matches_model(AssertionModel): class element_text_model(AssertionModel): - """This tag allows the developer to recurisively specify additional assertions as + r"""This tag allows the developer to recurisively specify additional assertions as child elements about just the text contained in the element specified by the XPath-like ``path``, e.g. @@ -642,7 +642,7 @@ class element_text_model(AssertionModel): class element_text_is_model(AssertionModel): - """Asserts the text of the XML element with the specified XPath-like ``path`` is + r"""Asserts the text of the XML element with the specified XPath-like ``path`` is the specified ``text``. For example: @@ -683,7 +683,7 @@ class element_text_is_model(AssertionModel): class element_text_matches_model(AssertionModel): - """Asserts the text of the XML element with the specified XPath-like ``path`` + r"""Asserts the text of the XML element with the specified XPath-like ``path`` matches the regular expression defined by ``expression``. For example: @@ -722,7 +722,7 @@ class element_text_matches_model(AssertionModel): class has_element_with_path_model(AssertionModel): - """Asserts the XML output contains at least one element (or tag) with the specified + r"""Asserts the XML output contains at least one element (or tag) with the specified XPath-like ``path``, e.g. ```xml @@ -766,7 +766,7 @@ class has_element_with_path_model(AssertionModel): class has_n_elements_with_path_model(AssertionModel): - """Asserts the XML output contains the specified number (``n``, optionally with ``delta``) of elements (or + r"""Asserts the XML output contains the specified number (``n``, optionally with ``delta``) of elements (or tags) with the specified XPath-like ``path``. For example: @@ -829,7 +829,7 @@ class has_n_elements_with_path_model(AssertionModel): class is_valid_xml_model(AssertionModel): - """Asserts the output is a valid XML file (e.g. ````).""" + r"""Asserts the output is a valid XML file (e.g. ````).""" that: Literal["is_valid_xml"] = "is_valid_xml" @@ -856,7 +856,7 @@ class is_valid_xml_model(AssertionModel): class xml_element_model(AssertionModel): - """Assert if the XML file contains element(s) or tag(s) with the specified + r"""Assert if the XML file contains element(s) or tag(s) with the specified [XPath-like ``path``](https://lxml.de/xpathxslt.html). If ``n`` and ``delta`` or ``min`` and ``max`` are given also the number of occurences is checked. @@ -955,7 +955,7 @@ class xml_element_model(AssertionModel): class has_json_property_with_text_model(AssertionModel): - """Asserts the JSON document contains a property or key with the specified text (i.e. string) value. + r"""Asserts the JSON document contains a property or key with the specified text (i.e. string) value. ```xml @@ -982,7 +982,7 @@ class has_json_property_with_text_model(AssertionModel): class has_json_property_with_value_model(AssertionModel): - """Asserts the JSON document contains a property or key with the specified JSON value. + r"""Asserts the JSON document contains a property or key with the specified JSON value. ```xml @@ -1007,7 +1007,7 @@ class has_json_property_with_value_model(AssertionModel): class has_h5_attribute_model(AssertionModel): - """Asserts HDF5 output contains the specified ``value`` for an attribute (``key``), e.g. + r"""Asserts HDF5 output contains the specified ``value`` for an attribute (``key``), e.g. ```xml @@ -1030,7 +1030,7 @@ class has_h5_attribute_model(AssertionModel): class has_h5_keys_model(AssertionModel): - """Asserts the specified HDF5 output has the given keys.""" + r"""Asserts the specified HDF5 output has the given keys.""" that: Literal["has_h5_keys"] = "has_h5_keys" @@ -1060,7 +1060,7 @@ class has_h5_keys_model(AssertionModel): class has_archive_member_model(AssertionModel): - """This tag allows to check if ``path`` is contained in a compressed file. + r"""This tag allows to check if ``path`` is contained in a compressed file. The path is a regular expression that is matched against the full paths of the objects in the compressed file (remember that "matching" means it is checked if a prefix of @@ -1177,7 +1177,7 @@ class has_archive_member_model(AssertionModel): class has_size_model(AssertionModel): - """Asserts the specified output has a size of the specified value + r"""Asserts the specified output has a size of the specified value Attributes size and value or synonyms though value is considered deprecated. The size optionally allows for absolute (``delta``) difference.""" @@ -1236,7 +1236,7 @@ class has_size_model(AssertionModel): class has_image_center_of_mass_model(AssertionModel): - """Asserts the specified output is an image and has the specified center of mass. + r"""Asserts the specified output is an image and has the specified center of mass. Asserts the output is an image and has a specific center of mass, or has an Euclidean distance of ``eps`` or less to that point (e.g., @@ -1272,7 +1272,7 @@ class has_image_center_of_mass_model(AssertionModel): class has_image_channels_model(AssertionModel): - """Asserts the output is an image and has a specific number of channels. + r"""Asserts the output is an image and has a specific number of channels. The number of channels is plus/minus ``delta`` (e.g., ````). @@ -1318,7 +1318,7 @@ class has_image_channels_model(AssertionModel): class has_image_height_model(AssertionModel): - """Asserts the output is an image and has a specific height (in pixels). + r"""Asserts the output is an image and has a specific height (in pixels). The height is plus/minus ``delta`` (e.g., ````). Alternatively the range of the expected height can be specified by ``min`` and/or ``max``.""" @@ -1363,7 +1363,7 @@ class has_image_height_model(AssertionModel): class has_image_mean_intensity_model(AssertionModel): - """Asserts the output is an image and has a specific mean intensity value. + r"""Asserts the output is an image and has a specific mean intensity value. The mean intensity value is plus/minus ``eps`` (e.g., ````). Alternatively the range of the expected mean intensity value can be specified by ``min`` and/or ``max``.""" @@ -1416,7 +1416,7 @@ class has_image_mean_intensity_model(AssertionModel): class has_image_mean_object_size_model(AssertionModel): - """Asserts the output is an image with labeled objects which have the specified mean size (number of pixels), + r"""Asserts the output is an image with labeled objects which have the specified mean size (number of pixels), The mean size is plus/minus ``eps`` (e.g., ````). @@ -1480,7 +1480,7 @@ class has_image_mean_object_size_model(AssertionModel): class has_image_n_labels_model(AssertionModel): - """Asserts the output is an image and has the specified labels. + r"""Asserts the output is an image and has the specified labels. Labels can be a number of labels or unique values (e.g., ````). @@ -1542,7 +1542,7 @@ class has_image_n_labels_model(AssertionModel): class has_image_width_model(AssertionModel): - """Asserts the output is an image and has a specific width (in pixels). + r"""Asserts the output is an image and has a specific width (in pixels). The width is plus/minus ``delta`` (e.g., ````). Alternatively the range of the expected width can be specified by ``min`` and/or ``max``.""" diff --git a/lib/galaxy/tool_util/verify/codegen.py b/lib/galaxy/tool_util/verify/codegen.py index 04aa397c04cb..493eff42b1e9 100644 --- a/lib/galaxy/tool_util/verify/codegen.py +++ b/lib/galaxy/tool_util/verify/codegen.py @@ -113,7 +113,7 @@ def check_non_negative_if_int(v: typing.Any): {% endfor %} class {{assertion.name}}_model(AssertionModel): - \"\"\"{{ assertion.docstring }}\"\"\" + r\"\"\"{{ assertion.docstring }}\"\"\" that: Literal["{{assertion.name}}"] = "{{assertion.name}}" {% for parameter in assertion.parameters %} {% if not parameter.is_deprecated %}