Skip to content

Commit

Permalink
Merge pull request #2 from breimanntools/ranking
Browse files Browse the repository at this point in the history
Ranking
  • Loading branch information
breimanntools authored Feb 13, 2024
2 parents 33b7524 + b83410a commit 5ab758b
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 74 deletions.
68 changes: 45 additions & 23 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,28 +288,27 @@ To generate the documentation locally:
Test with ChatGPT
=================
To optimize testing, use ChatGPT with the template below and fill in the blank spaces between ``START OF CODE``
and ``END OF CODE``. For testing templates,
utilize `our <https://github.com/breimanntools/xomics/blob/master/tests/unit/plotting_tests/test_plot_legend.py>`_
or any custom testing template.
and ``END OF CODE``. Examples of testing templates can be found here:
`our <https://github.com/breimanntools/xomics/blob/master/tests/unit/plotting_tests/test_plot_legend.py>`_.

.. code-block:: none
"
Generate test functions for a given TARGET FUNCTION using the style of the provided TESTING TEMPLATE.
Generate test functions for a given TARGET FUNCTION using the style of the provided TESTING TEMPLATE. Please take your time to ensure thoroughness and accuracy.
Inputs:
TARGET FUNCTION:
- START OF CODE
-------------------------------------
-----------------------------------------
[your code here]
-------------------------------------
-----------------------------------------
- END OF CODE
TESTING TEMPLATE:
- START OF CODE
-------------------------------------
your code
-------------------------------------
-----------------------------------------
[your code]
-----------------------------------------
- END OF CODE
**Key Directive**: For the Normal Cases Test Class, EACH function MUST test ONLY ONE individual parameter of the TARGET FUNCTION using Hypothesis for property-based testing. This is crucial.
Expand All @@ -329,29 +328,52 @@ or any custom testing template.
3. General Guidelines:
- Use Hypothesis for property-based testing, but test parameters individually for the Normal Cases Test Class .
- Tests should be clear, concise, and non-redundant.
- Do not leave any placeholders like "TODO", "Fill this", "Add ..." incomplete.
- Expose potential issues in the TARGET FUNCTION.
- Code must be complete, without placeholders like 'TODO', 'Fill this', or 'Add ...'.
- Explain potential issues in the TARGET FUNCTION.
Output Expectations:
- Two test classes: one for normal cases (individual parameters) and one for complex cases (combinations).
- In Normal Cases, one function = one parameter tested.
- Total: at least 30 unique tests, 150+ lines of code.
- Aim for at least 30 unique tests, totaling 150+ lines of code.
Reminder: In Normal Cases, it's crucial to test parameters individually.
Reminder: In Normal Cases, it's crucial to test parameters individually. Take your time and carefully create the Python code for all cases!
"
ChatGPT has a token limit, which may truncate responses. To continue, simply ask **continue processing** or something
similar. Repeat as necessary and compile the results. Once done, provide the script to ChatGPT for further refinement.
ChatGPT has a token limit, which may truncate responses. To continue, simply ask 'continue processing' or something
similar. Repeat as necessary and compile the results.

We recommend the following workflow:

1. Repeat the prompt in new ChatGPT sessions until most of the positive test cases are covered.
2. Adjust the testing script manually such that all positive tests are passed.
3. Continue in the same session, sharing the revised script, and request the creation of negative tests.
4. Finally, provide the complete testing script, including positive and negative cases, and request the development
of complex test cases

Test Guided Development (TGD)
-----------------------------
Leverage ChatGPT-provided testing scripts to refine your code and its interface. If ChatGPT struggles or produces
erroneous tests, it often indicates ambiguities or complexities in your function's naming or logic. Address these
insights to ensure intuitive and robust code design through the TGD approach. You can provide the complete function or
only its **signature & docstring**:
Leverage ChatGPT to generate testing scripts and refine your code's functionality and its interface. If ChatGPT
struggles or produces erroneous tests, it often indicates ambiguities or complexities in your function's logic,
variable naming, or documentation gaps, especially regarding edge cases. Address these insights to ensure intuitive
and robust code design through the TGD approach.

**Essential Strategies for Effective TGD**:

- **Isolated Functionality Testing**: Test one function or method at a time, adhering to unit testing principles.
Provide an entire and well-documented function. The better the docstring, the more comprehensive our automatically
generated tests will be.

- **Isolated Test Sessions**: Start each test scenario in a new ChatGPT session to maintain clarity and
prevent context overlap, ensuring focused and relevant test generation.

- **Consistent Template Usage**: Align your test creation with existing templates for similar functionalities,
utilizing them as a structured guide to maintain consistency in your test design.

- **Initial Test Baseline**: Aim for an initial set of tests where about 25% pass, providing a foundational baseline
that identifies primary areas for iterative improvement in both tests and code.

**Signature & Docstring**: Focus on interface testing by providing the function's signature and docstring,
aiming to ensure alignment with its external behavior and documentation.
- **Iterative Refinement and Simplification**: Use ChatGPT-generated tests to iteratively refine your code, especially
if repeated test failures indicate areas needing clarification or simplification in your function's design.

**Complete Function**: Submit the entire function code for deeper test generation, targeting comprehensive
coverage that accounts for internal logic and intricacies.
Through an iterative TGD process, you can systematically uncover and address any subtleties or complexities in your
code, paving the way for a more robust and user-friendly application.
68 changes: 45 additions & 23 deletions docs/source/index/CONTRIBUTING_COPY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,28 +288,27 @@ To generate the documentation locally:
Test with ChatGPT
=================
To optimize testing, use ChatGPT with the template below and fill in the blank spaces between ``START OF CODE``
and ``END OF CODE``. For testing templates,
utilize `our <https://github.com/breimanntools/xomics/blob/master/tests/unit/plotting_tests/test_plot_legend.py>`_
or any custom testing template.
and ``END OF CODE``. Examples of testing templates can be found here:
`our <https://github.com/breimanntools/xomics/blob/master/tests/unit/plotting_tests/test_plot_legend.py>`_.

.. code-block:: none
"
Generate test functions for a given TARGET FUNCTION using the style of the provided TESTING TEMPLATE.
Generate test functions for a given TARGET FUNCTION using the style of the provided TESTING TEMPLATE. Please take your time to ensure thoroughness and accuracy.
Inputs:
TARGET FUNCTION:
- START OF CODE
-------------------------------------
-----------------------------------------
[your code here]
-------------------------------------
-----------------------------------------
- END OF CODE
TESTING TEMPLATE:
- START OF CODE
-------------------------------------
your code
-------------------------------------
-----------------------------------------
[your code]
-----------------------------------------
- END OF CODE
**Key Directive**: For the Normal Cases Test Class, EACH function MUST test ONLY ONE individual parameter of the TARGET FUNCTION using Hypothesis for property-based testing. This is crucial.
Expand All @@ -329,29 +328,52 @@ or any custom testing template.
3. General Guidelines:
- Use Hypothesis for property-based testing, but test parameters individually for the Normal Cases Test Class .
- Tests should be clear, concise, and non-redundant.
- Do not leave any placeholders like "TODO", "Fill this", "Add ..." incomplete.
- Expose potential issues in the TARGET FUNCTION.
- Code must be complete, without placeholders like 'TODO', 'Fill this', or 'Add ...'.
- Explain potential issues in the TARGET FUNCTION.
Output Expectations:
- Two test classes: one for normal cases (individual parameters) and one for complex cases (combinations).
- In Normal Cases, one function = one parameter tested.
- Total: at least 30 unique tests, 150+ lines of code.
- Aim for at least 30 unique tests, totaling 150+ lines of code.
Reminder: In Normal Cases, it's crucial to test parameters individually.
Reminder: In Normal Cases, it's crucial to test parameters individually. Take your time and carefully create the Python code for all cases!
"
ChatGPT has a token limit, which may truncate responses. To continue, simply ask **continue processing** or something
similar. Repeat as necessary and compile the results. Once done, provide the script to ChatGPT for further refinement.
ChatGPT has a token limit, which may truncate responses. To continue, simply ask 'continue processing' or something
similar. Repeat as necessary and compile the results.

We recommend the following workflow:

1. Repeat the prompt in new ChatGPT sessions until most of the positive test cases are covered.
2. Adjust the testing script manually such that all positive tests are passed.
3. Continue in the same session, sharing the revised script, and request the creation of negative tests.
4. Finally, provide the complete testing script, including positive and negative cases, and request the development
of complex test cases

Test Guided Development (TGD)
-----------------------------
Leverage ChatGPT-provided testing scripts to refine your code and its interface. If ChatGPT struggles or produces
erroneous tests, it often indicates ambiguities or complexities in your function's naming or logic. Address these
insights to ensure intuitive and robust code design through the TGD approach. You can provide the complete function or
only its **signature & docstring**:
Leverage ChatGPT to generate testing scripts and refine your code's functionality and its interface. If ChatGPT
struggles or produces erroneous tests, it often indicates ambiguities or complexities in your function's logic,
variable naming, or documentation gaps, especially regarding edge cases. Address these insights to ensure intuitive
and robust code design through the TGD approach.

**Essential Strategies for Effective TGD**:

- **Isolated Functionality Testing**: Test one function or method at a time, adhering to unit testing principles.
Provide an entire and well-documented function. The better the docstring, the more comprehensive our automatically
generated tests will be.

- **Isolated Test Sessions**: Start each test scenario in a new ChatGPT session to maintain clarity and
prevent context overlap, ensuring focused and relevant test generation.

- **Consistent Template Usage**: Align your test creation with existing templates for similar functionalities,
utilizing them as a structured guide to maintain consistency in your test design.

- **Initial Test Baseline**: Aim for an initial set of tests where about 25% pass, providing a foundational baseline
that identifies primary areas for iterative improvement in both tests and code.

**Signature & Docstring**: Focus on interface testing by providing the function's signature and docstring,
aiming to ensure alignment with its external behavior and documentation.
- **Iterative Refinement and Simplification**: Use ChatGPT-generated tests to iteratively refine your code, especially
if repeated test failures indicate areas needing clarification or simplification in your function's design.

**Complete Function**: Submit the entire function code for deeper test generation, targeting comprehensive
coverage that accounts for internal logic and intricacies.
Through an iterative TGD process, you can systematically uncover and address any subtleties or complexities in your
code, paving the way for a more robust and user-friendly application.
28 changes: 0 additions & 28 deletions xomics/integration/_pintegrate.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
"""
This is a script for data integration (Clarissa Rienecker)
"""
import time
import pandas as pd
import numpy as np


# Settings
pd.set_option('expand_frame_repr', False) # Single line print for pd.Dataframe


# I Helper Functions


# II Main Functions


# III Test/Caller Functions


# IV Main
def main():
t0 = time.time()

t1 = time.time()
print("Time:", t1 - t0)


if __name__ == "__main__":
main()

0 comments on commit 5ab758b

Please sign in to comment.