agentleFS
NVIDIAKnown publisherNVIDIA/physicsnemo/.cursor/rules/mod-008a-model-missing-constructor-attributes-tests.mdc

physicsnemo / rules

Cursor rule3.3k starsChanged 12 months agoApache-2.0View on GitHub

Every model must have CI tests verifying constructor instantiation and all public attributes (excluding buffers/parameters) using pytest parameterization.

Trending

Quiet since September.about the whole repository

Dec 2025: 0 mentionsJan 2026: 3 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 3 mentionsJul 2026: 3 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the NVIDIA/physicsnemo repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about NVIDIA/physicsnemo

The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 15

Talked about on GitHub (15 times).

On GitHub · 15

10 more on GitHub

The file

We split this mod-008a-model-missing-constructor-attributes-tests.mdc into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When creating tests for models, rule MOD-008a must be followed.

    line 6
  2. Very specific:

    Every model in physicsnemo/nn or physicsnemo/models must have tests that verify model instantiation and all public attributes (excluding …

    line 12
  3. Very specific:

    Use pytest parameterization to test at least 2 configurations

    line 17
  4. Distinctive:

    Test one configuration with all default arguments

    line 18
  5. Distinctive:

    Test another configuration with non-default arguments

    line 19
  6. Distinctive:

    Verify all public attributes have expected values

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
mod-008a-model-missing-constructor-attributes-tests.mdc
---
description: Every model must have CI tests verifying constructor instantiation and all public attributes (excluding buffers/parameters) using pytest parameterization.
alwaysApply: false
---

When creating tests for models, rule MOD-008a must be followed. Explicitly reference "Following rule MOD-008a, which requires constructor and attribute tests..." when implementing test cases.

## MOD-008a: Model missing constructor/attributes tests

**Description:**

Every model in `physicsnemo/nn` or `physicsnemo/models` must have tests that
verify model instantiation and all public attributes (excluding buffers and
parameters).

These tests should:
- Use `pytest` parameterization to test at least 2 configurations
- Test one configuration with all default arguments
- Test another configuration with non-default arguments
- Verify all public attributes have expected values

**Rationale:**

Constructor tests ensure the model can be instantiated correctly with various
configurations and that all attributes are properly initialized. This catches
issues early in the development cycle.

**Example:**

```python
@pytest.mark.parametrize(
    "config",
    ["default", "custom"],
    ids=["with_defaults", "with_custom_args"]
)
def test_my_model_constructor(config):
    """Test model constructor and attributes."""
    if config == "default":
        model = MyModel(input_dim=64, output_dim=32)
        assert model.hidden_dim == 128  # Default value
        assert model.dropout == 0.0  # Default value
    else:
        model = MyModel(
            input_dim=64,
            output_dim=32,
            hidden_dim=256,
            dropout=0.1
        )
        assert model.hidden_dim == 256
        assert model.dropout == 0.1

    # Test common attributes
    assert model.input_dim == 64
    assert model.output_dim == 32
```

**Anti-pattern:**

```python
# WRONG: Only testing default configuration
def test_my_model_bad():
    model = MyModel(input_dim=64, output_dim=32)
    # Only tests defaults, not custom configurations

# WRONG: Not verifying attributes
def test_my_model_bad():
    model = MyModel(input_dim=64, output_dim=32)
    # Model created but attributes not tested
```

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.