[go: nahoru, domu]

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

Added Rename and Test Cases in DistanceMatrix Issue: #1959 #2025

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

code-wolf-byte
Copy link
Contributor

Added a rename function to the class DistanceMatrix as well as apt test cases for the function.

Please complete the following checklist:

[* ] I have read the contribution guidelines.

[* ] I have documented all public-facing changes in the changelog.

[* ] This pull request includes code, documentation, or other content derived from external source(s). If this is the case, ensure the external source's license is compatible with scikit-bio's license. Include the license in the licenses directory and add a comment in the code giving proper attribution. Ensure any other requirements set forth by the license and/or author are satisfied.

It is your responsibility to disclose code, documentation, or other content derived from external source(s). If you have questions about whether something can be included in the project or how to give proper attribution, include those questions in your pull request and a reviewer will assist you.
[* ] This pull request does not include code, documentation, or other content derived from external source(s).

Note: This document may also be helpful to see some of the things code reviewers will be verifying when reviewing your pull request.

Copy link
Contributor
@qiyunzhu qiyunzhu left a comment

Choose a reason for hiding this comment

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

@code-wolf-byte Good job!

The error in the test appears to be because rename returns a new instance of the distance matrix, but the example code doesn't indicate that.

Ideally, there should be two optional behaviors, controlled by an optional parameter inplace. When it is true, the method will rename IDs in place and doesn't return a value. When it is false, the method will return a new distance matrix with renamed IDs.

An example of such a method is pandas.DataFrame.rename. You can see how the API is like (also, instead of rename_dict they name it as mapper, which can take either a dictionary or a function).

@constellation99
Copy link
Contributor

Hi! Myself and @Bharath-Sathappan are actually also working on this issue and would be happy to share what we've implemented with you for our DistanceMatrix rename function as well as the test cases we've created. Additionally, we are working on the renaming function for OrdinationResults and are currently finishing up writing test cases.

@qiyunzhu
Copy link
Contributor

@constellation99 @Bharath-Sathappan Thanks for the offering! @code-wolf-byte do you have a plan to complete this PR in the near future? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants