Skip to content

Commit

Permalink
API.rst bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
longxf21 committed May 26, 2024
1 parent 67dbff8 commit 4685fc2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
42 changes: 17 additions & 25 deletions docs/source/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Analyzer
:undoc-members:
:show-inheritance:

.. method:: check_model(model_str: str, rate_law_classifications_path: str=None, abort_on_complicated_rate_laws: bool=True, excluded_codes: List[int]=[])
.. automethod:: check_model(model_str: str, rate_law_classifications_path: str=None, abort_on_complicated_rate_laws: bool=True, excluded_codes: List[int]=[])

Checks the SBML model for rate law errors and warnings.

Expand All @@ -24,15 +24,15 @@ Analyzer

The results of the checks as a result object, can be printed or converted to string.

.. method:: list_all_checks()
.. automethod:: list_all_checks()

Returns a string representation of all the checks.

**Returns:**

A string listing all error and warning checks.

.. method:: list_check(code: int)
.. automethod:: list_check(code: int)

Returns a string representation of the check corresponding to the provided code.

Expand All @@ -44,7 +44,7 @@ Analyzer

A string describing the check corresponding to the provided code.

.. method:: __init__(model_str: str, rate_law_classifications_path: str=None, abort_on_complicated_rate_laws: bool=True)
.. automethod:: __init__(model_str: str, rate_law_classifications_path: str=None, abort_on_complicated_rate_laws: bool=True)

Initializes the Analyzer class.

Expand All @@ -65,7 +65,7 @@ Analyzer
print(str(results))
str(results)

.. method:: check_except(excluded_codes: Optional[List[int]]=[])
.. automethod:: check_except(excluded_codes: Optional[List[int]]=[])

Performs all checks except the ones corresponding to the provided list of error or warning codes.

Expand All @@ -77,15 +77,15 @@ Analyzer

The results of the check(s) to self.results.

.. method:: check_all()
.. automethod:: check_all()

Performs all checks.

**Updates:**

The results of the check_all to self.results.

.. method:: checks(codes: List[int])
.. automethod:: checks(codes: List[int])

Performs multiple checks based on the provided list of error or warning codes. If no codes are provided, all checks are performed.

Expand All @@ -105,11 +105,11 @@ Results
:undoc-members:
:show-inheritance:

.. method:: __init__()
.. automethod:: __init__()

Initializes the Results class.

.. method:: add_message(reaction_name: str, code: int, message: str, is_warning=True)
.. automethod:: add_message(reaction_name: str, code: int, message: str, is_warning=True)

Adds a new result to the results list.

Expand All @@ -120,27 +120,27 @@ Results
- **message** (*str*): The message to be added.
- **is_warning** (*bool*): If the message is a warning message.

.. method:: clear_results()
.. automethod:: clear_results()

Clears all results from the results list.

.. method:: get_all_warnings()
.. automethod:: get_all_warnings()

Returns all the warnings as a list of strings.

**Returns:**

A list of warnings.

.. method:: get_all_errors()
.. automethod:: get_all_errors()

Returns all the errors.

**Returns:**

A list of errors.

.. method:: get_messages_by_reaction(reaction_name: str)
.. automethod:: get_messages_by_reaction(reaction_name: str)

Returns all the messages for a specific reaction.

Expand All @@ -152,42 +152,34 @@ Results

A list of messages for the specified reaction.

.. method:: remove_messages_by_reaction(reaction_name: str)
.. automethod:: remove_messages_by_reaction(reaction_name: str)

Removes all the messages for a specific reaction.

**Parameters:**

- **reaction_name** (*str*): Name of the reaction.

.. method:: count_messages()
.. automethod:: count_messages()

Returns the total number of errors and warnings.

**Returns:**

The total count of errors and warnings.

.. method:: count_errors()
.. automethod:: count_errors()

Returns the total number of errors.

**Returns:**

The total count of errors.

.. method:: count_warnings()
.. automethod:: count_warnings()

Returns the total number of warnings.

**Returns:**

The total count of warnings.

.. method:: __repr__()

Overrides the __repr__ method.

**Returns:**

str: A string representation of the results.
5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
]

napoleon_google_docstring = True
napoleon_numpy_docstring = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down

0 comments on commit 4685fc2

Please sign in to comment.