Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate function #120

Merged
merged 4 commits into from Feb 27, 2023
Merged

Remove duplicate function #120

merged 4 commits into from Feb 27, 2023

Conversation

scorcism
Copy link
Contributor

[BUG] Remove duplicate function in classification/tests/test_base.py #119

Reference Issues/PRs

Fixes #119 [BUG] Remove duplicate function in classification/tests/test_base.py

What does this implement/fix? Explain your changes.

Removed a duplicate function inside classification/tests/test_base.py

Does your contribution introduce a new dependency? If yes, which one?

No

For all contributions
  • I've added myself to the list of contributors.
  • Optionally, I've updated sktime's CODEOWNERS to receive notifications about future changes to these files.
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG] indicating whether the PR topic is related to enhancement, maintenance, documentation, or bug.

[BUG] Remove duplicate function in classification/tests/test_base.py aeon-toolkit#119
@scorcism
Copy link
Contributor Author

I don't know why this gave so many failed test results :(

Copy link
Contributor

@TonyBagnall TonyBagnall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, you will need to change the calls to _create_nested_dataframe too
test_X3 = _create_nested_dataframe(5, 1, 10)
test_X4 = _create_nested_dataframe(5, 3, 10)

@TonyBagnall
Copy link
Contributor

TonyBagnall commented Feb 27, 2023

if you look here
https://github.com/scikit-time/scikit-time/actions/runs/4281029339/jobs/7453646558
it gives indication as to why it failed

@scorcism
Copy link
Contributor Author

Hey @TonyBagnall, The functions which are duplicate have different names and i removed the function which text_X3 and test_X4 uses : https://imgur.com/HHwMhr6.png

@scorcism
Copy link
Contributor Author

scorcism commented Feb 27, 2023

I have to make

def _create_example_dataframe(cases=5, dimensions=1, length=10):
    """Create a simple data frame set of time series (X) for testing."""
    test_X = pd.DataFrame(dtype=np.float32)
    for i in range(0, dimensions):
        instance_list = []
        for _ in range(0, cases):
            instance_list.append(pd.Series(np.random.randn(length)))
        test_X["dimension_" + str(i)] = instance_list
    return test_X

To

def _create_nested_dataframe(cases=5, dimensions=1, length=10):
    """Create a simple data frame set of time series (X) for testing."""
    test_X = pd.DataFrame(dtype=np.float32)
    for i in range(0, dimensions):
        instance_list = []
        for _ in range(0, cases):
            instance_list.append(pd.Series(np.random.randn(length)))
        test_X["dimension_" + str(i)] = instance_list
    return test_X

@scorcism
Copy link
Contributor Author

I have made the changes

Remove duplicate function
@TonyBagnall
Copy link
Contributor

you need to keep _create_example_dataframe, delete _create_nested_dataframe and then change the calls to _create_nested_dataframe so that _create_example_dataframe is called instead.

@scorcism
Copy link
Contributor Author

scorcism commented Feb 27, 2023

so, basically I have to change calls for _create_nested_dataframe to _create_example_dataframe
and use _create_example_dataframe
Sorry for all this confusions :)

@MatthewMiddlehurst MatthewMiddlehurst added the maintenance Continuous integration, unit testing & package distribution label Feb 27, 2023
@TonyBagnall TonyBagnall merged commit 9b480f9 into aeon-toolkit:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Continuous integration, unit testing & package distribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Remove duplicate function in classification/tests/test_base.py
3 participants