Skip to content

Add feature to enable overlaying the atoms to the generated AFM images. - #364

Merged
NikoOinonen merged 3 commits into
Probe-Particle:mainfrom
huangchieh:overlayAtoms
Oct 18, 2025
Merged

Add feature to enable overlaying the atoms to the generated AFM images. #364
NikoOinonen merged 3 commits into
Probe-Particle:mainfrom
huangchieh:overlayAtoms

Conversation

@huangchieh

@huangchieh huangchieh commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Fix #363

  1. Pass the atoms to the method eval in AFMulator.
  2. To distinguish from the default output, prefix can be used when overlaying the atoms.

@NikoOinonen

Copy link
Copy Markdown
Collaborator

I'm not sure I like adding more plotting arguments to eval. The plot_to_dir argument was meant as just a easy thing to use when you just quickly need some basic image output. I think I would only add this option to plot_images and let the user call that method themselves when needed. So the workflow would be:

afm = afmulator(xyzs, Zs, ...)
afmulator.plot_images(afm, ..., atoms=atoms)

We could also do this in a more generic way by passing all possible arguments to the underlying plotting function plotImages with something like:

def plot_images(self, X, ..., **plot_kwargs):
    ...
    plotImages(
        ...
        **plot_kwargs
    )

@huangchieh

Copy link
Copy Markdown
Contributor Author

Indeed, passing all possible arguments to the plotting function plotImages is much more elegant. I updated.

Comment thread ppafm/ocl/AFMulator.py
@codecov

codecov Bot commented Oct 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.58%. Comparing base (c6e7e74) to head (0448c4f).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
ppafm/ocl/AFMulator.py 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #364      +/-   ##
==========================================
- Coverage   55.61%   55.58%   -0.04%     
==========================================
  Files          40       44       +4     
  Lines        6252     6268      +16     
==========================================
+ Hits         3477     3484       +7     
- Misses       2775     2784       +9     
Flag Coverage Δ
python-3.10 55.58% <16.66%> (?)
python-3.11 55.55% <16.66%> (?)
python-3.12 55.55% <16.66%> (-0.06%) ⬇️
python-3.13 55.55% <16.66%> (?)
python-3.8 55.50% <16.66%> (?)
python-3.9 55.50% <16.66%> (?)

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.

@NikoOinonen NikoOinonen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, looks good now.

@NikoOinonen
NikoOinonen merged commit c0c8a9e into Probe-Particle:main Oct 18, 2025
8 checks passed
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.

Overlaying the atoms to the simulated images in AFMulator.py

2 participants