Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ config = InpaintingConfig(
n_corrector_steps=1,
batch_size=100,
record_trajectories=False,
sampling_config_path=None, # Potentially change it to point to the mattergen sampling config directory
sampling_config_path=None, # ``None`` uses the sampling configs bundled with XtalPaint; potentially change it to point to another sampling config directory
)

results = run_inpainting_pipeline(
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ inpainting=InpaintingConfig(
# Optional
fix_cell=True, # keep unit cell fixed during sampling
record_trajectories=False,
sampling_config_path=None, # override MatterGen sampling config dir
sampling_config_path=None, # ``None`` uses the bundled sampling configs,
# set to override with another dir
)
```

Expand Down
2 changes: 0 additions & 2 deletions mattergen-configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Adapted from https://github.com/microsoft/mattergen/tree/main/mattergen/conf

The `conf` subdirectory contains the standard configurations for training (see [here](https://github.com/microsoft/mattergen/tree/main/mattergen/conf)) and the additional ones for the `pos-only` and the `TD-paint` compatible model. We also copied the standard ones from the `MatterGen` repository to make it easier to specify the configuration file, as the new configuration files only overwrite a few parameters compared to the standard ones.

Similarly, `sampling_conf` contains the standard sampling configurations (see [here](https://github.com/microsoft/mattergen/tree/main/sampling_conf)) and the additional one for the `TD-paint` compatible model.



To perform the training, one can for example run the following command:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where = ["src"]
include = ["xtalpaint*"]

[tool.setuptools.package-data]
"*" = ["**.yaml"]
"xtalpaint" = ["sampling_conf/**/*.yaml"]

# Ruff configuration
[tool.ruff]
Expand Down
2 changes: 2 additions & 0 deletions src/xtalpaint/generate_inpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

_XTALPAINT_SAMPLING_CONF = Path(__file__).parent / "sampling_conf"

_XTALPAINT_SAMPLING_CONF = Path(__file__).parent / "sampling_conf"


def draw_samples_from_sampler(
sampler: PredictorCorrector,
Expand Down
11 changes: 11 additions & 0 deletions src/xtalpaint/sampling_conf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configuration files to sample and train MatterGen

```
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
Adapted from https://github.com/microsoft/mattergen/tree/main/mattergen/conf
and https://github.com/microsoft/mattergen/tree/main/sampling_conf
```


The sampling configurations (the standard ones copied from the `MatterGen` repository, see [here](https://github.com/microsoft/mattergen/tree/main/sampling_conf), plus the additional one for the `TD-paint` compatible model) are shipped inside the package at `src/xtalpaint/sampling_conf`, so that they are also available for wheel installs. XtalPaint falls back to them automatically when `sampling_config_path` is not set, because `MatterGen`'s own default resolves relative to its install location and only exists for source checkouts.
2 changes: 1 addition & 1 deletion tests/test_inpainting_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# resolves relative to its install location and does not exist for wheel
# installs (e.g. in CI).
_SAMPLING_CONF = str(
(Path(__file__).parent.parent / "mattergen-configs" / "sampling_conf").resolve()
(Path(__file__).parent.parent / "src" / "xtalpaint" / "sampling_conf").resolve()
)

_INPAINTING = dict(
Expand Down
Loading