Skip to content

Add utility to construct artificial interest fields from detected features#566

Open
Sven-248 wants to merge 4 commits intotobac-project:RC_v1.6.xfrom
Sven-248:feature/feature-to-interest-field
Open

Add utility to construct artificial interest fields from detected features#566
Sven-248 wants to merge 4 commits intotobac-project:RC_v1.6.xfrom
Sven-248:feature/feature-to-interest-field

Conversation

@Sven-248
Copy link
Copy Markdown
Collaborator

@Sven-248 Sven-248 commented Mar 5, 2026

This PR handles #540 and introduces a new utility function features_to_interest_field that reconstructs an artificial interest field from a feature table (e.g. output of tobac feature detection).

The function places blobs at the detected feature positions and generates a corresponding field on a given template grid. Blob amplitude can be derived from a feature property and blob size can be estimated from feature area.

  • Have you followed our guidelines in CONTRIBUTING.md?
  • Have you self-reviewed your code and corrected any misspellings?
  • Have you written documentation that is easy to understand?
  • Have you written descriptive commit messages?
  • Have you added NumPy docstrings for newly added functions?
  • Have you formatted your code using black?
  • If you have introduced a new functionality, have you added adequate unit tests?
  • Have all tests passed in your local clone?
  • If you have introduced a new functionality, have you added an example notebook?
  • Have you kept your pull request small and limited so that it is easy to review?
  • Have the newest changes from this branch been merged?

@Sven-248 Sven-248 requested a review from fsenf March 5, 2026 09:15
@Sven-248 Sven-248 self-assigned this Mar 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

Linting results by Pylint:

Your code has been rated at 8.36/10 (previous run: 8.37/10, -0.01)
The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the RC_v1.6.x branch.
A decrease usually indicates your new code does not fully meet style guidelines or has potential errors.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 74.60317% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.01%. Comparing base (8639ece) to head (fe49b39).

Files with missing lines Patch % Lines
tobac/utils/features_to_field.py 74.60% 16 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.6.x     #566      +/-   ##
=============================================
+ Coverage      64.86%   65.01%   +0.14%     
=============================================
  Files             27       28       +1     
  Lines           4047     4110      +63     
=============================================
+ Hits            2625     2672      +47     
- Misses          1422     1438      +16     
Flag Coverage Δ
unittests 65.01% <74.60%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@freemansw1
Copy link
Copy Markdown
Member

Thanks, @Sven-248 . Can we put this on the agenda for the dev meeting Friday? I'm curious to learn more of the background on this.

Some stylistic notes:

  • Please add docstrings to all these functions
  • Please use typing for the parameters - I think Literal['hdim_1', 'hdim_2'], etc., would be good.

@fsenf fsenf added this to the v.1.6.4 milestone Mar 13, 2026
Copy link
Copy Markdown
Member

@fsenf fsenf left a comment

Choose a reason for hiding this comment

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

Dear @Sven-248 ,

thank you for your contributions. I have been looking for more general things first.

Could you please provide an updated version of the features_to_field.py module with

  • refactoring applied such that no nested functions appear
  • added docstrings

This would help to dive deeper in the next step. Please re-request my review once you are ready.

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.

3 participants