Skip to content

Claude instructions - #45

Open
ndaelman-hu wants to merge 18 commits into
mainfrom
claude-instructions
Open

Claude instructions#45
ndaelman-hu wants to merge 18 commits into
mainfrom
claude-instructions

Conversation

@ndaelman-hu

Copy link
Copy Markdown
Owner

No description provided.

Sideboard and others added 18 commits December 3, 2025 13:48
…tection

- Expand ASEDataModel with structural, computational, magnetic, and derived properties
- Add format detection for 60+ file formats across major quantum chemistry and MD codes
- Support VASP, Gaussian, ORCA, CASTEP, NWChem, Quantum Espresso, LAMMPS, Gromacs, and more
- Fix import error by changing type hint from ase.io.Atoms to ase.Atoms
- Add separate import ase line to ensure proper module loading
- Add ase>=3.22.0 as optional dependency in pyproject.toml
- Update parsers group to include ASE parser
- All tests passing (21/21)
ASE stores celldisp as a (3,1) numpy array (column vector), which when
converted with .tolist() becomes [[0.0], [0.0], [0.0]] or [0.0], causing
Pydantic validation errors since Vector3 expects a flat 3-element list.

Solution:
- Add celldisp to special_properties with .flatten() to convert (3,1) -> (3,)
- Add celldisp to skip list to prevent duplicate processing
- Results in proper Vector3 format: [0.0, 0.0, 0.0]

Tested with:
- VASP POSCAR files: celldisp validates correctly
- FHI-aims geometry.in files: celldisp validates correctly
- JSON serialization and re-validation: PASSED
Add docstring for the `format` field in `ase_parse_file_to_model`

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Format nested if-else oneliner

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replaced bare except clauses and removed redundant generic Exception:
- __main__.py: Remove Exception from tuple, keep only (FileNotFoundError, ValueError)
- utils.py line 319: Replace bare except with (AttributeError, RuntimeError, TypeError, ValueError)
- utils.py line 344: Replace bare except with (AttributeError, RuntimeError)

This improves error handling by:
- Being explicit about what errors we're catching
- Allowing unexpected errors to propagate for debugging
- Following PEP 8 best practices
- Add Any to imports from typing
- Type annotate result dict as Dict[str, Any]
- Type hint data variable in ase_parse function
- Handle trajectory files: ase.io.read returns Atoms | list[Atoms]
- Take first structure from trajectory files if list is returned

mypy: 0 errors
@ndaelman-hu
ndaelman-hu requested a review from Copilot December 16, 2025 15:52
@ndaelman-hu ndaelman-hu self-assigned this Dec 16, 2025
@ndaelman-hu ndaelman-hu added the documentation Improvements or additions to documentation label Dec 16, 2025

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 ASE (Atomic Simulation Environment) parser support to parse-patrol and updates documentation to focus on Claude Code integration while removing outdated Claude Desktop instructions.

Key changes:

  • Implements a new ASE parser with comprehensive file format support (80+ formats)
  • Updates installation instructions to recommend Claude Code's MCP CLI over manual configuration
  • Changes minimum Python version from 3.12 to 3.10 for broader compatibility

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
templates/claude-desktop-mcp.json Removed obsolete Claude Desktop manual configuration template
templates/README.md Updated to prioritize Claude Code installation via CLI and reorganized troubleshooting sections
src/parse_patrol/parsers/ase/utils.py Added new ASE parser with 388-line implementation including data model, format detection, and conversion utilities
src/parse_patrol/parsers/ase/stress_test_report.md Added comprehensive stress test report documenting parser performance across 889 files and 21 software packages
src/parse_patrol/parsers/ase/main.py Added MCP server integration for ASE parser with tools, resources, and prompts
src/parse_patrol/main.py Registered ASE parser module in main server configuration
src/parse_patrol/init.py Added ASE parser to dynamic import system
pyproject.toml Added ASE dependency and lowered Python requirement to 3.10
README.md Minor documentation update clarifying MCP protocol usage

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

import ase # pyright: ignore[reportMissingImports]
import ase.io # pyright: ignore[reportMissingImports]
from typing import Optional, Dict, List, Annotated, Any
from pydantic import BaseModel, Field # pyright: ignore[reportMissingImports]

Copilot AI Dec 16, 2025

Copy link

Choose a reason for hiding this comment

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

Corrected spacing before inline comment - should have two spaces before the '#' according to PEP 8 style guidelines.

Suggested change
from pydantic import BaseModel, Field # pyright: ignore[reportMissingImports]
from pydantic import BaseModel, Field # pyright: ignore[reportMissingImports]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants