Skip to content

doctest failures #93

@rekado

Description

@rekado

When running pytest I get these doctest failures:

________________ [doctest] flexynesis.data.read_stringdb_links _________________
807             value format with a header row, and at least the columns 'protein1', 'protein2', and 'combined_score'.
808         top_neighbors (int, optional): The number of top interactions to return for each protein. Defaults to 5.
809 
810     Returns:
811         pd.DataFrame: A DataFrame with columns 'protein1' and 'protein2' representing the top interactions
812             for each protein. Each protein and partner identifier is simplified by stripping to the last
813             element after splitting by ".".
814 
815     Example:
816         >>> read_stringdb_links('string_interactions.txt', top_neighbors=3)
UNEXPECTED EXCEPTION: FileNotFoundError(2, 'No such file or directory')
Traceback (most recent call last):
  File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest flexynesis.data.read_stringdb_links[0]>", line 1, in <module>
  File "/tmp/guix-build-flexynesis-0.2.10.drv-0/source/flexynesis/data.py", line 820, in read_stringdb_links
    df = pd.read_csv(fname, header=0, sep=" ")
  File "/gnu/store/imagx3cs7qzbh1ys54gskn0szgdmszxj-python-pandas-2.1.1/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 948, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/gnu/store/imagx3cs7qzbh1ys54gskn0szgdmszxj-python-pandas-2.1.1/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 611, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/gnu/store/imagx3cs7qzbh1ys54gskn0szgdmszxj-python-pandas-2.1.1/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 1448, in __init__
    self._engine = self._make_engine(f, self.engine)
  File "/gnu/store/imagx3cs7qzbh1ys54gskn0szgdmszxj-python-pandas-2.1.1/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 1705, in _make_engine
    self.handles = get_handle(
  File "/gnu/store/imagx3cs7qzbh1ys54gskn0szgdmszxj-python-pandas-2.1.1/lib/python3.10/site-packages/pandas/io/common.py", line 863, in get_handle
    handle = open(
FileNotFoundError: [Errno 2] No such file or directory: 'string_interactions.txt'
/tmp/guix-build-flexynesis-0.2.10.drv-0/source/flexynesis/data.py:816: UnexpectedException
_____________________ [doctest] flexynesis.modules.flexGCN _____________________
169                               'GAT' for Graph Attention Network, 'SAGE' for GraphSAGE, and 'GC' for generic Graph Convolution. 
170                               Defaults to 'GC'.
171         act (str, optional): Type of activation function to use. Supported types include 'relu', 'sigmoid', 
172                              'leakyrelu', 'tanh', and 'gelu'. Defaults to 'relu'.
173 
174     Raises:
175         ValueError: If an unsupported activation function or convolution type is specified.
176 
177     Example:
178         >>> model = flexGCN(node_count=100, node_feature_count=5, node_embedding_dim=64, output_dim=10, 
UNEXPECTED EXCEPTION: SyntaxError("'(' was never closed", ('<doctest flexynesis.modules.flexGCN[0]>', 1, 16, 'model = flexGCN(node_count=100, node_feature_count=5, node_embedding_dim=64, output_dim=10, \n', 1, 0))
Traceback (most recent call last):
  File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest flexynesis.modules.flexGCN[0]>", line 1
    model = flexGCN(node_count=100, node_feature_count=5, node_embedding_dim=64, output_dim=10, 
                   ^
SyntaxError: '(' was never closed
/tmp/guix-build-flexynesis-0.2.10.drv-0/source/flexynesis/modules.py:178: UnexpectedException

If these are not valid doctests then pytest should be configured to skip them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions