Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure updates #46

Merged
merged 2 commits into from
Mar 27, 2024
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
12 changes: 12 additions & 0 deletions docs/src/index.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ COSMO Software Cookbook
:end-before: marker-intro-end


All the examples provide an ``environment.yml`` file that you can download and
then use with conda to create a new environment with all the required
dependencies for this example.

.. code-block:: bash

# Pick a name for the environment and replace <environment-name> with it
conda env create --name <environment-name> --file environment.yml

# when you want to use the environment
conda env activate --name <environment-name>

.. toctree::
:caption: Table of Contents
:maxdepth: 1
3 changes: 2 additions & 1 deletion examples/batch-cp2k/reference-trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Batch run of CP2K calculations
==============================

.. start-body
:Authors: Matthias Kellner `@bananenpampe <https://github.com/bananenpampe/>`_,
Philip Loche `@PicoCentauri <https://github.com/PicoCentauri/>`_
jwa7 marked this conversation as resolved.
Show resolved Hide resolved

This is an example how to perform single point calculations based on list of structures
using `CP2K <https://www.cp2k.org>`_ using its `reftraj functionality
Expand Down
3 changes: 3 additions & 0 deletions examples/gaas-map/gaas-map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
PCA/PCovR Visualization for the rattled GaAs training dataset
=============================================================

:Authors: Michele Ceriotti `@ceriottm <https://github.com/ceriottm/>`_,
Giulio Imbalzano

This example uses ``rascaline`` and ``metatensor`` to compute
structural properties for the structures in a training for a ML model.
These are then used with simple dimensionality reduction algorithms
Expand Down
3 changes: 3 additions & 0 deletions examples/lode-linear/lode-linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
LODE Tutorial
=============

:Authors: Philip Loche `@PicoCentauri <https://github.com/PicoCentauri/>`_,
Kevin Huguenin-Dumittan `@kvhuguenin <https://github.com/kvhuguenin>`_

This tutorial explains how Long range equivariant descriptors can be constructed using
rascaline and the resulting descriptors be used to construct a linear model with
equisolve
Expand Down
2 changes: 2 additions & 0 deletions examples/roy-gch/roy-gch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Generalized Convex Hull construction for the polymorphs of ROY
==============================================================

:Authors: Michele Ceriotti `@ceriottm <https://github.com/ceriottm/>`_

This notebook analyzes the structures of 264 polymorphs of ROY, from
`Beran et Al, Chemical Science
(2022) <https://doi.org/10.1039/D1SC06074K>`__, comparing the
Expand Down
2 changes: 1 addition & 1 deletion examples/sample-selection/sample-selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Sample and Feature Selection with FPS and CUR
=============================================

.. start-body
:Authors: Davide Tisi `@DavideTisi <https://github.com/DavideTisi>`_

In this tutorial we generate descriptors using rascaline, then select a subset
of structures using both the farthest-point sampling (FPS) and CUR algorithms
Expand Down
2 changes: 1 addition & 1 deletion generate-gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, example):
"examples_dirs": os.path.join(HERE, example),
"gallery_dirs": gallery_dir,
"min_reported_time": 60,
"copyfile_regex": r".*\.(sh|xyz|cp2k)",
"copyfile_regex": r".*\.(sh|xyz|cp2k|yml)",
"matplotlib_animations": True,
}

Expand Down
24 changes: 24 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,30 @@ def build_docs(session):

output.write(f" {path}\n")

# TODO: Explain
with open(file) as fd:
content = fd.read()

if "Download Conda environment file" in content:
# do not add the download link twice
pass
else:
lines = content.split("\n")
with open(file, "w") as fd:
for line in lines:
if "sphx-glr-download-jupyter" in line:
# add the new download link before
fd.write(
"""
.. container:: sphx-glr-download
:download:`Download Conda environment file: environment.yml <environment.yml>`
"""
)

fd.write(line)
fd.write("\n")
Comment on lines +131 to +153
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work very well. I don't know if like that this is here. I rather would like to put this as an extensions sphinx-gallery directly.

I will explore this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you find a way to do this? Or should we merge this version for now?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an idea how to do this within the conf.py. But, we can merge this and I change this later!


session.run("sphinx-build", "-W", "-b", "html", "docs/src", "docs/build/html")


Expand Down