Skip to content
Draft
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
16 changes: 16 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ Once you've developed your node, here's how to integrate it:
To support this, ``mlipx`` offers a `JSON Schema <https://json-schema.org/>`_-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 <https://raw.githubusercontent.com/basf/mlipx/refs/heads/main/mlipx/spec/mlips-schema.json>`_ 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 ``<your_package>/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.

Expand Down
13 changes: 7 additions & 6 deletions mlipx/doc_utils.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading