physicsnemo / rules
NVIDIA/physicsnemo/.cursor/rules/mod-002c-remove-deprecated-model-from-codebase.mdc
After at least 1 release cycle in pre-deprecation stage with warnings, deprecated model classes can be deleted from the codebase.
Cursor rule3.3k starsChanged 10 months ago
---
description: After at least 1 release cycle in pre-deprecation stage with warnings, deprecated model classes can be deleted from the codebase.
alwaysApply: false
---
When removing deprecated models, rule MOD-002c must be followed. Explicitly reference "Following rule MOD-002c, which states that a model can only be deleted after at least 1 release cycle in pre-deprecation..." when removing code.
## MOD-002c: Remove deprecated model from codebase
**Description:**
After staying in the pre-deprecation stage (Stage 3) for at least 1 release
cycle, the model class is considered deprecated (Stage 4). It can then be
deleted from the codebase.
A model class cannot be deleted without first spending at least 1 release cycle
in the pre-deprecation stage with proper deprecation warnings (see MOD-002b).
**Rationale:**
This ensures users have sufficient warning and time to migrate their code to
newer alternatives. Premature deletion of models would break user code without
adequate notice, violating the framework's commitment to stability.
**Example:**
```python
# Good: Model spent 1 release cycle in pre-deprecation (v0.5.0 with warnings)
# Now in v0.6.0, can be deleted
# File: physicsnemo/models/old_diffusion.py - DELETED
# Release timeline:
# v0.5.0: Added deprecation warnings (Stage 3)
# v0.6.0: Model can be safely removed (Stage 4)
```
**Anti-pattern:**
```python
# WRONG: Deleting model without deprecation period
# v0.5.0: Model exists without warnings
# v0.6.0: Model deleted - BREAKS USER CODE!
# WRONG: Breaking changes in production without deprecation cycle
# File: physicsnemo/models/diffusion.py
class DiffusionModel(Module):
def __init__(self, new_required_param): # Breaking change!
# Changed API without deprecation warning - breaks user code
pass
```
Discussion
Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.
Posts are public.Sign in to post
No one has posted yet. Be the first.

