Skip to content

Add atomSize keyword to the ppafm-plot-results.py #390

Merged
ondrejkrejci merged 6 commits into
Probe-Particle:mainfrom
huangchieh:addSize
Jun 11, 2026
Merged

Add atomSize keyword to the ppafm-plot-results.py #390
ondrejkrejci merged 6 commits into
Probe-Particle:mainfrom
huangchieh:addSize

Conversation

@huangchieh

@huangchieh huangchieh commented May 12, 2026

Copy link
Copy Markdown
Contributor

To solve issue #389

  • Add atomSize keyword to ppafm-plot-results.py.
  • In the example of PTCDA_single, add some lines to demonstrate the usage.
  • To demonstrate this, input_plot.xyz is added, which is the same as PTCDA.xyz.

Default atomSize=0.15, as it was in ppafm-plot-results.py:
ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.15
df_atoms_000

ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.5
df_atoms_000

Copilot AI review requested due to automatic review settings May 12, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a configurable atom overlay size to the ppafm-plot-results CLI, enabling users to tune how large atoms are rendered when --atoms/--bonds overlays are enabled (addressing issue #389).

Changes:

  • Add a new --atomSize CLI argument (default 0.15) and wire it into all plotting calls.
  • Extend the PTCDA_single example to show plotting with atoms overlaid and the new flag.
  • Add examples/PTCDA_single/input_plot.xyz for atom overlay demonstrations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ppafm/cli/plot_results.py Adds --atomSize CLI option and passes it through to plotting routines.
examples/PTCDA_single/run.sh Adds an example plotting step using --atoms and --atomSize.
examples/PTCDA_single/input_plot.xyz Provides an atom geometry file used for overlay plotting demonstrations.
examples/PTCDA_single/example_ptcda.py Adds a second plot_results call demonstrating --atoms and --atomSize.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ppafm/cli/plot_results.py
parser.add_argument( "--Fz", action="store_true", help="Plot images for z-component of the (short-range) force acting on the tip in eV/Angstrom")
parser.add_argument( "--pos", action="store_true", help="Save probe particle positions" )
parser.add_argument( "--atoms", action="store_true", help="Plot atoms to images")
parser.add_argument( "--atomSize", action="store", type=float, default=0.15, help="Size of atoms in images")
Comment on lines 11 to +14
ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df

# ======= STEP 4 : Plot the results with atoms overlayed
ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.15
Comment on lines 18 to +20
relaxed_scan(["--klat", "0.5", "--charge", "-0.10"])
plot_results(["--klat", "0.5", "--charge", "-0.10", "--arange", "0.5", "2.0", "2", "--df"])
plot_results(["--klat", "0.5", "--charge", "-0.10", "--arange", "0.5", "2.0", "2", "--df", "--atoms", "--atomSize", "0.15"])

@ondrejkrejci ondrejkrejci 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.

Generally looks good to me, but I was wondering as @NikoOinonen did some time ago this class for all the important parameters, if we should add it there:

class PpafmParameters(pydantic.BaseModel):

@NikoOinonen

Copy link
Copy Markdown
Collaborator

Generally looks good to me, but I was wondering as @NikoOinonen did some time ago this class for all the important parameters, if we should add it there:

class PpafmParameters(pydantic.BaseModel):

This wasn't my work, but it's probably not needed there since the plotting parameter is not passed to anywhere outside plot_results.

@ondrejkrejci

Copy link
Copy Markdown
Collaborator

Thanks, then it is looking good to me.

@ondrejkrejci ondrejkrejci merged commit 9904231 into Probe-Particle:main Jun 11, 2026
11 of 12 checks passed
@huangchieh huangchieh deleted the addSize branch June 11, 2026 14:22
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.

4 participants