Skip to content

Courtesy of Eva: Add µm support for .top, .stp files #145

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

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

Conversation

SylviaWhittle
Copy link
Collaborator

Adds a check during .stp and .top loading to see if the units are µm or nm and multiplies the real size by 1000 if so.

This is needed for @EvaMartinC to load some AFM images.

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.27%. Comparing base (ac9753c) to head (5d897ee).
Report is 146 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   74.62%   79.27%   +4.64%     
==========================================
  Files           8       11       +3     
  Lines         607      830     +223     
==========================================
+ Hits          453      658     +205     
- Misses        154      172      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SylviaWhittle SylviaWhittle requested a review from ns-rse May 15, 2025 15:08
@SylviaWhittle
Copy link
Collaborator Author

SylviaWhittle commented May 15, 2025

The lines added aren't tested but the code is direct from Eva. What do you think, @ns-rse? I could mock it potentially. But it would simply be a test testing if python successfully multiplies a value by 1000.

Alternatively I could ask for the files that need loading. Would the repo size increase be worth the lines being tested?

Copy link
Collaborator

@ns-rse ns-rse left a comment

Choose a reason for hiding this comment

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

Simple and straight-forward (I had to think about the regex before understanding the grouping).

Perhaps merge and then address tests as a separate issue/pull-request using mocking as you say to set things up? 🤔

Aside : The test wouldn't really be whether Python *1000 rather it would show that our regex and the logic associated with the results are correct by doing the multiplication.

As a further aside have you seen how large the TopoStats repository and its associated history is when cloning? I might if I ever get time try and work out how to remove some of the larger files from the history.

@SylviaWhittle SylviaWhittle force-pushed the SylviaWhittle/stp-top-µm-support branch from d14289a to 5d897ee Compare May 15, 2025 15:49
@SylviaWhittle SylviaWhittle requested a review from ns-rse May 15, 2025 15:50
@SylviaWhittle
Copy link
Collaborator Author

Eva has sent me example files that use um units, I'll add test cases for these 👍

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

Successfully merging this pull request may close these issues.

3 participants