<commit_before>.. _api:

API Documentation
-----------------
The primary method of using RSMTool is via the command-line scripts :ref:`rsmtool <usage_rsmtool>`, :ref:`rsmeval <usage_rsmeval>`, :ref:`rsmpredict <usage_rsmpredict>`, :ref:`rsmcompare <usage_rsmcompare>`, and :ref:`rsmsummarize <usage_rsmsummarize>`. However, there are certain functions in the ``rsmtool`` API that may also be useful to advanced users for use directly in their Python code. We document these functions below.

.. note::
    
     RSMTool v5.7 and older provided the API functions ``metrics_helper``, ``convert_ipynb_to_html``, and ``remove_outliers``. These functions have now been turned into static methods for different classes. If you are using these functions in your code and want to migrate to the new API, you should replace the follwing statements in your code:

    .. code-block:: python

        from rsmtool.analysis import metrics_helper
        metrics_helper(...)

        from rsmtool.report import convert_ipynb_to_html
        convert_ipynb_to_html(...)
        
        from rsmtool.preprocess import remove_outliers
        remove_outliers(...)

    with the following, respectively:

    .. code-block:: python

        from rsmtool.analyzer import Analyzer
        Analyzer.metrics_helper(...)

        from rsmtool.reporter import Reporter
        Reporter.convert_ipynb_to_html(...)
        
        from rsmtool.preprocessor import FeaturePreprocessor
        FeaturePreprocessor.remove_outliers(...)

:mod:`rsmtool` Package
======================

.. autofunction:: rsmtool.run_experiment
.. autofunction:: rsmtool.run_evaluation
.. autofunction:: rsmtool.run_comparison
.. autofunction:: rsmtool.run_summary
.. autofunction:: rsmtool.compute_and_save_predictions

From :py:mod:`~rsmtool.analyzer` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.analyzer
    :members:
    :undoc-members:
    :show-inheritance:

From :py:mod:`~rsmtool.comparer` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.comparer
    :members:
    :undoc-members:
    :show-inheritance:

From :py:mod:`~rsmtool.configuration_parser` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.configuration_parser
    :members:
    :undoc-members:
    :show-inheritance:

From :py:mod:`~rsmtool.container` Module<commit_msg>Exclude `deprecated_positional_argument()` method from autodoc.<commit_after>.. _api:

API Documentation
-----------------
The primary method of using RSMTool is via the command-line scripts :ref:`rsmtool <usage_rsmtool>`, :ref:`rsmeval <usage_rsmeval>`, :ref:`rsmpredict <usage_rsmpredict>`, :ref:`rsmcompare <usage_rsmcompare>`, and :ref:`rsmsummarize <usage_rsmsummarize>`. However, there are certain functions in the ``rsmtool`` API that may also be useful to advanced users for use directly in their Python code. We document these functions below.

.. note::
    
     RSMTool v5.7 and older provided the API functions ``metrics_helper``, ``convert_ipynb_to_html``, and ``remove_outliers``. These functions have now been turned into static methods for different classes. If you are using these functions in your code and want to migrate to the new API, you should replace the follwing statements in your code:

    .. code-block:: python

        from rsmtool.analysis import metrics_helper
        metrics_helper(...)

        from rsmtool.report import convert_ipynb_to_html
        convert_ipynb_to_html(...)
        
        from rsmtool.preprocess import remove_outliers
        remove_outliers(...)

    with the following, respectively:

    .. code-block:: python

        from rsmtool.analyzer import Analyzer
        Analyzer.metrics_helper(...)

        from rsmtool.reporter import Reporter
        Reporter.convert_ipynb_to_html(...)
        
        from rsmtool.preprocessor import FeaturePreprocessor
        FeaturePreprocessor.remove_outliers(...)

:mod:`rsmtool` Package
======================

.. autofunction:: rsmtool.run_experiment
.. autofunction:: rsmtool.run_evaluation
.. autofunction:: rsmtool.run_comparison
.. autofunction:: rsmtool.run_summary
.. autofunction:: rsmtool.compute_and_save_predictions

From :py:mod:`~rsmtool.analyzer` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.analyzer
    :members:
    :undoc-members:
    :show-inheritance:

From :py:mod:`~rsmtool.comparer` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.comparer
    :members:
    :undoc-members:
    :show-inheritance:

From :py:mod:`~rsmtool.configuration_parser` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: rsmtool.configuration_parser
    :members:
    :undoc-members:
    :show-inheritance:
    :exclude-members: deprecated_positional_argument

From :py:mod:`~rsmtool.container` Module
{'fraction_non_alphanumeric': 0.16113744075829384, 'fraction_numerical': 0.00082423243354626, 'mean_word_length': 3.988694758478931, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3454467', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1390, 'n_words': 371}