From d087faeebc0a88a05e29828134c3038f07aeb9f4 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Mon, 9 Jun 2025 21:56:36 +0200 Subject: [PATCH 1/2] mention yaml schema from main --- docs/source/contributing.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 36ce3d43..c08715ef 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -47,6 +47,22 @@ Once you've developed your node, here's how to integrate it: To support this, ``mlipx`` offers a `JSON Schema `_-based metadata format, defined at ``mlipx/spec/mlips-schema.json``. You can install schema support in VS Code using the CLI command: ``mlipx install-vscode-schema``. + .. dropdown:: Include the MLIP Schema in Your IDE + + Most IDEs support JSON Schema validation. + If you want to include it in VS Code without using the CLI, you can use the schema from `here `_ and include it in your workspace settings: + + .. code-block:: json + + { + "yaml.schemas": { + "https://raw.githubusercontent.com/basf/mlipx/refs/heads/main/mlipx/spec/mlips-schema.json": [ + "**/*.mlips.yaml", + "**/mlips.yaml" + ] + } + } + We recommend including an ``mlips.yaml`` file in your model package at ``/spec/mlips.yaml``. ``mlipx`` will automatically attempt to load this file and use it to inform users about the training data behind your model during comparisons. From 798e4df37de1694870e26b9bc443048fb890eda3 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Mon, 9 Jun 2025 22:13:35 +0200 Subject: [PATCH 2/2] plots without dvc pull --- mlipx/doc_utils.py | 13 +++++++------ pyproject.toml | 2 +- uv.lock | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/mlipx/doc_utils.py b/mlipx/doc_utils.py index 6511f076..beec1735 100644 --- a/mlipx/doc_utils.py +++ b/mlipx/doc_utils.py @@ -1,11 +1,10 @@ import fnmatch -import json import os -import pathlib import plotly.graph_objects as go import plotly.io as pio import zntrack +from dvc.api import DVCFileSystem def show(file: str) -> None: @@ -30,13 +29,15 @@ def show(file: str) -> None: def get_plots(name: str, url: str) -> dict[str, go.Figure]: os.chdir(url) pio.renderers.default = "sphinx_gallery" - with pathlib.Path("zntrack.json").open(mode="r") as f: - all_nodes = list(json.load(f).keys()) - filtered_nodes = [x for x in all_nodes if fnmatch.fnmatch(x, name)] + + fs = DVCFileSystem(subrepos=True) + + all_nodes = [x.addressing for x in fs.repo.stage.collect()] + filtered_nodes = [x for x in all_nodes if fnmatch.fnmatch(x, name)] node_instances = {} for node_name in filtered_nodes: - node_instances[node_name] = zntrack.from_rev(node_name) + node_instances[node_name] = zntrack.from_rev(node_name, fs=fs) result = node_instances[filtered_nodes[0]].compare(*node_instances.values()) return result["figures"] diff --git a/pyproject.toml b/pyproject.toml index e31e5536..ffe7bbc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "typer>=0.15.1", "zndraw>=0.5.10", "znh5md>=0.4.4", - "zntrack>=0.8.5", + "zntrack>=0.8.7", "dvc-s3>=3.2.0", "mpcontribs-client>=5.10.2", "pydantic>=2.10.6", diff --git a/uv.lock b/uv.lock index 70c0715c..6ddfd469 100644 --- a/uv.lock +++ b/uv.lock @@ -5177,7 +5177,7 @@ requires-dist = [ { name = "typer", specifier = ">=0.15.1" }, { name = "zndraw", specifier = ">=0.5.10" }, { name = "znh5md", specifier = ">=0.4.4" }, - { name = "zntrack", specifier = ">=0.8.5" }, + { name = "zntrack", specifier = ">=0.8.7" }, ] provides-extras = ["chgnet", "mace", "sevenn", "orb", "mattersim", "grace", "fairchem", "matpes", "pet-mad"] @@ -13024,7 +13024,7 @@ wheels = [ [[package]] name = "zntrack" -version = "0.8.5" +version = "0.8.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "dvc" }, @@ -13036,7 +13036,7 @@ dependencies = [ { name = "znflow" }, { name = "znjson" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d0/45/e82f034b99f2782b03522ee03be0f356108c7f09156f69c9282b0eafd614/zntrack-0.8.5.tar.gz", hash = "sha256:c118845efaf1e379c3045c6e5de3e3db14e97980a1af025e11babb3fedd97793", size = 341821, upload-time = "2025-04-11T12:09:56.174Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/8a/a48a9beeb0817bf5a48153275559ed5ba2c2d65b892d000c278a3ce48653/zntrack-0.8.7.tar.gz", hash = "sha256:fc51eb7a96cf5d3baf24f413895748e7de1404ba931928267f5fcb2e140ab85b", size = 345873, upload-time = "2025-05-15T14:40:22.564Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/6e/eeb93f3f4f19479e1e1241952f10ab50d8c8f47857becfc95d11b9aff0a2/zntrack-0.8.5-py3-none-any.whl", hash = "sha256:813b4750b8191f15b39941d92f7407c697dbf2cb34c6854266994fbbf34efc57", size = 59377, upload-time = "2025-04-11T12:09:54.686Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e3/8540c753dc6d30ca1cec0789b431921961017eadd80b5f85a6f32a02bd26/zntrack-0.8.7-py3-none-any.whl", hash = "sha256:2eb2e8f4c9ea7d066a02ab28597e7ca21f1983035aad73c9f624aaba34b68316", size = 61030, upload-time = "2025-05-15T14:40:21.498Z" }, ]