agentsclimarketplace

Scine add ml model

Skill rangsimanketkaew/scine-agent-skills/skills/scine-add-ml-model

Add a new machine learning (ML) model as a calculator in the SCINE Parrot module. Use when integrating a new ML potential or interatomic potential (e.g., MACE, ANI, M3GNet, LMLP, NequIP, or any custom ML model) into scine_parrot. Covers creating the calculator class, registering in the calculator registry, adding CLI support, writing unit tests, and updating documentation.From its SKILL.md

Install
npx -y skills add rangsimanketkaew/scine-agent-skills --skill scine-add-ml-model

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.6 KB, as published. Nobody here has run it

Add a New ML Model to SCINE Parrot

When to Use

  • Integrating a new ML potential or force field into scine_parrot
  • Adding a new calculator class following the existing *_calculator.py pattern
  • Registering a new model in the Parrot calculator registry and CLI

Existing Models to Reference

Study these before implementing:

FileModel
scine_parrot/lmlp_calculator.pyLMLP
scine_parrot/mace_calculator.pyMACE
scine_parrot/m3gnet_calculator.pyM3GNet
scine_parrot/ani_calculator.pyANI

Base interfaces: scine_parrot/calculator.py, scine_parrot/module.py Entry point: scine_parrot/__main__.py

Files to Create / Modify

FileActionPurpose
scine_parrot/my_model_calculator.pyCreateML model calculator class
scine_parrot/calculator.pyEditAdd import + register model
scine_parrot/__main__.pyEditAdd CLI options for new model
scine_parrot/test/test_my_model.pyCreateUnit tests
README.rstEditDocument new model

Full reference: parrot-guide.md


Step 1 — Create the Calculator Class

Name: my_model_calculator.py in scine_parrot/ (pattern: MODEL_NAME_calculator.py)

Copy structure from an existing calculator. Implement at minimum:

class MyModelCalculator:
    def __init__(self, model_path, **kwargs):
        """Initialize model with parameters and weights."""
        self.model = self.load_model(model_path)

    def predict(self, elements, positions, lattice=None, **kwargs):
        """
        Predict molecular properties.

        Args:
            elements: Atomic numbers or symbols (list or numpy array)
            positions: Atomic coordinates (N×3 numpy array, Angstroms)
            lattice:   Unit cell (3×3 array, for periodic systems)

        Returns:
            dict with 'energy' (scalar) and 'forces' (N×3 array)
        """
        pass

    def load_model(self, model_path):
        """Load model weights and parameters from path."""
        pass

I/O Conventions

DirectionFieldTypeUnits
Inputelementslist/array of int or stratomic numbers or symbols
InputpositionsN×3 numpy arrayAngstroms
Inputlattice3×3 numpy array or NoneAngstroms (periodic only)
OutputenergyscalareV or Hartree
OutputforcesN×3 numpy arrayeV/Å or Hartree/Bohr

Step 2 — Register in Calculator Registry

scine_parrot/calculator.py:

  • Add import for MyModelCalculator
  • Register it in any factory functions or model selection logic
  • Ensure it conforms to the same interface as existing calculators

Step 3 — Add CLI Support

scine_parrot/__main__.py:

  • Add argument(s) to select your model
  • Update argument parsing for model-specific parameters (e.g., model_path, config options)
  • Provide sensible defaults

Step 4 — Configuration (if needed)

  • Add new parameters to existing config parsers
  • Document new options; provide sensible defaults
  • Minimise external dependencies; add any new packages to requirements.txt

Step 5 — Unit Tests

scine_parrot/test/test_my_model.py — cover:

  • Model loading and initialisation
  • Basic energy/force prediction
  • Input validation and error handling
  • Output format verification (shapes, units)
  • Edge cases: single atom, large system, periodic system

Step 6 — Documentation

  • Add comprehensive docstrings to all classes and methods
  • Update README.rst with model description and usage example
  • Document any new configuration options

Quality Gates

  • Calculator class follows existing *_calculator.py pattern (same method signatures and return dict keys)
  • Registered in calculator.py — model is selectable at runtime
  • CLI options added and tested in __main__.py
  • All unit tests pass: pytest scine_parrot/test/test_my_model.py -v
  • Regression tests pass: pytest scine_parrot/test/ -v (no existing tests broken)
  • Docstrings complete on class and public methods
  • README.rst updated

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.