Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
46d2880
Move filesystems and version_check to core
coreyjadams Nov 3, 2025
c6d04ad
Fix version check tests
coreyjadams Nov 3, 2025
6f36f03
Reorganize distributed, domain_parallel, and begin nn / utils cleanup.
coreyjadams Nov 3, 2025
7824091
Move modules and meta to core. Move registry to core.
coreyjadams Nov 3, 2025
f753573
Add missing init files
coreyjadams Nov 3, 2025
2ef835e
Update build system and specify some deps.
coreyjadams Nov 3, 2025
1603067
Merge branch 'main' into refactor
coreyjadams Nov 3, 2025
1e8df52
Reorganize tests.
coreyjadams Nov 3, 2025
2e1195c
Update init files
coreyjadams Nov 3, 2025
a698685
Clean up neighbor tools.
coreyjadams Nov 3, 2025
258d988
Update testing
coreyjadams Nov 3, 2025
0638b97
Fix compat tests
coreyjadams Nov 3, 2025
b6327cb
Move core model tests to tests/core/
coreyjadams Nov 3, 2025
3ce049a
Add import lint config
coreyjadams Nov 3, 2025
95fa450
Relocate layers
coreyjadams Nov 3, 2025
ba6813d
Move graphcast utils into model directory
coreyjadams Nov 3, 2025
3f10463
Relocating util functionalities.
coreyjadams Nov 4, 2025
339b484
Further clean up and organize tests.
coreyjadams Nov 5, 2025
18df402
Merge branch 'NVIDIA:main' into refactor
coreyjadams Nov 5, 2025
d6946d9
utils tests are passing now
coreyjadams Nov 5, 2025
66f8d15
Cleaning up distributed tests
coreyjadams Nov 5, 2025
2ee76db
Patching tests working again in nn
coreyjadams Nov 5, 2025
33d525d
Fix sdf test
coreyjadams Nov 5, 2025
a06ad0a
Fix zenith angle tests
coreyjadams Nov 5, 2025
4c845cc
Some organization of tests. Checkpoints is moved into utils.
coreyjadams Nov 5, 2025
3bb64f4
Remove launch.utils and launch.config. Checkpointing is moved to
coreyjadams Nov 5, 2025
4aa332e
Most nn tests are passing
coreyjadams Nov 5, 2025
45686cc
Further cleanup. Getting there!
coreyjadams Nov 5, 2025
bbc54f6
Remove constants file
coreyjadams Nov 5, 2025
8453fea
Add import linting to pre-commit.
coreyjadams Nov 5, 2025
7ff2a2a
Refactor (#1208)
coreyjadams Nov 5, 2025
f850488
Merge branch 'main' into refactor
coreyjadams Nov 5, 2025
1c5f91c
Merge branch 'main' into v2.0-refactor
coreyjadams Nov 5, 2025
21343f5
Unmigrate the insolation utils (#1211)
pzharrington Nov 6, 2025
337c91e
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 7, 2025
4583c42
Move gnn layers and start to fix several model tests.
coreyjadams Nov 7, 2025
e326d4a
AFNO is now passing.
coreyjadams Nov 7, 2025
b95097d
Rnn models passing.
coreyjadams Nov 7, 2025
d8bc6f9
Fix improt
coreyjadams Nov 7, 2025
314f1b2
Healpix tests are working
coreyjadams Nov 7, 2025
9c7d287
Domino and unet working
coreyjadams Nov 7, 2025
0012209
Refactor (#1216)
coreyjadams Nov 7, 2025
32e1dce
Update activations path in dlwp tests (#1217)
pzharrington Nov 7, 2025
afa903f
Updating to address some test issues
coreyjadams Nov 10, 2025
91ceb0a
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 10, 2025
f9130a6
Merge branch 'main' into v2.0-refactor
coreyjadams Nov 10, 2025
ceb1eb8
Merge branch 'main' into refactor
coreyjadams Nov 10, 2025
0592d80
MGN tests passing again
coreyjadams Nov 10, 2025
857b3db
Most graphcast tests passing again
coreyjadams Nov 10, 2025
f89a2fb
Move nd conv layers.
coreyjadams Nov 10, 2025
409200d
update fengwu and pangu
coreyjadams Nov 10, 2025
14b51fd
Update sfno and pix2pix test
coreyjadams Nov 10, 2025
27fd304
update tests for figconvnet, swinrnn, superresnet
coreyjadams Nov 10, 2025
0d22d11
updating more models to pass
coreyjadams Nov 10, 2025
60ba0ce
Update distributed tests, now passing.
coreyjadams Nov 10, 2025
7ec2251
Domain parallel tests now passing.
coreyjadams Nov 11, 2025
d9fe7a4
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 12, 2025
af9e359
Fix active learning imports so tests pass in refactor
coreyjadams Nov 12, 2025
e3b7849
Fix some metric imports
coreyjadams Nov 12, 2025
b1f2ef9
Remove deploy package
coreyjadams Nov 12, 2025
f46ff8c
Remove unused test file
coreyjadams Nov 12, 2025
edd2224
unmigrate these files ... again?
coreyjadams Nov 12, 2025
1c769e3
Update import linter.
coreyjadams Nov 12, 2025
b9aa3dd
Refactor (#1224)
coreyjadams Nov 12, 2025
8d8255a
Merge branch 'main' into refactor
coreyjadams Nov 12, 2025
8b266b0
Cleaning up diffusion models. Not quite done yet.
coreyjadams Nov 12, 2025
8a8a05a
Merge branch 'main' into refactor
coreyjadams Nov 12, 2025
9b0d40d
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 13, 2025
ff0aacf
Restore deleted files
coreyjadams Nov 13, 2025
f11fcd7
Updating more tests.
coreyjadams Nov 13, 2025
9e32712
Further updates to tests. Datapipes almost working.
coreyjadams Nov 14, 2025
4fe41b9
Refactor (#1231)
coreyjadams Nov 14, 2025
0b78d6c
Merge branch 'NVIDIA:main' into refactor
coreyjadams Nov 17, 2025
ac1fcef
update import paths
coreyjadams Nov 17, 2025
d81ee43
Starting to clean up dependency tree.
coreyjadams Nov 18, 2025
dff27b3
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 18, 2025
8a0a3a5
Refactor (#1233)
coreyjadams Nov 18, 2025
3cb9a02
Added coding standards for model implementations as a custom context …
CharlelieLrt Nov 18, 2025
d7bcd0d
Fixing and adjusting a broad suite of tests.
coreyjadams Nov 19, 2025
d32879d
Merge branch 'NVIDIA:main' into refactor
coreyjadams Nov 19, 2025
c4ef437
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 19, 2025
b3b7786
Update test/domain_parallel/conftest.py
coreyjadams Nov 19, 2025
af41fdf
Minor fix
coreyjadams Nov 19, 2025
611a029
Refactor (#1234)
coreyjadams Nov 19, 2025
58c909c
Merge branch 'main' into v2.0-refactor
coreyjadams Nov 19, 2025
17ff6de
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 19, 2025
e83ea99
Not seeing any errors in testing ...
coreyjadams Nov 19, 2025
ec163e1
Breakdown of rules into smaller rules (#1236)
CharlelieLrt Nov 19, 2025
15a04f1
Merge branch 'NVIDIA:main' into refactor
coreyjadams Nov 20, 2025
42e4b40
Refactor (#1240)
coreyjadams Nov 20, 2025
ff8ddac
Merge branch 'main' into v2.0-refactor
coreyjadams Nov 20, 2025
51c0ccb
Merge branch 'main' into refactor
coreyjadams Nov 24, 2025
e16f9f2
Refactor (#1247)
coreyjadams Nov 24, 2025
60ccc72
Enable import linting on internal imports.
coreyjadams Nov 24, 2025
9b62b7d
Remove ensure_available function, it's confusing
coreyjadams Nov 24, 2025
f05150f
Add logging imports to utils, and fix imports in examples.
coreyjadams Nov 24, 2025
64d731f
Update imports in minimal examples
coreyjadams Nov 24, 2025
725ecfe
Update structural mechanics examples
coreyjadams Nov 24, 2025
d8e5f05
Update import paths: reservoir_sim
coreyjadams Nov 24, 2025
666be4b
Update import paths: additive manufacturing
coreyjadams Nov 24, 2025
19b8afd
Update import paths: topodiff
coreyjadams Nov 24, 2025
824c76a
Update import paths: weather part 1
coreyjadams Nov 24, 2025
641c110
Update import paths: weather part 2
coreyjadams Nov 24, 2025
2e056db
Update import paths: molecular dynamics
coreyjadams Nov 24, 2025
6a9f6e6
Update import paths: geophysics
coreyjadams Nov 24, 2025
b874e4e
Update import paths: cfd + external_aero 1
coreyjadams Nov 24, 2025
23f2955
Update import paths: cfd + external_aero 2
coreyjadams Nov 24, 2025
581c79a
Remove more DGL examples
coreyjadams Nov 24, 2025
6d780d7
Remove more DGL examples
coreyjadams Nov 24, 2025
7763d96
cfd examples 3
coreyjadams Nov 24, 2025
53fa1cb
Last batch of example import fixes!
coreyjadams Nov 24, 2025
1cd3ada
Merge branch 'v2.0-refactor' into refactor
coreyjadams Nov 24, 2025
5fdcf0f
Enforce and protect external deps in utils.
coreyjadams Nov 25, 2025
b5842e3
Remove DGL. :party:
coreyjadams Nov 25, 2025
da742e7
Don't force models yet
coreyjadams Nov 25, 2025
6c872a0
Refactor (#1249)
coreyjadams Nov 25, 2025
363126a
Automated model registry (#1252)
CharlelieLrt Nov 26, 2025
76a29ef
Metadata name deprecation (#1257)
CharlelieLrt Nov 26, 2025
942c375
Merge main into local refactor
coreyjadams Dec 1, 2025
8d8939d
Refactor (#1258)
coreyjadams Dec 1, 2025
cbc2dd3
Merge branch 'main' into v2.0-refactor
coreyjadams Dec 1, 2025
170efa7
Merge branch 'v2.0-refactor' into refactor
coreyjadams Dec 1, 2025
8898450
Remove IPDB
coreyjadams Dec 1, 2025
8aa8dd9
Few more dep fixes.
coreyjadams Dec 1, 2025
70d9135
Merge branch 'main' into refactor
coreyjadams Dec 2, 2025
ec69852
Refactor (#1261)
coreyjadams Dec 2, 2025
17788b0
Merge branch 'main' into v2.0-refactor
coreyjadams Dec 2, 2025
3c03b08
Add external import coding standards.
coreyjadams Dec 2, 2025
a842398
Update external import standards.
coreyjadams Dec 3, 2025
dae0942
Ensure vtk functions are protected.
coreyjadams Dec 3, 2025
042f7ea
Protect pyvista import
coreyjadams Dec 3, 2025
5bb0e6f
Closing more import gaps
coreyjadams Dec 3, 2025
d35d5c7
Remove DGL from meshgraphkan
coreyjadams Dec 3, 2025
12b98d8
All models now comply with external import linting.
coreyjadams Dec 3, 2025
a879e8d
Remove DGL datapipes
coreyjadams Dec 3, 2025
b200b50
cae datapipes in compliance
coreyjadams Dec 3, 2025
cb1766c
Update pyproject.toml
coreyjadams Dec 3, 2025
d339e1f
Add version numbers to deps
coreyjadams Dec 3, 2025
aad176c
Refactor (#1261)
coreyjadams Dec 3, 2025
6c9cebd
Merge branch 'refactor' into v2.0-refactor
coreyjadams Dec 3, 2025
7422e4c
fix import error from wandb
coreyjadams Dec 3, 2025
75490ea
remove instance check
coreyjadams Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 58 additions & 0 deletions .cursor/rules/mod-000a-reusable-layers-belong-in-nn.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: Reusable layers and building blocks should be placed in physicsnemo/nn, not physicsnemo/models. Examples include FullyConnected, attention layers, and UNetBlock.
alwaysApply: false
---

When creating or refactoring reusable layer code, rule MOD-000a must be followed. Explicitly reference "Following rule MOD-000a, which states that reusable layers should go in physicsnemo/nn..." when explaining placement decisions.

## MOD-000a: Reusable layers/blocks belong in physicsnemo.nn

**Description:**

Reusable layers that are the building blocks of more complex architectures
should go into `physicsnemo/nn`. Those include for instance `FullyConnected`,
various variants of attention layers, `UNetBlock` (a block of a U-Net), etc.

All layers that are directly exposed to the user should be imported in
`physicsnemo/nn/__init__.py`, such that they can be used as follows:

```python
from physicsnemo.nn import MyLayer
```

The only exception to this rule is for layers that are highly specific to a
single example. In this case, it may be acceptable to place them in a module
specific to the example code, such as `examples/<example_name>/utils/nn.py`.

**Rationale:**

Ensures consistency in the organization of reusable layers in the repository.
Keeping all reusable components in a single location makes them easy to find
and promotes code reuse across different models.

**Example:**

```python
# Good: Reusable layer in physicsnemo/nn/attention.py
class MultiHeadAttention(Module):
"""A reusable attention layer that can be used in various architectures."""
pass

# Good: Import in physicsnemo/nn/__init__.py
from physicsnemo.nn.attention import MultiHeadAttention

# Good: Example-specific layer in examples/weather/utils/nn.py
class WeatherSpecificLayer(Module):
"""Layer highly specific to the weather forecasting example."""
pass
```

**Anti-pattern:**

```python
# WRONG: Reusable layer placed in physicsnemo/models/
# File: physicsnemo/models/attention.py
class MultiHeadAttention(Module):
"""Should be in physicsnemo/nn/ not physicsnemo/models/"""
pass
```
54 changes: 54 additions & 0 deletions .cursor/rules/mod-000b-complete-models-belong-in-models.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: Complete models composed of multiple layers should be placed in physicsnemo/models, not physicsnemo/nn. These are domain-specific or modality-specific models.
alwaysApply: false
---

When creating or refactoring complete model code, rule MOD-000b must be followed. Explicitly reference "Following rule MOD-000b, which states that complete models should go in physicsnemo/models..." when explaining placement decisions.

## MOD-000b: Complete models belong in physicsnemo.models

**Description:**

More complete models, composed of multiple layers and/or other sub-models,
should go into `physicsnemo/models`. All models that are directly exposed to
the user should be imported in `physicsnemo/models/__init__.py`, such that they
can be used as follows:

```python
from physicsnemo.models import MyModel
```

The only exception to this rule is for models that are highly specific to a
single example. In this case, it may be acceptable to place them in a module
specific to the example code, such as `examples/<example_name>/utils/nn.py`.

**Rationale:**

Ensures consistency and clarity in the organization of models in the repository,
in particular a clear separation between reusable layers and more complete
models that are applicable to a specific domain or specific data modality.

**Example:**

```python
# Good: Complete model in physicsnemo/models/transformer.py
class TransformerModel(Module):
"""A complete transformer model composed of attention and feedforward layers."""
def __init__(self):
super().__init__()
self.attention = MultiHeadAttention(...)
self.ffn = FeedForward(...)

# Good: Import in physicsnemo/models/__init__.py
from physicsnemo.models.transformer import TransformerModel
```

**Anti-pattern:**

```python
# WRONG: Complete model placed in physicsnemo/nn/
# File: physicsnemo/nn/transformer.py
class TransformerModel(Module):
"""Should be in physicsnemo/models/ not physicsnemo/nn/"""
pass
```
47 changes: 47 additions & 0 deletions .cursor/rules/mod-001-use-physicsnemo-module-as-base-class.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
description: All model and layer classes must inherit from physicsnemo.Module (not torch.nn.Module directly) to ensure proper serialization, versioning, and registry functionality.
alwaysApply: false
---

When creating or modifying model classes, rule MOD-001 must be strictly followed. Explicitly reference "Following rule MOD-001, which states that all model classes must inherit from physicsnemo.Module..." when explaining inheritance decisions.

## MOD-001: Use physicsnemo.Module as model base classes

**Description:**

All model classes must inherit from `physicsnemo.Module`. Direct subclasses of
`torch.nn.Module` are not allowed. Direct subclasses of `physicsnemo.Module`
are allowed (note that `physicsnemo.Module` is a subclass of `torch.nn.Module`).
Ensure proper initialization of parent classes using `super().__init__()`. Pass
the `meta` argument to the `super().__init__()` call if appropriate, otherwise
set it manually with `self.meta = meta`.

**Rationale:**

Ensures invariants and functionality of the `physicsnemo.Module` class for all
models. In particular, instances of `physicsnemo.Module` benefit from features
that are not available in `torch.nn.Module` instances. Those include serialization
for checkpointing and loading modules and submodules, versioning system to
handle backward compatibility, as well as ability to be registered in the
`physicsnemo.registry` for easy instantiation and use in any codebase.

**Example:**

```python
from physicsnemo import Module

class MyModel(Module):
def __init__(self, input_dim: int, output_dim: int):
super().__init__(meta=MyModelMetaData())
self.linear = nn.Linear(input_dim, output_dim)
```

**Anti-pattern:**

```python
from torch import nn

class MyModel(nn.Module):
def __init__(self, input_dim: int, output_dim: int):
self.linear = nn.Linear(input_dim, output_dim)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
description: New model classes should start in physicsnemo/experimental/nn or physicsnemo/experimental/models during development, where backward compatibility is not guaranteed.
alwaysApply: false
---

When creating new model or layer classes, rule MOD-002a must be followed. Explicitly reference "Following rule MOD-002a, which states that new models should start in physicsnemo/experimental/..." when explaining where to place new code.

## MOD-002a: New models and layers belong in physicsnemo.experimental

**Description:**

For the vast majority of models, new classes are created either in
`physicsnemo/experimental/nn` for reusable layers, or in
`physicsnemo/experimental/models` for more complete models. The `experimental`
folder is used to store models that are still under development (beta or alpha
releases) during this stage, backward compatibility is not guaranteed.

One exception is when the developer is highly confident that the model is
sufficiently mature and applicable to many domains or use cases. In this case
the model class can be created in the `physicsnemo/nn` or `physicsnemo/models`
folders directly, and backward compatibility is guaranteed.

Another exception is when the model class is highly specific to a single
example. In this case, it may be acceptable to place it in a module specific to
the example code, such as `examples/<example_name>/utils/nn.py`.

After staying in experimental for a sufficient amount of time (typically at
least 1 release cycle), the model class can be promoted to production. It is
then moved to the `physicsnemo/nn` or `physicsnemo/models` folders, based on
whether it's a reusable layer or complete model (see MOD-000a and MOD-000b).

**Note:** Per MOD-008a, MOD-008b, and MOD-008c, it is forbidden to move a model
out of the experimental stage/directory without the required CI tests.

**Rationale:**

The experimental stage allows rapid iteration without backward compatibility
constraints, enabling developers to refine APIs based on user feedback. This
protects users from unstable APIs while allowing innovation.

**Example:**

```python
# Good: Stage 1 - New experimental model
# File: physicsnemo/experimental/models/new_diffusion.py
class DiffusionModel(Module):
"""New diffusion model under active development. API may change."""
pass

# Good: After 1+ release cycles, promoted to production
# File: physicsnemo/models/diffusion.py (moved from experimental/)
class DiffusionModel(Module):
"""Stable diffusion model with backward compatibility guarantees."""
pass
```

**Anti-pattern:**

```python
# WRONG: New model directly in production folder
# File: physicsnemo/models/brand_new_model.py (should be in experimental/ first)
class BrandNewModel(Module):
"""Skipped experimental stage - risky for stability"""
pass
```
69 changes: 69 additions & 0 deletions .cursor/rules/mod-002b-add-deprecation-warnings-to-model.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
description: Model classes being deprecated must include deprecation warnings in both docstring and runtime, explaining why and what users should use instead, for at least 1 release cycle.
alwaysApply: false
---

When deprecating a model class, rule MOD-002b must be followed. Explicitly reference "Following rule MOD-002b, which requires adding deprecation warnings to both docstring and runtime..." when implementing deprecation.

## MOD-002b: Add deprecation warnings to deprecating model class

**Description:**

For a model class in the pre-deprecation stage in `physicsnemo/nn` or
`physicsnemo/models`, the developer should start planning its deprecation. This
is done by adding a warning message to the model class, indicating that the
model class is deprecated and will be removed in a future release.

The warning message should be a clear and concise message that explains why the
model class is being deprecated and what the user should do instead. The
deprecation message should be added to both the docstring and should be raised
at runtime. The developer is free to choose the mechanism to raise the
deprecation warning.

A model class cannot be deprecated without staying in the pre-deprecation stage
for at least 1 release cycle before it can be deleted from the codebase.

**Rationale:**

Ensures users have sufficient time to migrate to newer alternatives, preventing
breaking changes that could disrupt their workflows. This graduated approach
balances innovation with stability, a critical requirement for a scientific
computing framework.

**Example:**

```python
# Good: Pre-deprecation with warning
# File: physicsnemo/models/old_diffusion.py
class DiffusionModel(Module):
"""
Legacy diffusion model.

.. deprecated:: 0.5.0
``OldDiffusionModel`` is deprecated and will be removed in version 0.7.0.
Use :class:`~physicsnemo.models.NewDiffusionModel` instead.
"""
def __init__(self):
import warnings
warnings.warn(
"OldDiffusionModel is deprecated. Use NewDiffusionModel instead.",
DeprecationWarning,
stacklevel=2
)
super().__init__()
```

**Anti-pattern:**

```python
# WRONG: No deprecation warning in code
# File: physicsnemo/models/old_model.py
class OldModel(Module):
"""Will be removed next release.""" # Docstring mentions it but no runtime warning
def __init__(self):
# Missing: warnings.warn(..., DeprecationWarning)
super().__init__()

# WRONG: Deprecation without sufficient warning period
# (Model deprecated and removed in same release)
```
50 changes: 50 additions & 0 deletions .cursor/rules/mod-002c-remove-deprecated-model-from-codebase.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
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
```
Loading