Claude instructions - #45
Open
ndaelman-hu wants to merge 18 commits into
Open
Conversation
…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
… into ase-parser-copy
- 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
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.