Skip to content

Commit

Permalink
Does this fix the docstring issue?
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 8, 2024
1 parent 347639a commit 0b5488a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
58 changes: 29 additions & 29 deletions lib/galaxy/tool_util/verify/assertion_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down Expand Up @@ -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."""

Expand Down Expand Up @@ -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"""

Expand Down Expand Up @@ -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"""

Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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, ``<has_n_columns n="3"/>``. The assertion tests only the first line.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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. ``<is_valid_xml />``)."""
r"""Asserts the output is a valid XML file (e.g. ``<is_valid_xml />``)."""

that: Literal["is_valid_xml"] = "is_valid_xml"

Expand All @@ -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.
Expand Down Expand Up @@ -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
<has_json_property_with_text property="color" text="red" />
Expand All @@ -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
<has_json_property_with_value property="skipped_columns" value="[1, 3, 5]" />
Expand All @@ -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
<has_h5_attribute key="nchroms" value="15" />
Expand All @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -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.,
Expand Down Expand Up @@ -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., ``<has_image_channels channels="3" />``).
Expand Down Expand Up @@ -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., ``<has_image_height height="512" delta="2" />``).
Alternatively the range of the expected height can be specified by ``min`` and/or ``max``."""
Expand Down Expand Up @@ -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., ``<has_image_mean_intensity mean_intensity="0.83" />``).
Alternatively the range of the expected mean intensity value can be specified by ``min`` and/or ``max``."""
Expand Down Expand Up @@ -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., ``<has_image_mean_object_size mean_object_size="111.87" exclude_labels="0" />``).
Expand Down Expand Up @@ -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.,
``<has_image_n_labels n="187" exclude_labels="0" />``).
Expand Down Expand Up @@ -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., ``<has_image_width width="512" delta="2" />``).
Alternatively the range of the expected width can be specified by ``min`` and/or ``max``."""
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/verify/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 0b5488a

Please sign in to comment.