-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adds unit-tests for dnatracing methods #593
Conversation
Also removes unused functions from dnatracing
|
||
plt.plot(coordinates_array[:, 0], coordinates_array[:, 1], "ko") | ||
plt.savefig(f"{savename}_{dna_num}_coordinates.png") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ns-rse , would it be worth keeping writeCoordinates? I think it's fine to remove writeContourLengths given that we already have contour lengths in the all_statistics.csv
spreadsheet, but do we have the coordinates printed out anywhere else? If not, it might be worth keeping it and producing it alongside other future tracing outputs when toggled on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it as its not used anywhere in the code as far as I can tell.
If writing co-ordinates is something that is required it should be a function within the topostats.io
module which handles input/output and imported where required.
As it stands this method also does two things...
- Writes a CSV file.
- Produces plots.
The later should be separated and may already be covered by functionality that already exists.
I've added the desire to write co-ordinates to CSV to #183 (see comment) since this isn't used and I would write it differently anyway to fit within the directory structure of output, use pathlib
rather than os
and so forth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's not used in the main branch, I do use it in my branch. When I merged some of my work into the main back when we were on TopoStats 1.0, I did not enable it as some of my work wasn't complete, but I did intend to keep it. The idea of this method is to produce the coordinates of the traces, so that when other tracing based measurements went wrong, I could always look at the csv files and the plots to check whether the tracing was satisfatory, so as long as the functionalities are covered elsewhere, deleting them here should be fine.
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #593 +/- ##
==========================================
+ Coverage 80.84% 81.65% +0.81%
==========================================
Files 19 19
Lines 2814 2824 +10
==========================================
+ Hits 2275 2306 +31
+ Misses 539 518 -21
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very rigorous. I think that catches everything. Thanks for adding the parametrised tests for linear_or_circular
.
This looks great to me 👍
Also removes unused functions from dnatracing
In looking to change the processing path and have the unit of processing be a single grain rather than the whole image and negate the need for every subsequent method to have a
for x, <something> in emuerate(<list_of_grains>):
we need tests in place to make sure things work as expected.The tests use grain
3
and9
fromminicircle.spm
when selecting these3
was determined to belinear
and9
was determined to becircular
. Strangely though when processing these through the tests both are reported as beingcircular
and so the tests aren't quite complete, but they are useful in that they allow the loops to be removed and the logic shifted toprocess_scan()
(these will be in a forthcoming PR).