Skip to content

Comments

V2.x.unittest#70

Merged
leoguignard merged 9 commits intov2.xfrom
v2.x.unittest
May 16, 2025
Merged

V2.x.unittest#70
leoguignard merged 9 commits intov2.xfrom
v2.x.unittest

Conversation

@leoguignard
Copy link
Member

Adding unit testing via pytest.
That covers roughly 60% of the lineage tree code.
They are coverages that are as simple as possible, not on purpose but rather by kind of lazyness but with the goal of improving that little by little.

Finally, from now on, tests will be ran automatically after each push. That means: do not push borken things

- Simplified the GitHub Actions workflow by removing unnecessary triggers and matrix strategy.
- Updated the test file to include additional test cases for spatial edges, ancestor retrieval, and tree edit distances.
- Improved code readability and consistency in the lineageTree class methods.
- Implemented a new test suite for lineageTree in test_lineageTree.py, covering various functionalities including reading from XML, adding/removing nodes, time resolution, loading, cross-comparison, and plotting.
- Added tests for edge cases and error handling in lineageTree methods.
- Created a separate test suite for Zhang edit distance in test_uted.py, reproducing results from Guignard et al. (2020) and validating the implementation against known cases.
- Included tests for local cost functions and normalized edit distances for specific tree structures.
@leoguignard leoguignard requested review from BadPrograms and ChrisMzz and removed request for ChrisMzz May 16, 2025 13:18
- Consolidated import statements for clarity and removed the try-except block for `uted` import.
- Removed commented-out code related to node positioning in the `_add_node` method.
- Updated warning message formatting in the `set_time` method for consistency.
- Minor adjustments to maintain code readability and organization.
@codecov
Copy link

codecov bot commented May 16, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Contributor

@ChrisMzz ChrisMzz left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Little side note : I tried testing in an environment with Python 3.12.9 and a single test fails at line 486 lT1.plot_all_lineages(), seems to be a known 3.13.0 bug but I didn't expect to see it in a 3.12 version.
In 3.13.2, all checks pass.

@leoguignard
Copy link
Member Author

Looks good to me.

Little side note : I tried testing in an environment with Python 3.12.9 and a single test fails at line 486 lT1.plot_all_lineages(), seems to be a known 3.13.0 bug but I didn't expect to see it in a 3.12 version. In 3.13.2, all checks pass.

Also seems like it's windows specific error?

@leoguignard
Copy link
Member Author

few notes by the way, I moved the tests such they are in src/LineageTree/test

@leoguignard leoguignard merged commit d61fbfe into v2.x May 16, 2025
3 checks passed
@ChrisMzz
Copy link
Contributor

ChrisMzz commented May 16, 2025

Also seems like it's windows specific error?

Yeah, I've had a similar error when 3.13.0 came out, but I hope it won't be a problem for Windows users on 3.12.x versions?

I'm not sure I remember testing this on older versions of LineageTree with 3.12

@leoguignard leoguignard deleted the v2.x.unittest branch May 16, 2025 14:02
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.

2 participants