Skip to content

Surface site classification (2nd attempt) - #491

Merged
Alexsp32 merged 9 commits into
mainfrom
surface-site-classification-2
Jul 8, 2026
Merged

Surface site classification (2nd attempt)#491
Alexsp32 merged 9 commits into
mainfrom
surface-site-classification-2

Conversation

@Alexsp32

@Alexsp32 Alexsp32 commented Jun 1, 2026

Copy link
Copy Markdown
Member

#437 is horribly out of sync, so here's a new PR instead.

This PR adds an Analysis submodule HighSymmetrySites, which can be used to relate positions of adsorbates within a Periodic Cell to high-symmetry sites on the cell.

ToDo:

  • Document trajectory analysis.
  • Ensure API docs automatically generate properly
  • Unit tests functioning

Alexsp32 added 8 commits June 1, 2026 12:57
Add HighSymmetrySites.jl providing utilities to map 2D adsorbate
positions on slab surfaces to high-symmetry site categories.

- Introduce SlabStructure type to hold adsorbate indices, site
  definitions and supercell size.
- Define default FCC site dictionaries for common facets (100, 110,
  111, 211) with named categories (top, bridge, fcc, hcp, step_edge,
  etc.).
- Implement positions_to_category(position, categories, cell;
  fractional=false, snap_to_site=0.03) to classify an XY position by
  nearest site (returns :other if outside cell or no close site).
  - Supports both cartesian and fractional comparisons.
  - Truncates positions to 2D and validates they lie inside the
    periodic cell before classification.
- Export types and functions (SlabStructure, FCC*Sites,
  positions_to_category, classify_every_frame placeholder).
- Add module-level docs describing usage and limitations (2D XY plane
  assumption).

(cherry picked from commit 52be44edba3db3d57668393f76bd137b74a74d56)
(cherry picked from commit 9a66266d66178c4c959ef33a01fbb9c350732678)
Add OutputSurfaceSiteClassification type to record slab
structure, fractional flag and snap threshold for aligning.
Classify each frame using HighSymmetrySites.

(cherry picked from commit 34c4d442150f49ba06911af3535a5d5ed01cb2aa)
(cherry picked from commit 83084cd88368ef6cd86c7b71c18777a22fe8cc89)
(cherry picked from commit ef11dd24edd126c33fd6c58997f03f69a0bcc54b)
(cherry picked from commit f1861c4aceeb38be00be16a3e509a914038c73ba)
(cherry picked from commit 5e23839971c4a2afe3c24549c324d156123d6f64)
(cherry picked from commit b9fbf748c93883d47459e9e26674e957d0d2a471)
@Alexsp32

Alexsp32 commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@claude[agent] Please update the documentation with an example for this new functionality.

@Claude

Claude AI commented Jun 1, 2026

Copy link
Copy Markdown

@claude[agent] Please update the documentation with an example for this new functionality.

Done! I've added comprehensive documentation for HighSymmetrySites including:

  1. API documentation (automatically generated)
  2. Usage guide in the output_and_analysis section with basic examples
  3. A complete example file (surface_site_classification.md) showing how to classify adsorbate positions on FCC surfaces

The documentation covers all predefined surface facets (FCC100, FCC110, FCC111, FCC211) and shows how to use both single-position classification and full trajectory analysis. Commit: 4e8c935

Copilot stopped work on behalf of Alexsp32 due to an error June 1, 2026 11:21

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

Looks good. Nice docs and tests

@Alexsp32
Alexsp32 merged commit 4dfbaf5 into main Jul 8, 2026
7 of 13 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.

3 participants